Internal server error nach backup

Hi Leute,

leider hat meine Nextcloud einen internal server error. Und ich weiß um ehrlich zu sein nicht so ganz weiter. Ich wollte gestern ein Backup wieder aufspielen ĂŒber das NextcloudPi Config Panel nur danach hat er meine user daten nicht mehr erkannt, sodass ich mich nicht mehr einloggen konnte. Das Backup bringt mir auch gewisse Fehlermeldungen. Die reiche ich gleich nach.

Fehlermeldung:

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 include the technical details below in your report.
More details can be found in the server log.

Was im error.log steht:

[Thu Mar 26 11:36:43.687668 2020] [ssl:warn] [pid 8013:tid 3069219344] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 26 11:36:43.939609 2020] [ssl:warn] [pid 8174:tid 3069219344] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Thu Mar 26 11:36:43.945428 2020] [mpm_event:notice] [pid 8174:tid 3069219344] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1d configured – resuming normal operations
[Thu Mar 26 11:36:43.945540 2020] [core:notice] [pid 8174:tid 3069219344] AH00094: Command line: ‘/usr/sbin/apache2’
[Thu Mar 26 10:50:20.623859 2020] [proxy:error] [pid 1849:tid 2773500960] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.3-fpm.sock (*) failed
[Thu Mar 26 10:50:20.623981 2020] [proxy_fcgi:error] [pid 1849:tid 2773500960] [client 192.168.178.187:52406] AH01079: failed to make connection to backend: httpd-UDS

Dann habe ich noch diese nextcloud-log Datei:

[Thu Mar 26 06:40:35.968805 2020] [core:crit] [pid 1849:tid 2593076256] (13)Permission denied: [client 46.89.167.233:46303] AH00529: /var/www/nextcloud/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/var/www/nextcloud/’ is executable
[Thu Mar 26 06:45:50.350314 2020] [proxy_fcgi:error] [pid 1849:tid 2569008160] [client 46.89.167.233:43973] AH01071: Got error ‘PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“touch(): Utime failed: Permission denied at /var/www/nextcloud/lib/private/Config.php#241”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“fopen(/var/www/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/nextcloud/lib/private/Config.php#242”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“chmod(): Operation not permitted at /var/www/nextcloud/lib/private/Config.php#245”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log at /var/www/nextcloud/lib/private/Log/File.php#83”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“index”,“method”:“GET”,“url”:“/index.php/204”,“message”:{“Exception”:“OC\\HintException”,“Message”:“Can’t write into config directory!”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/lib/private/Config.php”,“line”:133,“function”:“writeData”,“class”:“OC\\Config”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/SystemConfig.php”,“line”:112,“function”:“setValue”,“class”:“OC\\Config”,“type”:“->”,“args”:[“instanceid”,“ockmj2svfkm2”]},{“file”:“/var/www/nextcloud/lib/private/legacy/util.php”,“line”:1153,“function”:“setValue”,“class”:“OC\\SystemConfig”,“type”:“->”,“args”:[“instanceid”,“ockmj2svfkm2”]},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:420,“function”:“getInstanceId”,“class”:“OC_Util”,“type”:“::”,“args”:},{“file”:“/var/www/nextcloud/lib/base.php”,“line”:647,“function”:“initSession”,“class”:“OC”,“type”:“::”,“args”:},{“file”:“/var/www/n
PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:”–“,“app”:“PHP”,“method”:“GET”,“url”:”/index.php/204",“message”:“fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log at /var/www/nextcloud/lib/private/Log/File.php#83”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“index”,“method”:“GET”,“url”:“/index.php/204”,“message”:{“Exception”:“Doctrine\\DBAL\\DBALException”,“Message”:“Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file”,“Code”:0,“Trace”:[{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php”,“line”:1040,“function”:“connect”,“class”:“OC\\DB\\Connection”,“type”:“->”,“args”:},{“file”:“/var/www/nextcloud/lib/private/DB/Connection.php”,“line”:220,“function”:“executeUpdate”,“class”:“Doctrine\\DBAL\\Connection”,“type”:“->”,“args”:[“PRAGMA read_uncommitted = 1”,,]},{“file”:“/var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php”,“line”:683,“function”:“executeUpdate”,“class”:“OC\\DB\\Connection”,“type”:“->”,“args”:[“PRAGMA read_uncommitted = 1”]},{“file”:"/var/www/nextcloud/lib/private/DB/Connection
’
[Thu Mar 26 06:45:50.351098 2020] [proxy_fcgi:error] [pid 1849:tid 2569008160] [client 46.89.167.233:43973] AH01071: Got error ‘PHP message: PHP Warning: fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log in /var/www/nextcloud/lib/private/Log/File.php on line 83PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“fileperms(): stat failed for /var/www/nextcloud/data/nextcloud.log at /var/www/nextcloud/lib/private/Log/File.php#83”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}PHP message: {“reqId”:“XnxBjmHFoJdVjXqrSMPP6QAAABM”,“level”:3,“time”:“2020-03-26T05:45:50+00:00”,“remoteAddr”:“46.89.167.233”,“user”:“–”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/204”,“message”:“chmod(): No such file or directory at /var/www/nextcloud/lib/private/Log/File.php#84”,“userAgent”:“Mozilla/5.0 (Android) Nextcloud-android/3.10.1”,“version”:“”}’

der meckert ĂŒber einen falschen hostnamen im zertifikat


Bedeutet, ich muss ein neues ssl zertifikat ausstellen?

Erst mal nicht. Wahrscheinlich reicht es das Zertifikat zu akzeptieren. Aber hast du den Host geĂ€ndert? Was kann der Grund dafĂŒr sein?

Er meckert auch ĂŒber .htaccess (aber 5 Stunden frĂŒher) . Schau mal ob alles unterhalb von /var/www/nextcloud inkl. /var/www/nextcloud/.htaccess deinem Webserver-Benutzer (www-data?) gehört.

ja gehört alles www-data. erst hat ja gestern auch alles wieder funktioniert bis auf den login. daraufhin wollte ich das letzte backup wieder aufspielen. nachdem ich das backup wieder einspielen wollte ging gar nichts mehr. im browser steht dann nur noch die oben genannte meldung.

Hier noch was das Backup fĂŒr Meldungen bringt:

Running nc-restore
check free space...
extracting backup file /media/backups/nextcloud-bkp_20200322_1584842403.tar...
restore files...
restore database...
no datadir found in backup
Maintenance mode disabled
Starting scan for user 1 out of 5 (appletv)
Home storage for user appletv not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 2 out of 5 (joshua)
Home storage for user joshua not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 3 out of 5 (kay)
Home storage for user kay not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 4 out of 5 (laura)
Home storage for user laura not writable
Make sure you're running the scan command only as the user the web server runs as
Starting scan for user 5 out of 5 (philipp)
Home storage for user philipp not writable
Make sure you're running the scan command only as the user the web server runs as
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0       | 0     | 00:00:00     |
+---------+-------+--------------+
Warning: The unit file, source configuration file or drop-ins of fail2ban.service changed on disk. Run 'systemctl daemon-reload' to reload units.
System config value trusted_domains => 11 set to string 2a02:810**** 
System config value trusted_domains => 1 set to string 192.168.178.66

Scanning AppData for files
Path not found: /appdata_oclaqn5ofjmm

+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 0       | 0     | 00:00:00     |
+---------+-------+--------------+
Cleanup...
Done. Press any key...

maintenance mode ist eingeschaltet.

Achso und nein nichts dergleichen habe ich geĂ€ndert lediglich das Backup aufspielen wollen. Hab aber auch schon mal ĂŒber ncp-config das fix-permissions setup drĂŒberlaufen lassen.

Was passiert denn, wenn ich im Config panel eine Reinitialisierung mache und danach das backup versuche wieder einzuspielen?

Ich hab jetzt nochmal ĂŒber die shell ein ssl renewal angefordert. Da bringt er auch eine Fehlermeldung dass ihm Dateien fehlen. Anscheinend scheint das config panel nicht wirklich zu funktionieren momentan.

Running letsencrypt
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Renewing an existing certificate
Running deploy-hook command: /etc/letsencrypt/renewal-hooks/deploy/ncp
Output from ncp:
An unhandled exception has been thrown:
TypeError: Argument 1 passed to OC\Security\Crypto::decrypt() must be of the type string, bool given, called in /var/www/nextcloud/lib/private/Security/IdentityProof/Manager.php on line 128 and defined in /var/www/nextcloud/lib/private/Security/Crypto.php:114
Stack trace:
#0 /var/www/nextcloud/lib/private/Security/IdentityProof/Manager.php(128): OC\Security\Crypto->decrypt(false)
#1 /var/www/nextcloud/lib/private/Security/IdentityProof/Manager.php(146): OC\Security\IdentityProof\Manager->retrieveKey('user-philippmie...')
#2 /var/www/nextcloud/apps/notifications/lib/Push.php(92): OC\Security\IdentityProof\Manager->getKey(Object(OC\User\User))
#3 /var/www/nextcloud/apps/notifications/lib/App.php(50): OCA\Notifications\Push->pushToDevice(107, Object(OC\Notification\Notification))
#4 /var/www/nextcloud/lib/private/Notification/Manager.php(217): OCA\Notifications\App->notify(Object(OC\Notification\Notification))
#5 /var/www/nextcloud/apps/notifications/lib/Command/Generate.php(127): OC\Notification\Manager->notify(Object(OC\Notification\Notification))
#6 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(255): OCA\Notifications\Command\Generate->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/nextcloud/3rdparty/symfony/console/Application.php(915): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/nextcloud/3rdparty/symfony/console/Application.php(272): Symfony\Component\Console\Application->doRunCommand(Object(OCA\Notifications\Command\Generate), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/nextcloud/3rdparty/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/nextcloud/lib/private/Console/Application.php(214): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/nextcloud/console.php(99): OC\Console\Application->run()
#12 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#13 {main}
Error output from ncp:
stat: der Aufruf von stat fĂŒr '/media/data/nextcloud/appdata_oclaqn5ofjmm/identityproof/user-philippmielke/private' ist nicht möglich: Datei oder Verzeichnis nicht gefunden

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/philsnextcloud.ddns.net/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/philsnextcloud.ddns.net/privkey.pem
   Your cert will expire on 2020-06-24. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot
   again. To non-interactively renew *all* of your certificates, run
   "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

System config value trusted_domains => 12 set to string philsnextcloud.ddns.net
System config value overwrite.cli.url set to string https://philsnextcloud.ddns.net/
Done. Press any key...

könnte eventuell auch das Problem daran liegen, dass das Backup noch von Version 17.0.4 ist aber 18.0.3 installiert ist derzeit?

könnte sein

allerdings hatte ich das auch mal
 und da hat er mir die gebackupte nc-version aktiviert. also aus einer höherwertigen gedowngraded.

in der ersten meldung bricht offenbar das occ files:scan --all ab.

Welche Meldung meinst du jetzt? die vom Backup oder vom ssl zertifikat?

diese meldung
 da kannst du das scannen nachholen. ich befĂŒrchte aber, dass die directories leer sind. schau doch mal selbst nach
 hoffentlich sind daten drin
 und sie stehen haben nur keine leserechte fĂŒr www-data

Ich habe deine Nextcloud gerade aufgerufen. SSL ist in Ordnung. Lets Encrypt ist kein Problem. Das Problem liegt bei deiner Nextcloud. Ein Backup eines alten Releases einzuspielen ist vielleicht keine gute Idee :wink:

könntest du vllt kurz erklÀren wie ich die scannen kann/soll? wenn ich das backup entpacke ist dort der gesamte nextcloud ordner 1:1 mit den originalen lese-schreib-rechten wie im originalen falls du das meinst.

Hinterher ist man immer schlauer. :sweat_smile: Ich hatte aber angenommen, dass er dann einfach ein altes Release wieder aufspielt denn wozu werden denn sonst backups gemacht?

Könnte ein Downgrade auf 17.0.4 und im Anschluss das Backup wieder einspielen helfen?

Lese:
https://docs.nextcloud.com/server/18/admin_manual/maintenance/restore.html

offiziell werden downgrades nicht unterstĂŒtzt. in deinem fall hieße das dann: neu aufsetzen und backup einspielen. (ggf mit ner zweiten sd-karte)

Die Frage ist ja auch eigentlich wie viele Konfigurationen man geĂ€ndert hat, Benutzer angelegt und Freigaben man erteilt hat. Sollte sich das im Rahmen halten kann man natĂŒrlich mit der neusten Version wieder aufsetzen, Konfigurationen vornehmen, Benutzer einrichten, die Dateien zurĂŒckkopieren oder neu mounten, neu scannen lassen und Freigaben neu erteilen. Vielleicht geht das schneller. Und vor allen: Backup der Daten und der Datenbank regelmĂ€ĂŸig anfertigen und das Backup regelmĂ€ĂŸig testen. :wink:

das betrifft ja nur die zeit zwischen dem letzten backup und heute


SUPERWICHTIG! IMMER!

Ihr habt mir ja jetzt jede Menge Input nochmal gegeben mit dem ich mich heute/morgen beschĂ€ftigen werde. GemĂ€ĂŸ dem Fall ich bekomm sie nicht wieder zum Laufen, wie sollte ich denn am Besten meine Daten sichern und wieder zurĂŒckspielen?

Und wie macht man denn ein Backup der Datenbank?