Nextcloud Login Problem (Internal Server Error) after Upgrade

**NethServer Version: 7.9.2009
**Module: Nextcloud 20.0.2.2

After upgrading Nextcloud with the Nethserver Upgrade i got the following error while logging in with the Browser:

    Interner Serverfehler

Der Server konnte die Anfrage nicht fertig stellen.

Sollte dies erneut auftreten, sende bitte die nachfolgenden technischen Einzelheiten an Deinen Server-Administrator.

Weitere Details können im Server-Protokoll gefunden werden.

   Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please includethe technical details below in your report.
More details can be found in the server log

I Tried the solutuions from https://community.nethserver.org/t/problem-nextcloud-after-update-7-7-1908/15304 but getting serveral errors:

$ sudo -u apache scl enable rh-php72 – php -dmemory_limit=512M /usr/share/nextcloud/occ maintenance:mode
Unable to open /etc/scl/conf/–!

$ /usr/share/nextcloud/occ maintenance:mode
PHP Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{’ or ‘$’ in /usr/share/nextcloud/console.php on line 97`

Sorry about the formatting, i don’t use this Forum often…

`

Can you share the outcome of these commands?

grep "'version'" /usr/share/nextcloud/config/config.php
sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ upgrade

‘version’ => ‘20.0.2.2’,

sudo -u apache scl enable rh-php73 – php -dmemory_limit=512M /usr/share/nextcloud/occ upgrade

Nextcloud is already latest version

That’s OK.
What about httpd (from the message above I guess it is running) and rh-php73 services?

systemctl status -l httpd rh-php73-php-fpm

Maybe it is caused by a nextcloud app. Nextcloud log could provide more info. To list nextcloud apps you can use:

sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ app:list

Recently @greavette reported a problem with the Accessibility app.

● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/httpd.service.d
└─free_mutex.conf, quick_kill.conf
Active: active (running) since Sat 2020-12-05 18:29:42 CET; 17h ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 29550 (httpd)
Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”
CGroup: /system.slice/httpd.service
├─ 1838 /usr/sbin/httpd -DFOREGROUND
├─ 8857 /usr/sbin/httpd -DFOREGROUND
├─11167 /usr/sbin/httpd -DFOREGROUND
├─13933 /usr/sbin/httpd -DFOREGROUND
├─16581 /usr/sbin/httpd -DFOREGROUND
├─16587 /usr/sbin/httpd -DFOREGROUND
├─17446 /usr/sbin/httpd -DFOREGROUND
├─17447 /usr/sbin/httpd -DFOREGROUND
├─18853 /usr/sbin/httpd -DFOREGROUND
├─20891 /usr/sbin/httpd -DFOREGROUND
└─29550 /usr/sbin/httpd -DFOREGROUND

Dec 05 18:29:41 nethserver.nethserver.neu systemd[1]: Starting The Apache HTTP Server…
Dec 05 18:29:42 nethserver.nethserver.neu systemd[1]: Started The Apache HTTP Server.
Dec 06 09:07:36 nethserver.nethserver.neu systemd[1]: Reloading The Apache HTTP Server.
Dec 06 09:07:37 nethserver.nethserver.neu systemd[1]: Reloaded The Apache HTTP Server.

● rh-php73-php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/rh-php73-php-fpm.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/rh-php73-php-fpm.service.d
└─nethserver-rh-php73-php-fpm.conf
Active: active (running) since Sat 2020-12-05 18:29:43 CET; 17h ago
Main PID: 29588 (php-fpm)
Status: “Processes active: 0, idle: 15, Requests: 4194, slow: 0, Traffic: 0req/sec”
CGroup: /system.slice/rh-php73-php-fpm.service
├─ 3640 php-fpm: pool nethserver-nextcloud
├─ 5912 php-fpm: pool nethserver-nextcloud
├─14037 php-fpm: pool nethserver-nextcloud
├─29588 php-fpm: master process (/etc/opt/rh/rh-php73/php-fpm.conf
├─29589 php-fpm: pool nethserver-nextcloud
├─29590 php-fpm: pool nethserver-nextcloud
├─29591 php-fpm: pool nethserver-nextcloud
├─29592 php-fpm: pool nethserver-nextcloud
├─29593 php-fpm: pool nethserver-nextcloud
├─29594 php-fpm: pool www
├─29595 php-fpm: pool www
├─29596 php-fpm: pool www
├─29597 php-fpm: pool www
├─29598 php-fpm: pool www
├─30802 php-fpm: pool nethserver-nextcloud
└─32060 php-fpm: pool nethserver-nextcloud

Dec 05 18:29:42 nethserver.nethserver.neu systemd[1]: Starting The PHP FastCGI Process Manager…
Dec 05 18:29:43 nethserver.nethserver.neu systemd[1]: Started The PHP FastCGI Process Manager.

sudo -u apache scl enable rh-php73 – php -dmemory_limit=512M /usr/share/nextcloud/occ app:list
Enabled:

  • accessibility: 1.6.0
  • activity: 2.13.3
  • admin_audit: 1.10.0
  • bruteforcesettings: 2.0.1
  • calendar: 2.0.4
  • carnet: 0.23.7
  • cloud_federation_api: 1.3.0
  • comments: 1.10.0
  • contacts: 3.4.2
  • contactsinteraction: 1.1.0
  • dashboard: 7.0.0
  • dav: 1.16.1
  • encryption: 2.8.1
  • federatedfilesharing: 1.10.1
  • federation: 1.10.1
  • files: 1.15.0
  • files_external: 1.11.1
  • files_pdfviewer: 2.0.1
  • files_rightclick: 0.17.0
  • files_sharing: 1.12.0
  • files_trashbin: 1.10.1
  • files_versions: 1.13.0
  • files_videoplayer: 1.9.0
  • firstrunwizard: 2.9.0
  • logreader: 2.5.0
  • lookup_server_connector: 1.8.0
  • news: 15.0.6
  • nextcloud_announcements: 1.9.0
  • notes: 4.0.1
  • notifications: 2.8.0
  • oauth2: 1.8.0
  • onlyoffice: 6.1.0
  • password_policy: 1.10.1
  • photos: 1.2.0
  • privacy: 1.4.0
  • provisioning_api: 1.10.0
  • recommendations: 0.8.0
  • serverinfo: 1.10.0
  • settings: 1.2.0
  • sharebymail: 1.10.0
  • support: 1.3.0
  • survey_client: 1.8.0
  • systemtags: 1.10.0
  • tasks: 0.13.6
  • text: 3.1.0
  • theming: 1.11.0
  • twofactor_backupcodes: 1.9.0
  • twofactor_totp: 5.0.0
  • updatenotification: 1.10.0
  • user_ldap: 1.10.2
  • user_status: 1.0.1
  • viewer: 1.4.0
  • weather_status: 1.0.0
  • workflowengine: 2.2.0
    Disabled:
  • cookbook
  • spreed

Service status looks good.
Any hint from /var/lib/nethserver/nextcloud/nextcloud.log ? (you can view it from command line or from Cockpit’s nextcloud application Logs section)

A blind shot:

sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ app:disable theming
sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ app:disable carnet

The Problem is that i can’t log in… :wink:

Theming had been disable after upgrade, disabling carnet don’t change anything.

/var/lib/nethserver/nextcloud/nextcloud.log

“file”:“/usr/share/nextcloud/apps/encryption/lib/Users/Setup.php”,“line”:76,“function”:“userHasKeys”,“class”:“OCA\Encryption\KeyManager”,“type”:“->”,“args”:[“*** sensitive parameter replaced “]},{“file”:”/usr/share/nextcloud/apps/encryption/lib/Hooks/UserHooks.php",“line”:180,“function”:“setupUser”,“class”:“OCA\Encryption\Users\Setup”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/usr/share/nextcloud/lib/private/legacy/OC_Hook.php",“line”:110,“function”:“login”,“class”:“OCA\Encryption\Hooks\UserHooks”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/usr/share/nextcloud/lib/private/Server.php",“line”:568,“function”:“emit”,“class”:“OC_Hook”,“type”:“::”,“args”:[“OC_User”,“post_login”," sensitive parameter replaced “]},{“function”:“OC\{closure}”,“class”:“OC\Server”,“type”:”->“,“args”:[” sensitive parameters replaced “]},{“file”:”/usr/share/nextcloud/lib/private/Hooks/EmitterTrait.php",“line”:101,“function”:“call_user_func_array”,“args”:[{“class”:“Closure”},[" sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “]]},{“file”:”/usr/share/nextcloud/lib/private/Hooks/PublicEmitter.php",“line”:40,“function”:“emit”,“class”:“OC\Hooks\BasicEmitter”,“type”:“->”,“args”:[“\OC\User”,“postLogin”,[" sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “]]},{“file”:”/usr/share/nextcloud/lib/private/User/Session.php",“line”:412,“function”:“emit”,“class”:“OC\Hooks\PublicEmitter”,“type”:“->”,“args”:[“\OC\User”,“postLogin”,[" sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “,” sensitive parameter replaced “]]},{“file”:”/usr/share/nextcloud/lib/private/Authentication/Login/CompleteLoginCommand.php",“line”:44,“function”:“completeLogin”,“class”:“OC\User\Session”,“type”:“->”,“args”:[" sensitive parameters replaced “]},{“file”:”/usr/share/nextcloud/lib/private/Authentication/Login/ALoginCommand.php",“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\CompleteLoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/LoggedInCheckCommand.php”,“line”:61,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\LoggedInCheckCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/EmailLoginCommand.php”,“line”:58,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\EmailLoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/UidLoginCommand.php”,“line”:54,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\UidLoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/UserDisabledCheckCommand.php”,“line”:57,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\UserDisabledCheckCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/PreLoginHookCommand.php”,“line”:53,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/Authentication/Login/Chain.php”,“line”:108,“function”:“process”,“class”:“OC\Authentication\Login\PreLoginHookCommand”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/core/Controller/LoginController.php”,“line”:307,“function”:“process”,“class”:“OC\Authentication\Login\Chain”,“type”:“->”,“args”:[{“class”:“OC\Authentication\Login\LoginData”}]},{“file”:“/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:169,“function”:“tryLogin”,“class”:“OC\Core\Controller\LoginController”,“type”:“->”,“args”:[" sensitive parameters replaced ***”]},{“file”:“/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php”,“line”:100,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OC\Core\Controller\LoginController”},“tryLogin”]},{“file”:“/usr/share/nextcloud/lib/private/AppFramework/App.php”,“line”:152,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”,“args”:[{“class”:“OC\Core\Controller\LoginController”},“tryLogin”]},{“file”:“/usr/share/nextcloud/lib/private/Route/Router.php”,“line”:308,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”,“args”:[“OC\Core\Controller\LoginController”,“tryLogin”,{“class”:“OC\AppFramework\DependencyInjection\DIContainer”},{“action”:null,“_route”:“core.login.tryLogin”}]},{“file”:“/usr/share/nextcloud/lib/base.php”,“line”:1008,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”,“args”:[“/login”]},{“file”:“/usr/share/nextcloud/index.php”,“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:“::”,“args”:}],“File”:“/usr/share/nextcloud/lib/private/Security/Crypto.php”,“Line”:122},“CustomMessage”:“–”},“userAgent”:“Mozilla/5.0 (X11; Linux x86_64; rv:83.0) Gecko/20100101 Firefox/83.0”,“version”:“20.0.2.2”}$

I was referring to Cockpit server-manger from NethServer, which I suppose you can login (but command line is even better).
Another blind shot: can you try disabling onlyoffice and dashboard apps?

Didn’t got any clue from the log. Can you try to login to nextcloud again and search for any error/warn/fail/miss (or similar) that took place within that timeframe. Target nextcloud.log, /var/log/messages and logs under /var/log/httpd/
Example:

grep -Ei "(error|warn|fail|miss)" /var/log/httpd/* /var/log/messages /var/lib/nethserver/nextcloud/nextcloud.log |grep "Dec .6"

Also looking for .htaccess* (an .user.ini*) files:

ls -l /usr/share/nextcloud/.{ht,user}*

Can you share its contents?

EDIT:
Have you tried to login from another browser or from private/incognito mode?
Error message is shown in a blank page (apache server error) or with nextcloud theme?

-rw-r–r-- 1 apache apache 3032 Nov 18 20:46 /usr/share/nextcloud/.htaccess
-rw-r–r-- 1 apache apache 101 Nov 18 20:46 /usr/share/nextcloud/.user.ini

I tryed it with grep, there are no errors or warnings

With nextcloud theme, first with the defaul nextxcloud theme, after enabling Theming with my own Theme

FF with private mode and Chromium don’t work. The Problem is not only the Login, webdav and caldv also don’t work. Only Notes semms to be able to sync.

That’s unfortunate and harder to diagnose.

You cannot login to Nextcloud with any user (neither local nextcloud admin user nor an AD/LDAP user), right?

I think the problem lies in Nextcloud not apache server, but anyway doesn’t hurt to check contents of .htaccess file:

cat /usr/share/nextcloud/.htaccess

Without clues from logs, other things that can be tried:

  • Test AD/LDAP config:
sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ ldap:test-config s01
  • Login as nextcloud admin after temporarily disabling user_ldap app.

I’ve seen this just now, there are no messages with nextcloud context

The configuration is valid and the connection could be established!

Admin login works, also with enabled user_ldap app.

I’ve created a new user, with this account i’m able to login :thinking:

I have disabled all apps differing between existing user an new user, no success

With …/occ watch:log i see some errors:

Error index OC\ServerNotAvailableException: Could not decrypt key at lib/private/Encryption/Keys/Storage.php line 287 2020-12-07T11:25:38+00:00

                          Caused by Exception: Authenticated ciphertext could not be decoded. at lib/private/Security/Crypto.php line 122                                                              

Fatal webdav Sabre\DAV\Exception\ServiceUnavailable: OC\ServerNotAvailableException: Could not decrypt key at apps/dav/lib/Connector/Sabre/Auth.php line 163

This sounds like it could be related to my issue:

I think probably not.
…occ encryption:disable-master-key
Master key already disabled

I wanted to try a change of the user-password, but logged in as admin i see

Das Ändern des Passwortes ist deaktiviert, da der Master-Schlüssel deaktiviert ist
Changing password is disabled, because the Master-Key is disabled

The try with occ user:resetpassword failed:

sudo -u apache scl enable rh-php73 -- php -dmemory_limit=512M /usr/share/nextcloud/occ user:resetpassword <user>
Warning: Resetting the password when using encryption will result in data loss!
Do you want to continue?y
Enter a new password: 
Confirm the new password: 
Can not decrypt the recovery key. Maybe you provided the wrong password. Try again.

Why could a new password be wrong?

At the end the solution was very easy. The missing master key showed me the way, I only had to disable the encryption app. I suppose the upgrade enabled it.

3 Likes