Nextcloud is not loading - data directory appears to have moved. Nextcloudpi

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 16
Operating system and version (eg, Ubuntu 20.04): Linux nextcloudpi 4.19.97-v7+ #1294
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.38 (Raspbian)
PHP version (eg, 7.1): PHP 7.3.11-1~deb10u1 (cli) (built: Oct 26 2019 14:14:18)

The issue you are facing:
Nextcloud will not load, with an internal server error. Following some other threads, I found that the data folder in config.php is set to /var/www/nextcloud/data, but my data appears to be in /var/www/ncp-data.sc1eBB . I’m not sure why the data would be there, or how to get it back. Should I just move that folder to the other path? Change the config file to point to that folder?

Any idea why the data is there? It’s called “ncp-data” so I imagine it’s something that ncp did, but I have no idea what. I have been trying to upgrade NC via NCP and not having any luck, so maybe that was part of it?

Thanks in advance.

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.

Is this the first time you’ve seen this error? (Y/N): Yee

Steps to replicate it:

  1. Load the UI

The output of your Nextcloud log in Admin > Logging: UI is unavailable, but from the FS:

{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":2,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"no app in context","method":"GET","url":"\/index.php\/login","message":"Temporary directory \/var\/www\/nextcloud\/data\/tmp is not present or writable","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":2,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"no app in context","method":"GET","url":"\/index.php\/login","message":"Temporary directory \/var\/www\/nextcloud\/data\/tmp is not present or writable","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":2,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"no app in context","method":"GET","url":"\/index.php\/login","message":"Temporary directory \/var\/www\/nextcloud\/data\/tmp is not present or writable","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":3,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"PHP","method":"GET","url":"\/index.php\/login","message":"file_get_contents(\/var\/www\/nextcloud\/data\/appdata_oclaqn5ofjmm\/js\/core\/merged-template-prepend.js.deps): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#217","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":3,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"PHP","method":"GET","url":"\/index.php\/login","message":"stat(): stat failed for \/var\/www\/nextcloud\/data\/appdata_oclaqn5ofjmm\/js\/core\/merged-template-prepend.js.deps at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#143","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":3,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"PHP","method":"GET","url":"\/index.php\/login","message":"filesize(): stat failed for \/var\/www\/nextcloud\/data\/appdata_oclaqn5ofjmm\/js\/core\/merged-template-prepend.js.deps at \/var\/www\/nextcloud\/lib\/private\/LargeFileHelper.php#171","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}
{"reqId":"Xpy2RnWdVptNDUyecht5qwAAUgA","level":3,"time":"2020-04-19T20:36:23+00:00","remoteAddr":"192.168.250.1","user":"--","app":"PHP","method":"GET","url":"\/index.php\/login","message":"file_put_contents(\/var\/www\/nextcloud\/data\/appdata_oclaqn5ofjmm\/js\/core\/merged-template-prepend.js): failed to open stream: No such file or directory at \/var\/www\/nextcloud\/lib\/private\/Files\/Storage\/Local.php#221","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko\/20100101 Firefox\/75.0","version":"16.0.3.0"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'passwordsalt' => '<REDACTED>',
  'secret' => '<REDACTED>',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
<REDACTED>
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '16.0.3.0',
  'overwrite.cli.url' => '<REDACTED>',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => '<REDACTED>',
  'installed' => true,
  'instanceid' => '<REDACTED>',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '<REDACTED>',
  ),
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'loglevel' => '2',
  'log_type' => 'file',
  'maintenance' => false,
  'data-fingerprint' => '<REDACTED>',
);

The output of your Apache/nginx/system log in /var/log/____: I don’t think this is relevant fwiw. Once PHP was restarted I haven’t seen this message again.

[Sun Apr 19 21:15:24.485569 2020] [proxy:error] [pid 678:tid 1612682272] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.3-fpm.sock (*) failed
[Sun Apr 19 21:15:24.487553 2020] [proxy_fcgi:error] [pid 678:tid 1612682272] [client 192.168.250.1:46311] AH01079: failed to make connection to backend: httpd-UDS