Nextcloud Migration from Debian to TrueNas

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, 20.0.5): 21.0.1.1
Operating system and version (eg, Ubuntu 20.04): Debian 10 -> TrueNAS-12.0-U3
Apache or nginx version (eg, Apache 2.4.25): Apache2 -> nginx
PHP version (eg, 7.4): 7.4

The issue you are facing:
I’m working on migrating my Nextcloud instance from Debian 10 to TrueNas. I used the plugin installer supplied by TrueNas to install an instance of NextCloud in a jail. I have ensured that the new instance has postgresql installed, user created, password the same. I have backed up my data and database, and imported them to the new instance; this, all of course done while in maintenance mode on deb machine.

I’m fairly confident the issue lies in my config file. May also be with .htaccess file, which I left intact from the old server. The error I’m getting when I try to login:

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’ve attached the only relevant log I can find. nginx reports no errors in /var/log/nginx/error.log and mostly code 500’s in /var/log/nginx/access.log

My gut reaction, from past experience, pointed to php-ACPu not being installed, but after running pkg install php74-pecl-APCu, I found that it was already installed. So I’m not really sure where to go from here. If there are any other relevant logs I can provide, I’ll respond as quickly as possible.

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

Steps to replicate it:

  1. Have a well-loved NextCloud installation on Debian 10 with Apache2
  2. Try to migrate it to TrueNAS 12 in a jail
  3. Profit?

The output of your Nextcloud log in Admin > Logging: (If this is through the webgui, i’m unable to reach it. Here’s the output of /var/log/nextcloud/nextcloud.log)

{"reqId":"CYQxDW22IQxEGu0Gcros","level":3,"time":"2021-04-26T23:13:26+00:00","remoteAddr":"","user":"ncadmin","app":"no app in context","method":"","url":"--","message":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve trashManager! Class trashManager does not exist","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/ServerContainer.php","line":162,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":434,"function":"query","class":"OC\\ServerContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":58,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"function":"OC\\AppFramework\\Bootstrap\\{closure}","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":68,"function":"array_map"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php","line":52,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_trashbin/lib/AppInfo/Application.php","line":57,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\Files_Trashbin\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/apps-pkg/dav/lib/AppInfo/Application.php","line":124,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\DAV\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_Util.php","line":203,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":554,"function":"setupFS","class":"OC_Util","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":415,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":624,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/lib/private/Setup.php","line":440,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/core/Command/Maintenance/Install.php","line":108,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Maintenance\\Install","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/occ","line":11,"args":["/usr/local/www/nextcloud/console.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":115,"CustomMessage":"Could not boot files_trashbinCould not resolve trashManager! Class trashManager does not exist"},"userAgent":"--","version":"21.0.1.1"}
{"reqId":"CYQxDW22IQxEGu0Gcros","level":3,"time":"2021-04-26T23:13:26+00:00","remoteAddr":"","user":"ncadmin","app":"no app in context","method":"","url":"--","message":{"Exception":"OCP\\AppFramework\\QueryException","Message":"Could not resolve OCA\\Files_Versions\\Versions\\IVersionManager! Class can not be instantiated","Code":0,"Trace":[{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":126,"function":"resolve","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":459,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/DependencyInjection/DIContainer.php","line":431,"function":"queryNoFallback","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","line":56,"function":"query","class":"OC\\AppFramework\\DependencyInjection\\DIContainer","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_versions/lib/AppInfo/Application.php","line":121,"function":"get","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_versions/lib/AppInfo/Application.php","line":108,"function":"loadBackend","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/FunctionInjector.php","line":68,"function":"registerVersionBackends","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/BootContext.php","line":52,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\FunctionInjector","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/files_versions/lib/AppInfo/Application.php","line":93,"function":"injectFn","class":"OC\\AppFramework\\Bootstrap\\BootContext","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\Files_Versions\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/apps-pkg/dav/lib/AppInfo/Application.php","line":124,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Bootstrap/Coordinator.php","line":176,"function":"boot","class":"OCA\\DAV\\AppInfo\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":197,"function":"bootApp","class":"OC\\AppFramework\\Bootstrap\\Coordinator","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_App.php","line":137,"function":"loadApp","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/legacy/OC_Util.php","line":203,"function":"loadApps","class":"OC_App","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":554,"function":"setupFS","class":"OC_Util","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":415,"function":"prepareUserLogin","class":"OC\\User\\Session","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":624,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/lib/private/User/Session.php","line":367,"function":"loginWithPassword","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/lib/private/Setup.php","line":440,"function":"login","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/core/Command/Maintenance/Install.php","line":108,"function":"install","class":"OC\\Setup","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OC\\Core\\Command\\Maintenance\\Install","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":1009,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/usr/local/www/nextcloud/occ","line":11,"args":["/usr/local/www/nextcloud/console.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php","Line":111,"CustomMessage":"Could not boot files_versionsCould not resolve OCA\\Files_Versions\\Versions\\IVersionManager! Class can not be instantiated"},"userAgent":"--","version":"21.0.1.1"}

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

<?php
$CONFIG = array (
  'app_paths' =>
  array (
    0 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps',
      'url' => '/apps',
      'writable' => true,
    ),
    1 =>
    array (
      'path' => '/usr/local/www/nextcloud/apps-pkg',
      'url' => '/apps-pkg',
      'writable' => true,
    ),
  ),
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'passwordsalt' => 'redacted',
  'secret' => 'redacted',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'cloud.redacted' ;my domain for production
    2 => '192.168.1.254', ;my local ip for testing
    3 => '192.168.1.10', ;local host ip
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'pgsql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'http://localhost',
  'overwriteprotocol' => 'https',
  'dbname' => 'redacted',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'redacted',
  'dbpassword' => 'redacted',
  'installed' => true,
  'instanceid' => 'redacted',
  'maintenance' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'redacted',
  'mail_domain' => 'gmail.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'redacted',
  'mail_smtppassword' => 'redacted',
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
  'memcache.local' => '\\OC\\Memcache\\APCu',
);

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

mostly empty, will post later if necessary

Some things that I’ve learned since getting some sleep.

  1. I didn’t have all of the php packages necessary
  2. But that doesn’t matter because postgresql won’t stay installed because
  3. FreeBSD jails are finicky about installing packages.

So when I installed postgresql13, I followed all the steps I thought I needed to take, but upon restart, the installation was gone. Similarly, php db driver packages were also gone. I figured this out by observing the behavior of su -m www -c 'php occ' from within the nextcloud installation. I’m not yet sure how to fix these issues, but I’ll be sure to update this post when I figure out. If anyone has suggestions, I’m all ears!