-
Notifications
You must be signed in to change notification settings - Fork 22
Installation stop #277
Comments
Hi, |
Hello :-), Are you sure the permissions are correct? Did you grab the project from an archive (ZIP or PHAR) or directly from Github? |
Hello, What are permissions that I must to use ? |
The real problem here is lack of proper feedback. Basically, the webserver needs to have full write access to everything in the |
yes, I set full write access to data/ |
Sorry I was absent these days because I am a fresh new father 😉. |
(OS is Ubuntu ok) |
Hello Hywan, congratulation for birth ! this is phpinfo of my server: http://178.62.61.170/info.php |
Do you have the same issue while installing from the archive instead of the Git repository? |
I have not tried ... on GIt web and command line ... command line works fine |
Hi, I have the same issue.
8:32 is the unzip time, and 8:56 is the install.php time. The webserver is a Synology station:
Hope it helps! |
I am able to reproduce this issue with the git clone [email protected]:fruux/sabre-katana.git
cd sabre-katana/
make install Open Run Reload Give the installer all the necessary data and choose MySQL. An error occured: fstat() expects parameter 1 to be resource, boolean given Reloading the installer page in the browser however then returns:
Logging in doesn't work though, because the database has not been set up. Maybe this is also the root cause of #279. |
@DominikTo I reproduce the same error, while using the browser-based installer (which I hadn't use so far). |
The last message that the installer emits before the error appears is: So the problem must be related to: |
Maybe a missing file / wrong path at some point during the process? edit: the problem may be with the |
If I had a way to easily convince sabre-katana to give me a stack trace or any helpful output at all, this would probably be quite easy to debug. :-) /cc @Hywan This is the response body for the failing
|
Here's the stack trace for this issue: fstat() expects parameter 1 to be resource, boolean given
#0 /sabre-katana/vendor/hoa/core/Core.php(391): Hoa\Core\Exception\Idle::error(2, 'fstat() expects parameter 1 to be resource, boolean given', '/sabre-katana/vendor/hoa/core/Protocol.php', 843, Array)
#1 unknown file(unknown line): Hoa\Core\Core::Hoa\Core\{closure}(2, 'fstat() expects parameter 1 to be resource, boolean given', '/sabre-katana/vendor/hoa/core/Protocol.php', 843, Array)
#2 /sabre-katana/vendor/hoa/core/Protocol.php(843): fstat(false)
#3 unknown file(unknown line): Hoa\Core\Protocol\Wrapper->stream_stat()
#4 /sabre-katana/vendor/hoa/file/ReadWrite.php(231): stream_get_contents(Resource id #76, -1, 0)
#5 /sabre-katana/lib/Server/Installer.php(416): Hoa\File\ReadWrite->readAll()
#6 /sabre-katana/public/install.php(211): Sabre\Katana\Server\Installer::createDatabase(Sabre\Katana\Configuration)
#7 unknown file(unknown line): {closure}('{"baseurl":"/server.php/","email":"[email protected]","password":"admin","database":{"driver":"mysql","host":"127.0.0.1","port":"3306","name":"sabre-katana","username":"root","password":""}}')
#8 unknown file(unknown line): Closure->__invoke('{"baseurl":"/server.php/","email":"[email protected]","password":"admin","database":{"driver":"mysql","host":"127.0.0.1","port":"3306","name":"sabre-katana","username":"root","password":""}}')
#9 /sabre-katana/vendor/hoa/dispatcher/Basic.php(255): ReflectionMethod->invokeArgs(Closure, Array)
#10 /sabre-katana/vendor/hoa/dispatcher/Dispatcher.php(149): Hoa\Dispatcher\Basic->resolve(Array, Hoa\Router\Http\Http, NULL)
#11 /sabre-katana/public/install.php(301): Hoa\Dispatcher\Dispatcher->dispatch(Hoa\Router\Http\Http) |
Looking at data/log/TIMESTAMP.exceptions.log, I have:
so it's consistent at least. I wouldn't be surprised if a template's name was mistyped or something. I'm just discovering the codebase though. |
Guessing from the stack trace, things seem to start going wrong here: Installer.php(416): |
It's time to rip out the |
Seems to happen right for the first file, might be related to the
|
Yea I'd be sympathetic to that. it's quite hard to debug and has been the source of similar issues before, iirc. |
Locally, I have the error but not for addressbooks.mysql.sql. I set a debug on When using sqlite and the browser install, I get:
Then, it fails. Edit: With mysql, it's on:
Dunno if that's relevant. |
Same error, @chikamichi. Just for SQLite instead of MySQL. That it fails on a different file for you when selecting MySQL is just related to which file it tries to load first. |
I'm not sure about my finding, but still, food for thoughts. In hoa's Core/Protocol, within $path = static::realPath($path, 'r' === $mode[0]); This is where the code breaks. Looking at the doc for |
When releasing the constraint on |
Also just realized that the schema files unnecessarily get opened in read-write mode in Installer.php(416), which probably happens here inside hoa/file. When the same code runs via the CLI installer (where unlike when running that code via Apache we actually have a write permission for those schema files), the problem does not occur. We're running an awful lot of code here, just to read a few files from disk. Should indeed simplify this. =) |
Indeed :) I'm still digging around that |
Oh! By the way, I managed to fix the issue simply by changing the file mode for the templates under resource/default/database. It's not perfect, because those templates shouldn't need +w but that's a workaround at least. I guess that is related to the use of hoa's |
So it fails with MySQL but not with SQLite? I am going to patch |
@evert @DominikTo |
Go create a <?php
require 'bootstrap.php';
use Sabre\Katana;
$sqlite = new Katana\Database('sqlite::memory:');
print_r(
iterator_to_array(
$sqlite->getTemplateSchemaIterator()
)
);
$mysql = new Katana\Database('mysql:host=127.0.0.1');
print_r(
iterator_to_array(
$mysql->getTemplateSchemaIterator()
)
); It works for me. Does it work for you? |
Trying with: <?php
require 'bootstrap.php';
use Sabre\Katana;
$sqlite = new Katana\Database('sqlite::memory:');
foreach ($sqlite->getTemplateSchemaIterator() as $file) {
var_dump($file->open()->readAll());
}
$mysql = new Katana\Database('mysql:host=127.0.0.1');
foreach ($mysql->getTemplateSchemaIterator() as $file) {
var_dump($file->open()->readAll());
} If one file has not the read permission, it fails. Is it your usecase? Why |
Two solutions: Either we check that |
No, it fails both for MySQL as well as SQLite, see the comment from @chikamichi above. |
Error message fixed by https://github.com/hoaproject/Core/releases/tag/2.15.07.05. Run
|
If you confirm me that the |
Hum, the way I ran things is I installed sabre-katana in ~/opt/, and used the same user to both install and run the CLI install. It was failing, so I decided to set up an apache vhost in /etc/apache2/ using sudo--but the |
@chikamichi Ok, I get it. Because Apache needs to have appropriated permissions to read files too. On some configurations, Apache is inside an isolated group and has not the correct permissions to even read files. So, as the same way we check the |
Hi,
During install procedure via browser (install.php), after user and db parameters .. when I click install, display this error and does not end the installation
"An error occured: fstat() expects parameter 1 to be resource, boolean given"
Clean machine with LAMP Ubuntu and all dependencies
thanks
AC
The text was updated successfully, but these errors were encountered: