Nextcloud version (17.0.1):
Operating system and version (Raspberry pi 4 Buster):
Apache or nginx version (Apache 2.4.38):
PHP version (7.3):
The issue you are facing:
I managed to get nextcloud working on my raspberry pi so I then tried to change the data directory to an external hard drive, by executing the code below and then restarting apache. But when I reached the website I was met with this:
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.
I then checked the apache log and saw that it was written permission failure as such I gave the permissions needed to the data directory, however this did not fix the problem.
Is this the first time you’ve seen this error? (Y/N):Yes
Steps to replicate it:
- sudo mv /var/nextcloud/data /media/pi/data
- sudo ln -s /media/pi/data /var/nextcloud/data
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'instanceid' => 'occy4b12ybks',
'passwordsalt' => 'xxxxxxxx',
'secret' => 'xxxxxxx',
'trusted_domains' =>
array (
0 => 'xxxxxx',
),
'datadirectory' => '/var/nextcloud/data',
'dbtype' => 'mysql',
'version' => '17.0.1.1',
'overwrite.cli.url' => 'http://xxxxxxx/nextcloud',
'dbname' => 'nextcloud',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'xxxxxx',
'dbpassword' => 'xxxxxxx',
'installed' => true,
);
The output of your Apache/nginx/system log in /var/log/____
:
[Sun Mar 22 13:04:40.718571 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.718793 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"file_get_contents(\\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js.deps): failed to open stream: Permission denied at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Files\\/Storage\\/Local.php#217","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.719726 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.719779 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"stat(): stat failed for \\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js.deps at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Files\\/Storage\\/Local.php#143","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
stat: cannot stat '/var/nextcloud/data/appdata_occy4b12ybks/js/core/merged-template-prepend.js.deps': Permission denied
[Sun Mar 22 13:04:40.733321 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.733389 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"filesize(): stat failed for \\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js.deps at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/LargeFileHelper.php#171","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.738003 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.738077 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"file_put_contents(\\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js): failed to open stream: No such file or directory at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Files\\/Storage\\/Local.php#221","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.739530 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.739589 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"fileperms(): stat failed for \\/var\\/nextcloud\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Log\\/File.php#85","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.757844 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.757912 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"filesize(): stat failed for \\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js.deps at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/LargeFileHelper.php#171","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.762080 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.762150 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"file_put_contents(\\/var\\/nextcloud\\/data\\/appdata_occy4b12ybks\\/js\\/core\\/merged-template-prepend.js): failed to open stream: No such file or directory at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Files\\/Storage\\/Local.php#221","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.763403 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.763457 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"fileperms(): stat failed for \\/var\\/nextcloud\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Log\\/File.php#85","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.764522 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.764569 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"fileperms(): stat failed for \\/var\\/nextcloud\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Log\\/File.php#85","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
[Sun Mar 22 13:04:40.765232 2020] [php7:warn] [pid 2258] [client xxxx] PHP Warning: fileperms(): stat failed for /var/nextcloud/data/nextcloud.log in /var/www/html/nextcloud/lib/private/Log/File.php on line 85
[Sun Mar 22 13:04:40.765291 2020] [php7:notice] [pid 2258] [client xxxx] {"reqId":"xxxx","level":3,"time":"2020-03-22T13:04:40+00:00","remoteAddr":"xxxx","user":"admin","app":"PHP","method":"GET","url":"\\/nextcloud\\/index.php","message":"fileperms(): stat failed for \\/var\\/nextcloud\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/nextcloud\\/lib\\/private\\/Log\\/File.php#85","userAgent":"Mozilla\\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/80.0.3987.149 Safari\\/537.36","version":"17.0.1.1"}
Kind regards