Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NC14] Error while checking server setup #11088

Closed
hoellen opened this issue Sep 6, 2018 · 5 comments
Closed

[NC14] Error while checking server setup #11088

hoellen opened this issue Sep 6, 2018 · 5 comments
Labels

Comments

@hoellen
Copy link
Contributor

hoellen commented Sep 6, 2018

Steps to reproduce

  1. Login as Admin
  2. Go to Settings -> Administration -> Overview

Expected behaviour

Checking server setup should pass.

Actual behaviour

Get error under "Security & setup warning"

grafik

Server configuration

Operating system: CentsOS 7.5

Web server: nginx 1.15.3

Database: mariadb 10.3.9

PHP version: 7.2.9

Nextcloud version: 14.0.0

Updated from an older Nextcloud/ownCloud or fresh install: yes

Where did you install Nextcloud from: docker image

Signing status:
The error is about the server setup checking.

Are you using encryption: No

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Firefox 62.0

Operating system: ArchLinux

Logs

Web server error log

nothing here

Nextcloud log (data/nextcloud.log)

Nextcloud log
{"reqId":"qruZgYucXWF7sk27q0O9","level":3,"time":"2018-09-06T12:57:27+02:00","remoteAddr":"xx.xx.xx.x","user":"admin_user","app":"index","method":"GET","url":"\/settings\/ajax\/checksetup","message":"Exception":"TypeError","Message":"Argument 1 passed to OC\\Settings\Controller\\CheckSetupController::getAppDirsWithDifferentOwnerForAppRoot() must be of the type array, boolean given, called in \/nextcloud\/settings\/Controller\/CheckSetupController.php on line 551","Code":0,"Trace":[{"file":"\/nextcloud\/settings\/Controller\/CheckSetupController.php","line":551,"function":"getAppDirsWithDifferentOwnerForAppRoot","class":"OC\\Settings\\Controller\\CheckSetupController","type":"->","args":[false,{"path":"\/apps2","url":"\/apps2","writable":true}]},{"file":"\/nextcloud\/settings\/Controller\/CheckSetupController.php","line":624,"function":"getAppDirsWithDifferentOwner","class":"OC\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":166,"function":"check","class":"OC\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"\/nextcloud\/lib\/private\/AppFramework\/Http\/Dispatcher.php","line":99,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"\/nextcloud\/lib\/private\/AppFramework\/App.php","line":118,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OC\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"\/nextcloud\/lib\/private\/AppFramework\/Routing\/RouteActionHandler.php","line":47,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OC\\Settings\\Controller\\CheckSetupController","check",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.CheckSetup.check"}]},{"function":"__invoke","class":"OC\\AppFramework\\Routing\\RouteActionHandler","type":"->","args":{"_route":"settings.CheckSetup.check"}]},{"file":"\/nextcloud\/lib\/private\/Route\/Router.php","line":297,"function":"call_user_func","args":[{"__class__":"OC\\AppFramework\\Routing\\RouteActionHandler"},{"_route":"settings.CheckSetup.check"}]},{"file":"\/nextcloud\/lib\/base.php","line":989,"function":"match","class":"OC\\Route\\Router","type":"->","args":["\/settings\/ajax\/checksetup"]},{"file":"\/nextcloud\/index.php","line":42,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"\/nextcloud\/settings\/Controller\/CheckSetupController.php","Line":568,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:62.0) Gecko\/20100101 Firefox\/62.0","version":"14.0.0.19"}

Browser log

nothing

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #3734 (No calendar export possible, internal server error), #6994 (Internal Server Error), #10140 (Internal server error), #9004 (Permissions error), and #3517 (Server Error; Unable to access through nginx).

@hoellen
Copy link
Contributor Author

hoellen commented Sep 6, 2018

I just found out that in file settings/Controller/CheckSetupController.php #L546 the variable $currentUser is false in my setup.
It could be related to this comment where posix_getpwuid() returns false if /etc/passwd is not readable (because of GrSec, SeLinux,...) for the php user.

And because of that the function call in #L551 fails. The function expects an array instead of an boolean.

@kesselb
Copy link
Contributor

kesselb commented Sep 6, 2018

Thank you for reporting this issue 👍

When you replace $currentUser = posix_getpwuid(posix_getuid()); with $currentUser = posix_getuid(); and

$appDirUser = posix_getpwuid(fileowner($absAppPath));
$appDirUser = fileowner($absAppPath); does it work then?

@hoellen
Copy link
Contributor Author

hoellen commented Sep 6, 2018

If I replace additionaly the following line

private function getAppDirsWithDifferentOwnerForAppRoot(array $currentUser, array $appRoot): array {

to

private function getAppDirsWithDifferentOwnerForAppRoot(int $currentUser, array $appRoot): array {

it works again. Thanks!

@bjoern86
Copy link

bjoern86 commented Dec 22, 2018

i have the same error on 14.0.4 and 15.0.0. i am running php-fpm without posix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants