Filex_external error after migrating from Nextcloud VM to RaspberryPi

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.2.1
Operating system and version (eg, Ubuntu 20.04): 20.04.2
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.41
PHP version (eg, 7.4): 7.4.3

The issue you are facing:

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

Steps to replicate it:

  1. enable external_files plugin
  2. try to access global settings of external_files
Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

Technical details
Remote Address: 192.168.101.10
Request ID: DovH9fXDlCmgRHMkXpkU

The output of your Nextcloud log in Admin > Logging:


{"reqId":"cUTCI5v89YEE8Ac64zm7","level":3,"time":"2021-06-07T07:00:05+02:00","remoteAddr":"","user":"--","app":"mail","method":"","url":"--","message":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/IMAPClientFactory.php","line":66,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php","line":90,"function":"getClient","class":"OCA\\Mail\\IMAP\\IMAPClientFactory","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":91,"function":"sync","class":"OCA\\Mail\\IMAP\\MailboxSync","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":61,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":128,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":147,"CustomMessage":"Cron mail sync failed: HMAC does not match."},"userAgent":"--","version":"21.0.2.1","id":"60bda7d585edf"}
{"reqId":"cUTCI5v89YEE8Ac64zm7","level":3,"time":"2021-06-07T07:00:04+02:00","remoteAddr":"","user":"--","app":"spreed","method":"","url":"--","message":"Getting the account information failed: unauthorized - HTTP status: 401 Response body: ","userAgent":"--","version":"21.0.2.1","id":"60bda7d585f16"}
{"reqId":"Ua1E1oxZK2wtTfpsuXql","level":3,"time":"2021-06-07T06:10:01+02:00","remoteAddr":"","user":"--","app":"mail","method":"","url":"--","message":{"Exception":"Exception","Message":"HMAC does not match.","Code":0,"Trace":[{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/IMAPClientFactory.php","line":66,"function":"decrypt","class":"OC\\Security\\Crypto","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php","line":90,"function":"getClient","class":"OCA\\Mail\\IMAP\\IMAPClientFactory","type":"->"},{"file":"/var/www/nextcloud/apps/mail/lib/BackgroundJob/SyncJob.php","line":91,"function":"sync","class":"OCA\\Mail\\IMAP\\MailboxSync","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":80,"function":"run","class":"OCA\\Mail\\BackgroundJob\\SyncJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":61,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/cron.php","line":128,"function":"execute","class":"OCP\\BackgroundJob\\TimedJob","type":"->"}],"File":"/var/www/nextcloud/lib/private/Security/Crypto.php","Line":147,"CustomMessage":"Cron mail sync failed: HMAC does not match."},"userAgent":"--","version":"21.0.2.1","id":"60bd9c1a3de45"}
{"reqId":"oE5BA8PFVMW6UxjVulfZ","level":2,"time":"2021-06-07T00:01:25+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"Sabre\\HTTP\\ClientHttpException: Bad Gateway","Code":1,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Storage/DAV.php","line":288,"function":"convertException","class":"OC\\Files\\Storage\\DAV","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/DAV.php","line":586,"function":"propfind","class":"OC\\Files\\Storage\\DAV","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Common.php","line":458,"function":"stat","class":"OC\\Files\\Storage\\DAV","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/External/Storage.php","line":191,"function":"test","class":"OC\\Files\\Storage\\Common","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":475,"function":"test","class":"OCA\\Files_Sharing\\External\\Storage","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php","line":70,"function":"test","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php","line":84,"function":"updateAvailability","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php","line":93,"function":"isAvailable","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Availability.php","line":442,"function":"checkAvailability","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":581,"function":"getMetaData","class":"OC\\Files\\Storage\\Wrapper\\Availability","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":115,"function":"getMetaData","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":153,"function":"getData","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/External/Scanner.php","line":63,"function":"scanFile","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Cache/Scanner.php","line":339,"function":"scanFile","class":"OCA\\Files_Sharing\\External\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files_sharing/lib/External/Scanner.php","line":42,"function":"scan","class":"OC\\Files\\Cache\\Scanner","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Utils/Scanner.php","line":260,"function":"scan","class":"OCA\\Files_Sharing\\External\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":158,"function":"scan","class":"OC\\Files\\Utils\\Scanner","type":"->"},{"file":"/var/www/nextcloud/apps/files/lib/Command/Scan.php","line":214,"function":"scanFiles","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Command/Command.php","line":255,"function":"execute","class":"OCA\\Files\\Command\\Scan","type":"->"},{"file":"/var/www/nextcloud/core/Command/Base.php","line":169,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php","line":1009,"function":"run","class":"OC\\Core\\Command\\Base","type":"->"},{"file":"/var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php","line":273,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/apps/bookmarks/vendor/symfony/console/Application.php","line":149,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":215,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":100,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":11,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/Storage/DAV.php","Line":862,"Hint":"Storage is temporarily not available","CustomMessage":"--"},"userAgent":"--","version":"21.0.2.1","id":"60bd4a1b9d814"}
{"reqId":"oE5BA8PFVMW6UxjVulfZ","level":2,"time":"2021-06-07T00:01:25+02:00","remoteAddr":"","user":"--","app":"no app in context","method":"","url":"--","message":"External storage not available: Sabre\\HTTP\\ClientHttpException: Bad Gateway","userAgent":"--","version":"21.0.2.1","id":"60bd4a1b9d863"}

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

<?php
$CONFIG = array (
  'passwordsalt' => 'newsalt',
  'secret' => 'newsecret',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.168.101.105',
    2 => 'old-url.example.com',
    3 => new-url.example.com',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '21.0.2.1',
  'overwrite.cli.url' => 'https://new-url.example.com/',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'dbuser',
  'dbpassword' => 'newdbpw',
  'installed' => true,
  'instanceid' => 'newinstanceid',
  'upgrade.disable-web' => 'true',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '10485760',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => 'newpw',
  ),
  'logtimezone' => 'Europe/Zurich',
  'htaccess.RewriteBase' => '/',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    11 => 'OC\\Preview\\PNG',
    12 => 'OC\\Preview\\JPEG',
    13 => 'OC\\Preview\\GIF',
    14 => 'OC\\Preview\\BMP',
    15 => 'OC\\Preview\\MarkDown',
    16 => 'OC\\Preview\\MP3',
    17 => 'OC\\Preview\\TXT',
    18 => 'OC\\Preview\\Movie',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,
  'mail_smtpsecure' => 'ssl',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'mailfrom',
  'mail_domain' => 'maildomain',
  'mail_smtphost' => 'smtphost',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'email',
  'mail_smtppassword' => 'emailpw',
  'default_phone_region' => 'ch',
);

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

on request i can upload a specific logfile

Further info:

this host is supposed to host other things as well in the future but right now its a blank "nextcloud vm" setup as per hansson install script plus some apache config to reverse-proxy the "old" (or rather still current) nextcloud installation on a different url

I tried removing the plugin but it seems this plugin was shipped with nextcloud and cant be deleted and then reinstalled, i already used occ to remove all configure mountpoints but its the same thing still, is there a way to completely remove all related config?

I also tried to search the nextcloud.log file for the request id in the error message but it does not seem to appear there

I probably made some mistake with the backup/restore so I am also happy to try out a different method of backing up/restoring.
PS: the old and new install have direct network connectivity (though in different subnets) so I could transfer directly somehow as well (though I thought via tar might be the safest way to preserve all information)

used adminer to clear a few tables, ended up being oc_storages after which it was accessible again and then recreated the shares