Nextcloud antwortet mit Interner Serverfehler

Hallo,

ich verzweifle so langsam an NextCloud.
Alle paar Wochen funktioniert der Zugriff nicht mehr. Und ich hab keine Ahnung was ich dagegen tun soll :frowning:
Bin schon am überlegen ob ich das Thema Cloud komplett ad acta lege.
Es ist immer wieder nur die NextCloud, die nicht funktioniert…

Aktuell bekomme ich beim Aufruf diese Meldung:

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.
Technische Details
Entfernte Adresse: 127.0.0.1
Anfragekennung: JsjcbNcj3tdkxhNUfemY

Unter /var/log/http/error.log gibt es jede Menge Output. Hab das mal komplett gelöscht, und http, sowie php-fpm neu gestartet.

[Fri Apr 30 14:33:45.857536 2021] [proxy_fcgi:error] [pid 8653:tid 139690062116416] [client ::1:48312] AH01071: Got error 'PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"touch(): Utime failed: Permission denied at /srv/http/nextcloud/lib/private/Config.php#247","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":247,"function":"touch"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Ut...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/config/config.php): Failed to open stream: Permission denied at /srv/http/nextcloud/lib/private/Config.php#248","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":248,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.ph...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"chmod(): Operation not permitted at /srv/http/nextcloud/lib/private/Config.php#251","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":251,"function":"chmod"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Util","typ...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Log/File.php","line":85,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":371,"function":"write","class":"OC\\\\Log\\\\File","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":330,"function":"writeLog","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/status.php","line":66,"function":"logException","class":"OC\\\\Log","type":"->"}],"File":"/srv/http/nextcloud/lib/private/Log/ErrorHandler.php","Line":92...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"remote","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/srv/http/nextcloud/lib/base.php","line":639,"function":"initSession","class":"OC","type":"::"},{"file":"/srv/http/nextcloud/lib/base.php","line":1076,"function":"ini...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Log/File.php","line":85,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":371,"function":"write","class":"OC\\\\Log\\\\File","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":220,"function":"writeLog","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":131,"function":"log","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log/ErrorHandler.php","line":7...PHP message: {"reqId":"4cw0xJ1KHzquXbKpBm20","level":3,"time":"2021-04-30T12:33:45+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","userAgent":"Mozilla/5.0 (Linux) mirall/3.2.0git (Nextcloud, manjaro-5.10.32-1-MANJARO ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":""}'

Welche der verschiedenen Fehler in diesem kurzen Abschnitt relevant sind, kann ich da nicht herauslesen :frowning:
So ergibt z.B. folgendes für mich gar keinen Sinn, weil laut config.php das Log-File unter /var/log/nextcloud liegen sollte …

fopen(/srv/http/nextcloud/data/nextcloud.log

Kann da jemand Licht ins Dunkel bringen?

Hallo,

Ärger mit der Cloud ist nicht schön.

Du musst uns aber ein paar mehr Infos liefern.
Unter Support ist eine schöne Vorlage.

OS? Webserver type? NC version? …

Hallo,

System ist Manjaro LxQt 64 bit. so wie im Log auch zu sehen. Kernel ist 5.10.32-1-MANJARO.
Installiert ist aktuell das Nextcloud Arch-Linux Paket 21.0.1-2. Der Fehler trat aber auch schon in der vorhergehenden Version auf.

Als Webserver dient ein Apache 2.4.46-3, der ebenfalls als Arch Linux Paket installiert wurde.

PHP und PHP-FPM sind auf Version 8.0.3

Nur die Postgres DB ist mit 13.2-1 nicht auf dem allerneuesten Stand.

Gruß
Henning

Es gibt ein Webserver log und auch das Nextcloud log.

Aus dem Auszug kann ich nicht wirklich was lesen, da ich Deine Config.php nicht kenne.

Für mich sieht die Error message so aus als ob die config.php Datei die falschen Berechtigungen hat…

1 Like

Hm,

das waren ja die Daten aus dem Webserver Log’s…
Ich habe noch mal alles unter /var/log/http gelöscht.
Dann php-fpm und httpd neu gestartet.
Die Dateien nextcloud.*.log sind leer. Nur die access.log und die error.log enthält Daten.
Ebenso leer ist die /var/log/nextcloud/nextcloud.log

access.log

::1 - - [30/Apr/2021:15:11:59 +0200] "GET /nextcloud/status.php HTTP/1.1" 500 -

error.log

[Fri Apr 30 15:11:50.283544 2021] [mpm_event:notice] [pid 14992:tid 140508340337984] AH00489: Apache/2.4.46 (Unix) OpenSSL/1.1.1k configured -- resuming normal operations
[Fri Apr 30 15:11:50.283583 2021] [core:notice] [pid 14992:tid 140508340337984] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
[Fri Apr 30 15:11:59.984319 2021] [proxy_fcgi:error] [pid 14993:tid 140508323771968] [client ::1:48858] AH01071: Got error 'PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"touch(): Utime failed: Permission denied at /srv/http/nextcloud/lib/private/Config.php#247","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":247,"function":"touch"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Ut...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/config/config.php): Failed to open stream: Permission denied at /srv/http/nextcloud/lib/private/Config.php#248","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":248,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.ph...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"chmod(): Operation not permitted at /srv/http/nextcloud/lib/private/Config.php#251","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":251,"function":"chmod"},{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Util","typ...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Log/File.php","line":85,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":371,"function":"write","class":"OC\\\\Log\\\\File","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":330,"function":"writeLog","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/status.php","line":66,"function":"logException","class":"OC\\\\Log","type":"->"}],"File":"/srv/http/nextcloud/lib/private/Log/ErrorHandler.php","Line":92...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"remote","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/srv/http/nextcloud/lib/private/Config.php","line":137,"function":"writeData","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/SystemConfig.php","line":111,"function":"setValue","class":"OC\\\\Config","type":"->"},{"file":"/srv/http/nextcloud/lib/private/legacy/OC_Util.php","line":1173,"function":"setValue","class":"OC\\\\SystemConfig","type":"->"},{"file":"/srv/http/nextcloud/lib/base.php","line":413,"function":"getInstanceId","class":"OC_Util","type":"::"},{"file":"/srv/http/nextcloud/lib/base.php","line":639,"function":"initSession","class":"OC","type":"::"},{"file":"/srv/http/nextcloud/lib/base.php","line":1076,"function":"ini...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":{"Exception":"Error","Message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","Code":0,"Trace":[{"function":"onError","class":"OC\\\\Log\\\\ErrorHandler","type":"::"},{"file":"/srv/http/nextcloud/lib/private/Log/File.php","line":85,"function":"fopen"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":371,"function":"write","class":"OC\\\\Log\\\\File","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":220,"function":"writeLog","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log.php","line":131,"function":"log","class":"OC\\\\Log","type":"->"},{"file":"/srv/http/nextcloud/lib/private/Log/ErrorHandler.php","line":7...PHP message: {"reqId":"Zek7O2LJvX2MWHR7lODx","level":3,"time":"2021-04-30T13:11:59+00:00","remoteAddr":"::1","user":"--","app":"PHP","method":"GET","url":"/nextcloud/status.php","message":"fopen(/srv/http/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /srv/http/nextcloud/lib/private/Log/File.php#85","userAgent":"Mozilla/5.0 (Linux) mirall/3.2.0git (Nextcloud, manjaro-5.10.32-1-MANJARO ClientArchitecture: x86_64 OsArchitecture: x86_64)","version":""}'

config.php
Dort steht auch gleich in der ersten Zeile, das die config nur read-only sein soll …

<?php

$CONFIG = array (
‘config_is_read_only’ => true,
‘datadirectory’ => ‘/data/nextcloud/’,
‘logfile’ => ‘/var/log/nextcloud/nextcloud.log’,
‘apps_paths’ =>
array (
0 =>
array (
‘path’ => ‘/srv/http/nextcloud/mywapps’,
‘url’ => ‘/mywapps’,
‘writable’ => true,
),
1 =>
array (
‘path’ => ‘/srv/http/nextcloud/apps’,
‘url’ => ‘/apps’,
‘writable’ => false,
),
),
‘instanceid’ => ‘ociv1f1j5gwk’,
‘passwordsalt’ => ‘XXX’,
‘secret’ => ‘XXXX’,
‘trusted_domains’ =>
array (
0 => ‘localhost’,
1 => ‘192.168.200.100’,
2 => ‘Falcon’,
),
‘dbtype’ => ‘pgsql’,
‘overwrite.cli.url’ => ‘http://localhost/nextcloud’,
‘dbname’ => ‘nextcloud’,
‘dbhost’ => ‘localhost’,
‘dbport’ => ‘’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘nextcloud’,
‘dbpassword’ => ‘XXXXn’,
‘installed’ => true,
‘version’ => ‘21.0.1.1’,
‘maintenance’ => false,
‘loglevel’ => 0,
‘theme’ => ‘’,
‘default_language’ => ‘de’,
‘default_locale’ => ‘de_DE’,
‘trashbin_retention_obligation’ => ‘auto, 7’,
‘updater.release.channel’ => ‘stable’,
‘app_install_overwrite’ =>
array (
0 => ‘emlviewer’,
1 => ‘files_fulltextsearch’,
2 => ‘fulltextsearch_elasticsearch’,
3 => ‘fulltextsearch’,
4 => ‘files_fulltextsearch_tesseract’,
5 => ‘calendar’,
),
);

Und wie sehen die file permissions für config.php aus Sicht des Webservers aus?

Kannst Du ‘config_is_read_only’ => true mal auf false setzen und dann schauen ob es geht?
Aber natürlich nur wenn der webserver auch die datei lesen und schreiben kann.

Die Rechte stehen so, wie sie nach der Installation gesetzt wurden.

# ls -al
insgesamt 68

drwxr-xr-x 1 nextcloud nextcloud 94 30. Apr 15:35 .
drwxr-xr-x 1 root root 12 30. Apr 15:35 …
-rw-r–r-- 1 nextcloud nextcloud 0 22. Apr 09:41 CAN_INSTALL
-rw-r----- 1 nextcloud nextcloud 1827 30. Apr 15:42 config.php
-rw-r–r-- 1 nextcloud nextcloud 59161 22. Apr 09:41 config.sample.php
-rw-r–r-- 1 nextcloud nextcloud 495 22. Apr 09:41 .htaccess

Wenn ich ein Apps Verzeichnis “mywapps” lösche scheint das niemanden zu interessieren.
Erst wenn ich die config.php auf rw-rw-rw- setze, bekomme ich Mecker wegen des fehlenden Verzeichnisses.

Komisch ist auch, das die Fehlermeldung bei rw-rw-rw- als reine Text-Meldung kommt.
Ist rw-r----- gesetzt, wird sie mit Nextcloud Logo und Hintergrund angezeigt.

Ob der Wert 'config_is_read_only’ => true oder false gesetzt ist, spielt dabei gar keine Rolle.

Wie kann ich denn zuverlässig prüfen, ob die Berechtigung aus Sicht des Webservers richtig sind?
Kann ein phpinfo da was sinnvolles liefern?

Die Schreibrechte für php-fpm sehen so aus:

### Editing /etc/systemd/system/php-fpm.service.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Service]

ReadWritePaths=/srv/http/nextcloud/config/
ReadWritePaths=/etc/webapps/nextcloud/
ReadWritePaths=/data/nextcloud/
ReadWritePaths=/srv/http/nextcloud/
ReadWritePaths=/srv/http/nextcloud/wapps/

### Lines below this comment will be discarded

Und hier die nextcloud.conf für php-fpm.d

[nextcloud]
user = nextcloud
group = nextcloud
listen = /run/nextcloud/nextcloud.sock
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp

; should be accessible by your web server
listen.owner = http
listen.group = http

pm = dynamic
pm.max_children = 15
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

Sehe keine Auffälligkeiten.
Kenne aber weder Manjaro noch php-fpm.

Gruß

Hi @fow0ryl

Nextcloud ist zweifelsohne nicht perfekt. Aber solche Fehler, wie du sie beschreibst, passieren eigentlich nur, wenn sich am System bzw. an den von Nextcloud benötigten Komponenten wie PHP, Webserver, Datenbank oder der Nextcloud selbst irgendetwas geändert hat.

Das Problem könnte bei dir sein, dass du Nextcloud auf Manjaro nutzt. Manjaro ist eine Rolling Release Distro und wenn du regelmässig “pacman -Syu”, sprich ein volles Systemupgrade machst, werden alles diese Komponentenen immer mitaktuialisiert, sobald neue Versionen verfügbar sind. Das ist einer der Hauptgründe, warum im professionellen Serverumfeld in der Regel eher konservative Distros bzw LTS Distros verwendet werden, bei denen innerhalb der Releasezyklen solche Dinge eben NICHT automatisch auf eine neue Major-Version aktualisiert werden.

1 Like

Hallo fow0ryl,

könntest du vielleicht das hier ausprobieren:

→ chown www-data:root config.php
und
→ chmod 777 config.php

Vielleicht hilf das ja. Du hast nix zu verlieren.