Open jficz opened 1 year ago
Related issue: If the filesystem that the configuration files are loaded from (e.g., SMB mount inside a Docker container) doesn't support file locking, the config won't load at all, and we get this error instead:
Fatal error: Uncaught Error: Call to a member function getLogger() on null in /var/www/html/cron.php:189
Stack trace:
#0 {main}
thrown in /var/www/html/cron.php on line 189
Which is caused by:
Could not acquire a shared lock on the config file /var/www/html/config/apcu.config.php:216
Perhaps there's some way that config file locking can be disabled at admin discretion, especially on a read-only file system?
There is the config_is_read_only
option (https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#config-is-read-only). It may help with some, but not all of these situations since it's still expected to be togged to false again during various operations where write access is expected.
⚠️ This issue respects the following points: ⚠️
Bug description
One of the first things that happens during start is loading and locking config file(s) with
flock()
. If, for whatever reason, the locking mechanism at the OS level blocks indefinitely, there is no way for the user to have any idea what's actually going on without resorting to advanced debugging.This is true for both normal operation (via fpm, mod, etc.) and for
occ
which makes the issue even more frustrating.The call to the function happens before any kind of reasonable logs are displayed.
In my case
config.php
is located on a NFS filesystem. The reasons for the unability to acquire the lock are as of yet unknown.Steps to reproduce
config.php
cannot be locked via the portableflock()
function in a way that the function blocks indefinitely (or longer than upstream timeouts) 2a. open Nextcloud instance in a browser OR 2b. runphp occ
Expected behavior
Some kind of unconditional trace or "step-by-step" log should be configurable to be shown even before the config is read, describing the steps taken so far. ex:
at least in
occ
.Installation method
Other Community project
Operating system
Other
PHP engine version
PHP 8.0
Web server
Nginx
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
No response
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response