Internal server error after magration to new server

Hello collegues,

I have moved my Nextcloud installation (version 21.0.2.1) from the old server to the new one.

The steps :

  1. Nextcloud in maintenance mode on
  2. disable vHost on old server (a2dissite 004-nextcloud.conf)
  3. Copy vHost-definition to new server and activate them (a2ensite 004-nextcloud.conf)
  4. export postgressdb (pg_dump nextclouddb > nextcloud.pgsql) and copy them to new server
  5. on new server create database and import nextcloud.pgsql (psql nextclouddb < nextcloud.pgsql)
  6. rsync the nextcloud-directory to new server (rsync -avzt nextcloud root@NEW_SERVER:/var/www/html/), this tool a while
  7. changed DNS entry for nextcloud
  8. Nextcloud in maintenance mode off

After a couple of minutes the clients could connect and everything looks fine. The sync is also possible.

But: When I click on settings as admin, I get an Internal Server Error:

grafik

For the request id GVdQ0eDXq6sisYjTjojA I find this in logfile:

{"reqId":"GVdQ0eDXq6sisYjTjojA","level":0,"time":"June 11, 2021 11:18:10","remoteAddr":"93.220.240.144","user":"admin","app":"contacts","method":"GET","url":"/index.php/settings/user","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.2.1"}

{"reqId":"GVdQ0eDXq6sisYjTjojA","level":0,"time":"June 11, 2021 11:18:10","remoteAddr":"93.220.240.144","user":"admin","app":"files_sharing","method":"GET","url":"/index.php/settings/user","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.2.1"}

{"reqId":"GVdQ0eDXq6sisYjTjojA","level":3,"time":"June 11, 2021 11:18:10","remoteAddr":"93.220.240.144","user":"admin","app":"index","method":"GET","url":"/index.php/settings/user","message":{"Exception":"Exception","Message":"syntax error, unexpected 'IURLGenerator' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\PersonalSettingsController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"section":"personal-info","_route":"settings.PersonalSettings.index"}]},{"file":"/var/www/html/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/user"]},{"file":"/var/www/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","Line":159,"Previous":{"Exception":"ParseError","Message":"syntax error, unexpected 'IURLGenerator' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/lib/composer/composer/ClassLoader.php","line":346,"function":"Composer\\Autoload\\includeFile","args":["/var/www/html/nextcloud/apps/passwords/lib//Settings/AdminSection.php"]},{"function":"loadClass","class":"Composer\\Autoload\\ClassLoader","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"function":"spl_autoload_call","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":107,"function":"__construct","class":"ReflectionClass","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":459,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/ServerContainer.php","line":146,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/Settings/Manager.php","line":112,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OCA\\Passwords\\Settings\\AdminSection"]},{"file":"/var/www/html/nextcloud/lib/private/Settings/Manager.php","line":207,"function":"getSections","class":"OC\\Settings\\Manager","type":"->","args":["admin"]},{"file":"/var/www/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":123,"function":"getAdminSections","class":"OC\\Settings\\Manager","type":"->","args":[]},{"file":"/var/www/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":76,"function":"formatAdminSections","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info",false]},{"file":"/var/www/html/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php","line":148,"function":"getNavigationParameters","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/nextcloud/apps/settings/lib/Controller/PersonalSettingsController.php","line":68,"function":"getIndexResponse","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal","personal-info"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"index","class":"OCA\\Settings\\Controller\\PersonalSettingsController","type":"->","args":["personal-info"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\PersonalSettingsController"},"index"]},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\PersonalSettingsController","index",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"section":"personal-info","_route":"settings.PersonalSettings.index"}]},{"file":"/var/www/html/nextcloud/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/user"]},{"file":"/var/www/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/nextcloud/apps/passwords/lib/Settings/AdminSection.php","Line":25},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0","version":"21.0.2.1"}

Can you help me please?

Kind regards,
Heinrich

New info. If I try to put Nextcloud into maintenance mode, I get this error message:

www-data@obelix:~/html/nextcloud$ php occ maintenance:mode --on
An unhandled exception has been thrown:
ParseError: syntax error, unexpected 'BackupService' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/www/html/nextcloud/apps/passwords/lib/Command/BackupCreateCommand.php:28
Stack trace:
#0 /var/www/html/nextcloud/lib/composer/composer/ClassLoader.php(346): Composer\Autoload\includeFile('/var/www/html/n...')
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('OCA\\Passwords\\C...')
#2 [internal function]: spl_autoload_call('OCA\\Passwords\\C...')
#3 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(107): ReflectionClass->__construct('OCA\\Passwords\\C...')
#4 /var/www/html/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(126): OC\AppFramework\Utility\SimpleContainer->resolve('OCA\\Passwords\\C...')
#5 /var/www/html/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php(459): OC\AppFramework\Utility\SimpleContainer->query('OCA\\Passwords\\C...')
#6 /var/www/html/nextcloud/lib/private/ServerContainer.php(146): OC\AppFramework\DependencyInjection\DIContainer->queryNoFallback('OCA\\Passwords\\C...')
#7 /var/www/html/nextcloud/lib/private/Console/Application.php(221): OC\ServerContainer->query('OCA\\Passwords\\C...')
#8 /var/www/html/nextcloud/lib/private/Console/Application.php(136): OC\Console\Application->loadCommandsFromInfoXml(Array)
#9 /var/www/html/nextcloud/console.php(99): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/html/nextcloud/occ(11): require_once('/var/www/html/n...')
#11 {main}www-data@obelix:~/html/nextcloud$
www-data@obelix:~/html/nextcloud$
www-data@obelix:~/html/nextcloud$

I was able to fix the error. The problem was the Passwords-App, after deactivation and removing them, Nextcloud runs fine!