Nextcloud internal error after server migration

Support intro

Nextcloud version : 14.0.7.1
Operating system and version : Ubuntu 18
Apache :
PHP version : 7.2.19

The issue you are facing:
I migrated my nextcloud, from a VPS to an anopther one… Now, I finished the migration process, but when I access the nextcloud page, I get the internal error message page, instead of the maintenance mode on page.
Thanks you for your help !!!

Is this the first time you’ve seen this error? : Yes

The output of your Nextcloud log in Admin > Logging: in maintenance mode, cannot access it ?


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

<?php
$CONFIG = array (
  'passwordsalt' => 'XXXXXX',
  'secret' => 'XXXXXX',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'nextcloud.XXXXX',
    2 => 'nuage.XXXXXX',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'overwrite.cli.url' => 'http://XXXXXXX',
  'htaccess.RewriteBase' => '/',
  'dbtype' => 'mysql',
  'version' => '14.0.7.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'XXXXXXXXX',
  'logfile' => '/var/log/nextcloud.log',
  'loglevel' => '2',
  'log_rotate_size' => '104857600',
  'installed' => true,
  'instanceid' => 'XXXXXXX',
  'skeletondirectory' => '/var/www/nextcloud/data/skeleton/',
  'mail_domain' => 'XXXXXXX',
  'mail_from_address' => 'XXXXXX',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'default_language' => 'fr',
  0 => 'php_value upload_max_filesize = 10G',
  1 => 'php_value post_max_size = 10G',
  'maintenance' => true,
  'loglevel' => 2,
  'mail_sendmailmode' => 'smtp',
);

The output of your Apache/nginx/system log in /var/log/____:

{"reqId":"j91GOERfVs0SD0E5STdX",
"level"3,
"time":"2019-08-14T15:40:47+00:00",
"remoteAddr":"194.187.249.34",
"user":"--",
"app":"index",
"method":"GET",
"url":"\/",
"message":{"Exception":"Punic\\Exception\\DataFileNotFound",
"Message":"Unable to find the data file 'parentLocales'",
"Code":10004,
"Trace":[{"file":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Data.php",
"line":465,
"function":"getGeneric",
"class":"Punic\\Data",
"type":"::",
"args":["parentLocales"]},
{"file":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Data.php",
"line":529,
"function":"explodeLocale",
"class":"Punic\\Data",
"type":"::",
"args":["fr"]},
{"file":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Data.php",
"line":503,
"function":"getLocaleAlternatives",
"class":"Punic\\Data",
"type":"::",
"args":["fr"]},
{"file":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Data.php",
"line":142,
"function":"getLocaleFolder",
"class":"Punic\\Data",
"type":"::",
"args":["fr"]},
{"file":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Calendar.php",
"line":743,
"function":"get",
"class":"Punic\\Data",
"type":"::",
"args":["calendar","fr"]},
{"file":"\/var\/www\/nextcloud\/lib\/private\/L10N\/L10N.php",
"line":173,
"function":"getDateFormat",
"class":"Punic\\Calendar",
"type":"::",
"args":["short","fr"]},
{"file":"\/var\/www\/nextcloud\/lib\/private\/Template\/JSConfigHelper.php",
"line":168,
"function":"l","class":"OC\\L10N\\L10N",
"type":"->","args":["jsdate",null]},{"file":"\/var\/www\/nextcloud\/lib\/private\/TemplateLayout.php",
"line":176,
"function":"getConfig",
"class":"OC\\Template\\JSConfigHelper",
"type":"->",
"args":[]},{"file":"\/var\/www\/nextcloud\/lib\/private\/legacy\/template.php",
"line":210,
"function":"__construct",
"class":"OC\\TemplateLayout",
"type":"->",
"args":["guest",""]},
{"file":"\/var\/www\/nextcloud\/lib\/private\/Template\/Base.php",
"line":132,
"function":"fetchPage",
"class":"OC_Template",
"type":"->","args":[]},
{"file":"\/var\/www\/nextcloud\/lib\/base.php",
"line":297,
"function":"printPage",
"class":"OC\\Template\\Base",
"type":"->",
"args":[]},{"file":"\/var\/www\/nextcloud\/lib\/base.php",
"line":935,"function":"checkMaintenanceMode",
"class":"OC",
"type":"::",
"args":[]},{"file":"\/var\/www\/nextcloud\/index.php",
"line":42,
"function":"handleRequest",
"class":"OC",
"type":"::",
"args":[]}],
"File":"\/var\/www\/nextcloud\/3rdparty\/punic\/punic\/code\/Data.php",
"Line":194,"CustomMessage":"--"},
"userAgent":"Mozilla\/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko\/20100101 Firefox\/68.0","version":"14.0.7.1"}

Is your database up?

This didn t help :confused:

sudo -u www-data php occ maintenance:repair 
Nextcloud is in maintenance mode - no apps have been loaded

Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\FixBirthdayCalendarComponent' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\CalDAVRemoveEmptyValue' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\BuildCalendarSearchIndex' is unknown
Failed to load repair step for dav: Repair step 'OCA\DAV\Migration\RemoveClassifiedEventActivity' is unknown
Failed to load repair step for deck: Repair step 'OCA\Deck\Migration\UnknownUsers' is unknown
Failed to load repair step for files_sharing: Repair step 'OCA\Files_Sharing\Migration\OwncloudGuestShareType' is unknown
Failed to load repair step for files_sharing: Repair step 'OCA\Files_Sharing\Migration\SetPasswordColumn' is unknown
Failed to load repair step for mail: Repair step 'OCA\Mail\Migration\FixCollectedAddresses' is unknown
Failed to load repair step for oauth2: Repair step 'OCA\OAuth2\Migration\SetTokenExpiration' is unknown
Failed to load repair step for ownpad: Repair step 'OCA\Ownpad\Migration\MigrateSettings' is unknown
Failed to load repair step for ownpad: Repair step 'OCA\Ownpad\Migration\ConfigPublicEnable' is unknown
Failed to load repair step for sociallogin: Repair step 'OCA\SocialLogin\Migration\SeparateProvidersNameAndTitle' is unknown
 - Repair MySQL collation
     - All tables already have the correct collation -> nothing to do
 - Repair mime types
 - Clean tags and favorites
     - 0 tags of deleted users have been removed.
     - 0 tags for delete files have been removed.
     - 0 tag entries for deleted tags have been removed.
     - 2 tags with no entries have been removed.
 - Repair invalid shares
 - Remove shares of a users root folder
 - Move .step file of updater to backup location
 - Fix potential broken mount points
     - No mounts updated
 - Repair invalid paths in file cache
 - Add log rotate job
 - Clear frontend caches
     - Image cache cleared
     - SCSS cache cleared
     - JS cache cleared
 - Add preview background cleanup job
 - Queue a one-time job to cleanup old backups of the updater
 - Repair pending cron jobs
     - No need to repair pending cron jobs.

I found the solution !
/var/www/nextcloud$ sudo -u www-data php occ integrity:check-core
told me that some files where missing
rsync didn t copy all the file.
Some files in 3rd party directory are with right 500, and could not be copy over to the new server.
I had to allow SSH loggin wioth root and rsync as root so it get copied witrht he correct rights.