After hours of working finally had NC26 running up on a docker environment (dedicated server)
Its a simple stack with MariDB & Redis, installed under user 1000, behind proxy (NPM).
Proxy, Cron etc etc all works fine with some minor bug which everyone else reported (i.e email set up issue which there is a manual fix, and search bar can’t load more result )
However, i’m still encountering a issue which could not figure how to address
There are 2 error messages refreshed in log everytime i’m opening settings (come as a pair)
- one is a warning:
no app in context – Invalid cliBasedCronUser data provided to provideInitialState by settings
–another is an error
php – Trying to access array offset on value of type bool at /var/www/html/apps/settings/lib/Settings/Admin/Server.php#76
Open the Server.php and line 76 is as below
$this->initialStateService->provideInitialState('cliBasedCronUser', function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : '');
After trying many options, could not solve the issue so come to the forum asking for help.
Thanks a lot in advance.
Regards
2 Likes
Hello, I have exactly the same problem, does anyone know a solution by now?
Thanks
1 Like
I think I have a lead on this bear with me because I haven’t used PHP a lot before, but I threw an exception with the line of the code that was failing to debug it (there’s probs a better way)
just after comment:
//Background jobs
insert this line:
throw new \Exception(posix_getpwuid(fileowner(\OC::$configDir . 'config.php')));
line before
go to:
/var/www/html/apps/settings/lib/Settings/Admin/
then do: cp Server.php ServerBackup.php
(in case you mess anything up).
when I bash into my container it warns me that i dont have a name:
I have no name!@, so you either need to setup a name for the account in my case I was using user 1001, but my solution (not fully tested whether this works was to remove the [‘name’] dictonary indexer to look like the following:
$this->initialStateService->provideInitialState('cliBasedCronUser', function_exists('posix_getpwuid') ? fileowner(\OC::$configDir . 'config.php') : '');
then it shows running as system user “1001”
https://yournextcloud/settings/admin
cronjobs were failing prior to me changing to this, so it seems to have worked for me. I can now use recognize app without it waiting forever and doing nothing.
I have the same issue and do not know what’s causing it.
Trying to access array offset on value of type bool at /var/www/html/apps/settings/lib/Settings/Admin/Server.php#76
From what I understand, it is trying to find the user that’s the owner of the config.php file, but it’s unable to, or it’s running into an issue.
What I did was to add www-data
as the default user in the ternary operator instead of empty, and that appears to work for me, but that’s not a solution since it would overwritten by an update.
$this->initialStateService->provideInitialState('cliBasedCronUser', function_exists('posix_getpwuid') ? posix_getpwuid(fileowner(\OC::$configDir . 'config.php'))['name'] : 'www-data');