Transferred Nextcloud to new server, updated, and now getting 500 errors

Nextcloud version: 22.2.10.2
Operating system and version: Arch (rolling release, fully updated)
Apache or nginx version: Apache/2.4.57 (Unix)
PHP version: 8.0.28

The issue you are facing:
I transferred my very outdated Nextcloud instance from an old Ubuntu server to my new Arch server. I am in the process of updating Nextcloud, and just completed the first major version update. Nextcloud was running properly before the update, and the update process appeared to complete correctly. However, I now get Nextcloud’s “Internal Server Error” page. Developer tools shows an error 500.

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

Steps to replicate it:

  1. Have a lousy, out-of-date Nextcloud install
  2. Attempt to upgrade
  3. Be puzzled

I’m not seeing any errors in my Apache logs, but there are some interesting stack traces in the nextcloud log:

{"reqId":"QZTq6jP9sxUtRsMvp00B","level":0,"time":"2023-07-02T23:10:16+00:00","remoteAddr":"<ip-addr>","user":"--","app":"files_sharing","method":"GET","url":"/index.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0","version":"22.2.10.2"}
{"reqId":"QZTq6jP9sxUtRsMvp00B","level":3,"time":"2023-07-02T23:10:16+00:00","remoteAddr":"<ip-addr>","user":"brian","app":"index","method":"GET","url":"/index.php","message":"parse_url(): Argument #1 ($url) must be of type string, array given","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0","version":"22.2.10.2","exception":{"Exception":"TypeError","Message":"parse_url(): Argument #1 ($url) must be of type string, array given","Code":0,"Trace":[{"file":"/srv/nextcloud/apps/circles/lib/Service/ConfigService.php","line":504,"function":"parse_url"},{"file":"/srv/nextcloud/apps/circles/lib/Service/InterfaceService.php","line":434,"function":"getLoopbackInstance","class":"OCA\\Circles\\Service\\ConfigService","type":"->"},{"file":"/srv/nextcloud/apps/circles/lib/Model/ModelManager.php","line":498,"function":"getLocalInstance","class":"OCA\\Circles\\Service\\InterfaceService","type":"->"},{"file":"/srv/nextcloud/apps/circles/lib/Model/FederatedUser.php","line":250,"function":"getLocalInstance","class":"OCA\\Circles\\Model\\ModelManager","type":"->"},{"file":"/srv/nextcloud/apps/circles/lib/Model/FederatedUser.php","line":113,"function":"setInstance","class":"OCA\\Circles\\Model\\FederatedUser","type":"->"},{"file":"/srv/nextcloud/apps/circles/lib/Service/FederatedUserService.php","line":527,"function":"set","class":"OCA\\Circles\\Model\\FederatedUser","type":"->"},{"file":"/srv/nextcloud/apps/circles/lib/ShareByCircleProvider.php","line":553,"function":"getLocalFederatedUser","class":"OCA\\Circles\\Service\\FederatedUserService","type":"->"},{"file":"/srv/nextcloud/lib/private/Share20/Manager.php","line":1360,"function":"getSharedWith","class":"OCA\\Circles\\ShareByCircleProvider","type":"->"},{"file":"/srv/nextcloud/apps/files_sharing/lib/MountProvider.php","line":79,"function":"getSharedWith","class":"OC\\Share20\\Manager","type":"->"},{"file":"/srv/nextcloud/lib/private/Files/Config/MountProviderCollection.php","line":118,"function":"getMountsForUser","class":"OCA\\Files_Sharing\\MountProvider","type":"->"},{"file":"/srv/nextcloud/lib/private/Files/Filesystem.php","line":424,"function":"addMountForUser","class":"OC\\Files\\Config\\MountProviderCollection","type":"->"},{"file":"/srv/nextcloud/lib/private/Files/Filesystem.php","line":341,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/srv/nextcloud/lib/private/legacy/OC_Util.php","line":341,"function":"init","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/srv/nextcloud/lib/base.php","line":1031,"function":"setupFS","class":"OC_Util","type":"::"},{"file":"/srv/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/srv/nextcloud/apps/circles/lib/Service/ConfigService.php","Line":504,"CustomMessage":"--"}}

config.php

<?php
$CONFIG = array (
  'simpleSignUpLink.shown' => false,
  'trashbin_retention_obligation' => '30,60',
  'versions_retention_obligation' => 'auto',
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => 'briandulrich.com',
    1 => 'nextcloud.briandulrich.com',
  ),
  'datadirectory' => '/srv/nextcloud/data',
  'overwrite.cli.url' => 
  array (
    'https://nextcloud.<host>.com/' => '',
  ),
  'dbtype' => 'mysql',
  'version' => '22.2.10.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '***',
  'dbpassword' => '***',
  'logtimezone' => 'UTC',
  'installed' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'sendmail',
  'mail_domain' => '<host>.com',
  'mail_smtphost' => 'localhost',
  'mail_smtpport' => '25',
  'maintenance' => false,
  'appstore.experimental.enabled' => true,
#  "log_type" => "file",
#  "logfile" => "nextcloud.log",
#  "logdateformat" => "F d, Y H:i:s",
  'loglevel' => 3,
  'theme' => '',
  'mail_smtpauthtype' => 'LOGIN',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
    0 => 'test pilots',
  ),
  'updater.secret' => '***',
);

Let me know if there is other information that would be useful in troubleshooting this!

Well, solved my own problem (posting here in case it helps someone else):

I had noticed the odd array under 'overwrite.cli.url' in my config.php, but I hadn’t fixed it, since I knew it had been running like that for years. (If it ain’t broke, don’t fix it.)

However, as I was looking over the stack trace, I noticed something about an array when a string was expected. After reading the docs, I realized it didn’t make any sense.

I set overwrite.cli.url to my hostname, and it solved the problem. :slight_smile:

2 Likes

From:

To:

'overwrite.cli.url' => 'https://nextcloud.<host>.com/',

(or I presume)

Yep, that’s definitely not supposed to be an array. :slight_smile:

Good luck with the balance of your upgrades!