Nextcloud Migrierung

drakul

Member
Hallo,

ich habe mittels Migration Toolkit meine Nextcloud-Installation auf den neuen Server übersiedet, allerdings bekomme ich diese noch nicht zum Laufen.

Die 1. Fehlermeldung war ein Internal Server Error, diese habe mittels
sudo chown -R www-data:www-data /var/www/clients/client2/web3/cloud
"behoben".

Jetzt bekomme ich folgende Fehlermeldung:

Die Fehlermeldung erscheinen jeweils beim Aufrufen der Internetseite.

Wenn ich probiere mittels sudo -u www-data php occ maintenance:mode --on [im Nextcloudinstallationspfad ausgeführt] den Wartungsmodus zu aktivieren bekomme ich im Terminal folgende Fehlermeldung:
PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:17+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(\/var\/www\/clients\/client2\/web3\/web\/data\/files_encryption\/OC_DEFAULT_MODULE\/pubShare_adc079c9.publicKey): failed to open stream: No such file or directory at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Files\/Storage\/Local.php#301","userAgent":"--","version":"16.0.5.1"}
PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:17+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(\/var\/www\/clients\/client2\/web3\/web\/data\/files_encryption\/OC_DEFAULT_MODULE\/pubShare_adc079c9.privateKey): failed to open stream: No such file or directory at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Files\/Storage\/Local.php#301","userAgent":"--","version":"16.0.5.1"}
PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:18+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(\/var\/www\/clients\/client2\/web3\/web\/data\/files_encryption\/OC_DEFAULT_MODULE\/master_adc079c9.publicKey): failed to open stream: No such file or directory at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Files\/Storage\/Local.php#301","userAgent":"--","version":"16.0.5.1"}
PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:19+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(\/var\/www\/clients\/client2\/web3\/web\/data\/files_encryption\/OC_DEFAULT_MODULE\/master_adc079c9.privateKey): failed to open stream: No such file or directory at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Files\/Storage\/Local.php#301","userAgent":"--","version":"16.0.5.1"}
PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:19+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/var\/www\/clients\/client2\/web3\/web\/data\/nextcloud.log at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.5.1"}
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:19+00:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message"

.....

["\/var\/www\/clients\/client2\/web3\/cloud\/console.php"],"function":"require_once"}],"File":"\/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Files\/Node\/Folder.php","Line":162,"CustomMessage":"--"},"userAgent":"--","version":"16.0.5.1"}
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/16/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/clients/client2/web3/cloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/clients/client2/web3/cloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/clients/client2/web3/cloud/occ(11): require_once('/var/www/client...')
#2 {main}PHP Warning: fileperms(): stat failed for /var/www/clients/client2/web3/web/data/nextcloud.log in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:19+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fileperms(): stat failed for \/var\/www\/clients\/client2\/web3\/web\/data\/nextcloud.log at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Log\/File.php#140","userAgent":"--","version":"16.0.5.1"}
{"reqId":"SSysJtpWmt3fgK0nNZqG","level":3,"time":"2020-01-03T23:21:19+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"chmod(): No such file or directory at \/var\/www\/clients\/client2\/web3\/cloud\/lib\/private\/Log\/File.php#141","userAgent":"--","version":"16.0.5.1"}

Ich werde nicht ganz schlau daraus und hoffe mir kann jemand helfen.

LG
Max

PS: Es ist eine Nextcloud 16 Installation und PHP7.2 ist derzeit im Hintergrund und ich vermute es ist ein Rechtethema.
 

drakul

Member
@nowayback danke für die antwort :)

ich dachte der www-data user wäre der Inhaber?

wenn ich sudo chown -R web3:client2 /var/www/clients/client/client2/web3/cloud ausführe, bekomme ich wieder folgende 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.

beim Ausführen von root@server:/var/www/clients/client2/web3/cloud# sudo -u www-data php occ maintenance:mode --on

bekomme ich folgende Fehlermeldung:
Cannot write into "config" directory!
This can usually be fixed by giving the webserver write access to the config directory
See https://docs.nextcloud.com/server/16/go.php?to=admin-dir_permissions

Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.
See https://docs.nextcloud.com/server/16/go.php?to=admin-config
 

drakul

Member
@Till danke für die Antwort.

suexec ist aktiviert und die Seite läuft unter PHP-FPM; php7.2 (ist so übernommen worden :) )

allerdings müsste das problem dann doch noch wo anders zu finden sein...
 

drakul

Member
@Till

ja, ich habe
sudo chown -R web3:client2 /var/www/clients/client2/web3/cloud sudo chown -R web3:client2 /var/www/clients/client2/web3/web

ausgeführt - dies hat allerdings noch keine Veränderung bewirkt, wird ja im Normalfall auch vom Migration Toolkit richtig übernommen, soweit ich dies sehe.
 

Till

Administrator
ausgeführt - dies hat allerdings noch keine Veränderung bewirkt, wird ja im Normalfall auch vom Migration Toolkit richtig übernommen, soweit ich dies sehe.

Richtig, nur wenn Du es halt nachher manuell änderst, musst Du es auch wieder auf die richtigen Werte setzen.

Zu dem internal server error, der Grund dafür sollte im error.log der Webseite stehen.

Und zu dem maintenance script, das musst Du als web3 user ausführen und nicht als www-data.
 

drakul

Member
@Till ist klar, hatte ich auch gemacht (meines Verständnisses nach).

Danke für die Logik mit dem maintenance script.

Der Error Log in /web3/log/cloud/error.log gibt folgendes aus:
[Sat Jan 04 12:13:27.208187 2020] [proxy_fcgi:error] [pid 31383] [client 62.47.238.76:55606] AH01071: Got error 'PHP message: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/clients/client2/web3/web/data/nextcloud.log) is not within the allowed path(s): (/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.domain.tld/cloud:/srv/www/cloud.domain.tld/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 60\nPHP message: PHP Warning: is_writable(): open_basedir restriction in effect. File(/var/www/clients/client2/web3/web/data) is not within the allowed path(s): (/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.domain.tld/cloud:/srv/www/cloud.domain.tld/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 63\nPHP message: PHP Warning: fileperms(): open_basedir restriction in effect. File(/var/www/clients/client2/web3/web/data/nextcloud.log) is not within the allowed path(s): (/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.domain.tld/cloud:/srv/www/cloud.domain.tld/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140\nPHP message: {"reqId":"7lR97MtmyZOIc4GKbAAz","level":3,"time":"2020-01-04T11:13:27+00:00","remoteAddr":"62.47.238.76","user":"--","app":"PHP","method":"PROPFIND","url":"\\/remote.php\\/dav\\/files\\/robert\\/","message":"fileperms(): open_basedir restriction in effect. File(\\/var\\/www\\/clients\\/client2\\/web3\\/web\\/data\\/nextcloud.log) is not within the allowed path(s): (\\/var\\/www\\/clients\\/client2\\/web3\\/cloud:\\/var\\/www\\/clients\\/client2\\/web3\\/private:\\/var\\/www\\/clients\\/client2\\/web3\\/tmp:\\/var\\/www\\/cloud.domain.tld\\/cloud:\\/srv\\/www\\/cloud.domain.tld\\/cloud:\\/usr\\/share\\/php5:\\/usr\\/share\\/php:\\/tmp:\\/usr\\/share\\/phpmyadmin:\\/etc\\/phpmyadmin:\\/var\\/lib\\/phpmyadmin:\\/dev\\/random:\\/dev\\/urandom) at \\/var\\/www\\/clients\\/client2\\/web3\\/cloud\\/lib\\/private\\/Log\\/File.php#140","userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.6.0stable-Win64 (build 20190927) (Nextcloud)","version":"16.0.5.1"}\nPHP message: {"reqId":"7lR97MtmyZOIc4GKbAAz","level":3,"time":"2020-01-04T11:13:27+00:00","remoteAddr":"62.47.238.76","user":"--","app":"PHP","method":"PROPFIND","url":"\\/remote.php\\/dav\\/files\\/robert\\/","message":"Error: Class 'OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ExceptionLoggerPlugin' not found at \\/var\\/www\\/clients\\/client2\\/web3\\/cloud\\/remote.php#57","userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.6.0stable-Win64 (build 20190927) (Nextcloud)","version":"16.0.5.1"}\nPHP message: PHP Warning: fileperms(): open_basedir restriction in effect. File(/var/www/clients/client2/web3/web/data/nextcloud.log) is not within the allowed path(s): (/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.domain.tld/cloud:/srv/www/cloud.domain.tld/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom) in /var/www/clients/client2/web3/cloud/lib/private/Log/File.php on line 140\nPHP message: {"reqId":"7lR97MtmyZOIc4GKbAAz","level":3,"time":"2020-01-04T11:13:27+00:00","remoteAddr":"62.47.238.76","user":"--","app":"PHP","method":"PROPFIND","url":"\\/remote.php\\/dav\\/files\\/robert\\/","message":"fileperms(): open_basedir restriction in effect. File(\\/var\\/www\\/clients\\/client2\\/web3\\/web\\/data\\/nextcloud.log) is not within the allowed path(s): (\\/var\\/www\\/clients\\/client2\\/web3\\/cloud:\\/var\\/www\\/clients\\/client2\\/web3\\/private:\\/var\\/www\\/clients\\/client2\\/web3\\/tmp:\\/var\\/www\\/cloud.domain.tld\\/cloud:\\/srv\\/www\\/cloud.domain.tld\\/cloud:\\/usr\\/share\\/php5:\\/usr\\/share\\/php:\\/tmp:\\/usr\\/share\\/phpmyadmin:\\/etc\\/phpmyadmin:\\/var\\/lib\\/phpmyadmin:\\/dev\\/random:\\/dev\\/urandom) at \\/var\\/www\\/clients\\/client2\\/web3\\/cloud\\/lib\\/private\\/Log\\/File.php#140","userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.6.0stable-Win64 (build 20190927) (Nextcloud)","version":"16.0.5.1"}\nPHP message: {"reqId":"7lR97MtmyZOIc4GKbAAz","level":3,"time":"2020-01-04T11:13:27+00:00","remoteAddr":"62.47.238.76","user":"--","app":"PHP","method":"PROPFIND","url":"\\/remote.php\\/dav\\/files\\/robert\\/","message":"chmod(): open_basedir restriction in effect. File(\\/var\\/www\\/clients\\/client2\\/web3\\/web\\/data\\/nextcloud.log) is not within the allowed path(s): (\\/var\\/www\\/clients\\/client2\\/web3\\/cloud:\\/var\\/www\\/clients\\/client2\\/web3\\/private:\\/var\\/www\\/clients\\/client2\\/web3\\/tmp:\\/var\\/www\\/cloud.domain.tld\\/cloud:\\/srv\\/www\\/cloud.domain.tld\\/cloud:\\/usr\\/share\\/php5:\\/usr\\/share\\/php:\\/tmp:\\/usr\\/share\\/phpmyadmin:\\/etc\\/phpmyadmin:\\/var\\/lib\\/phpmyadmin:\\/dev\\/random:\\/dev\\/urandom) at \\/var\\/www\\/clients\\/client2\\/web3\\/cloud\\/lib\\/private\\/Log\\/File.php#141","userAgent":"Mozilla\\/5.0 (Windows) mirall\\/2.6.0stable-Win64 (build 20190927) (Nextcloud)","version":"16.0.5.1"}\n'
 

Till

Administrator
Poste mal bitte den Inhalt des open basedir Feldes auf dem optionen reiter der website oder pass ihn direkt selbst an so dass er auf die neuen web pfade passt.
 

drakul

Member
der Inhalt ist:


/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.domain.com/cloud:/srv/www/cloud.domain.com/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
 
Zuletzt bearbeitet:

Till

Administrator
Ändere den mal in:

Code:
/var/www/clients/client2/web3/web:/var/www/clients/client2/web3/cloud:/var/www/clients/client2/web3/private:/var/www/clients/client2/web3/tmp:/var/www/cloud.maximilian-geyer.com/cloud:/srv/www/cloud.maximilian-geyer.com/cloud:/usr/share/php5:/usr/share/php:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/dev/random:/dev/urandom
 

drakul

Member
Anfangs ja, jetzt habe jetzt auf php7.3 und fast-cgi umgestellt, jetzt kommt folgendes (wieder mal mit dem blauen Hintergrund):

Code:
Fehler
Ihr Datenverzeichnis ist ungültig.

Stellen Sie sicher, dass eine Datei ".ocdata" im Wurzelverzeichnis des data-Verzeichnisses existiert.

ich habe sicherheitshalber die Datei auch nochmal mit

echo > .ocdata

angelegt aber keine Veränderung.

neuinitialisieren mit

sudo -u web3 php occ files:scan --all

bringt folgende Meldung hervor:

Code:
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/clients/client2/web3/cloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/clients/client2/web3/cloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/clients/client2/web3/cloud/occ(11): require_once('/var/www/client...')
 

drakul

Member
@Till mittlerweile bekomme ich folgende Meldung:

Code:
This version of Nextcloud is not compatible with > PHP 7.3.
You are currently running 7.4.1.

Allerdings ist in der Systemkonfiguration->Web->php-> php7.3 eingestellt?

Ich habe jetzt noch php7.3 als zusätzliches php konfiguriert und die Website manuell darauf eingestellt, wenn ich eine phpinfo() Abfrage mache im /cloud folder ist auch php7.3 eingstellt, allerdings bringt mir die Abfrage im Terminal eben als Resultat php7.4 - kann ich dies noch wo anders festlegen?

Code:
update-alternatives --config php

===

Ausführen mit
sudo -u web3 php7.3 -f console.php files:scan --all

bringt wieder folgendes Resultat:
Code:
Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/clients/client2/web3/cloud/lib/private/Console/Application.php:166
Stack trace:
#0 /var/www/clients/client2/web3/cloud/console.php(96): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 {main}root@server:/var/www/clients/client2/web3/cloud#

ok ich bin eine Pfeife - gefühlte 30mal drüber gelesen war doch in der config.php ein falscher Pfad - thx :)

===

mal anders gefragt welche logs können mir jetzt noch helfen?

im website log taucht nichts mehr auf.
im apache log habe ich folgendes:
mod_fcgid: stderr: PHP Deprecated: Function get_magic_quotes_runtime() is deprecated in /usr/local/ispconfig/interface/lib/config.inc.php on line 48

wie kann man das beheben?

===

einfach DANKE @Till @nowayback !!! :)
 
Zuletzt bearbeitet:

Werbung

Top