Nextcloud-Snap "Connection Refused"

Nextcloud version: Snap 26119
Operating system and version: Ubuntu 20.04.2 LTS
Apache or nginx version: Snap 26119
PHP version: Snap 26119

The issue you are facing:

Both the client (both Mac and iOS) and the web interface (Mac, iOS, and even wget 127.0.0.1 over an SSH connection to the server) are returning failed: Connection refused:

$ wget http://127.0.0.1
--2021-08-11--  http://127.0.0.1/
Connecting to 127.0.0.1:80... failed: Connection refused.
$ wget https://127.0.0.1/
--2021-08-11--  https://127.0.0.1/
Connecting to 127.0.0.1:443... failed: Connection refused.
$ wget 104.131.77.207
--2021-08-11--  http://104.131.77.207/
Connecting to 104.131.77.207:80... failed: Connection refused.

I’ve had Nextcloud-Snap up and running for almost a year, basically without incident, and this is the first time this has happened.

The only thing out of the ordinary is that the server was running low on space because it had like 10 gigabytes of log files, which I deleted after running into this problem. I also got an email from Let’s Encrypt confirming that my server’s TLS certificate had been renewed, but this was after the problem started. It’s also worth noting that I’ve been running into performance issues with both the server and the client for some time now, which I’ve detailed over on the desktop client issue tracker.

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

Steps to replicate it:

  1. As far as I can tell this just happened spontaneously, out of the blue.
  2. Go to https://cloud.elsiehupp.com/ in your browser and see what happens
  3. Try wget or curl from a different location to see that it’s not just your local network.

The output of your Nextcloud log in Admin > Logging:

I don’t have access to the web interface.

Excerpt from ~/Library/Preferences/Nextcloud/Nextcloud_sync.log:

Show/Hide
2021-07-28 17:00:35:774 [ warning nextcloud.sync.networkjob ]:    QNetworkReply::ConnectionRefusedError "Connection refused" QVariant(Invalid)
2021-07-28 17:00:35:774 [ warning nextcloud.sync.credentials.webflow ]:    QNetworkReply::ConnectionRefusedError
2021-07-28 17:00:35:774 [ warning nextcloud.sync.credentials.webflow ]:    "Connection refused"
2021-07-28 17:00:35:774 [ warning nextcloud.sync.networkjob.checkserver ]:    error: status.php replied  0 ""
2021-07-28 17:00:35:774 [ warning nextcloud.sync.connectionvalidator ]:    QNetworkReply::ConnectionRefusedError "Connection refused" ""
2021-07-28 17:00:35:775 [ warning nextcloud.sync.credentials.webflow ]:    QNetworkReply::ConnectionRefusedError
2021-07-28 17:00:35:775 [ warning nextcloud.sync.credentials.webflow ]:    "Connection refused"

Excerpt from /var/snap/nextcloud/26119/nextcloud/config/config.php:

Show/Hide
$ cat /var/snap/nextcloud/26119/nextcloud/config/config.php
<?php
$CONFIG = array (
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/snap/nextcloud/current/htdocs/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/snap/nextcloud/current/nextcloud/extra-apps',
      'url' => '/extra-apps',
      'writable' => true,
    ),
  ),
  'supportedDatabases' => 
  array (
    0 => 'mysql',
  ),
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/tmp/sockets/redis.sock',
    'port' => 0,
  ),
  'passwordsalt' => '<redacted>',
  'secret' => '<redacted>',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'cloud.elsiehupp.com',
    2 => '10.108.0.4',
  ),
  'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:/tmp/sockets/mysql.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '<redacted>',
  'installed' => true,
  'instanceid' => '<redacted>',
  'maintenance' => false,
  'objectstore' => 
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => '<redacted>',
      'key' => '<redacted>',
      'secret' => '<redacted>',
      'hostname' => '<redacted>.digitaloceanspaces.com',
      'region' => '<redacted>',
      'port' => 443,
      'use_ssl' => true,
      'use_path_style' => true,
    ),
  ),
  'theme' => '',
  'loglevel' => 0,
);

Excerpt from /var/log/syslog

Show/Hide
Aug 11 13:43:18 cloud nextcloud.apache[2611543]: Making sure nextcloud is setup...
Aug 11 13:43:18 cloud nextcloud.apache[2611683]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:18 cloud nextcloud.apache[2611683]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:18 cloud nextcloud.apache[2611683]: System config value redis => host set to string /tmp/sockets/redis.sock
Aug 11 13:43:18 cloud nextcloud.apache[2611755]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:18 cloud nextcloud.apache[2611755]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:18 cloud nextcloud.apache[2611755]: System config value redis => port set to integer 0
Aug 11 13:43:19 cloud nextcloud.apache[2611825]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:19 cloud nextcloud.apache[2611825]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:19 cloud nextcloud.apache[2611825]: System config value memcache.locking set to string \OC\Memcache\Redis
Aug 11 13:43:19 cloud nextcloud.apache[2611895]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:19 cloud nextcloud.apache[2611895]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:19 cloud nextcloud.apache[2611895]: System config value memcache.local set to string \OC\Memcache\Redis
Aug 11 13:43:19 cloud nextcloud.apache[2611967]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:19 cloud nextcloud.apache[2611967]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:19 cloud nextcloud.apache[2611967]: No such app enabled: updatenotification
Aug 11 13:43:19 cloud nextcloud.apache[2611571]: Making sure nextcloud is fully upgraded...
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Setting log level to debug
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Turned on maintenance mode
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Updating database schema
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Updated database
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Updating <duplicatefinder> ...
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE INDEX duplicatefinder_path_idx ON oc_duplicatefinder_finfo (path)':
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Update failed
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Maintenance mode is kept active
Aug 11 13:43:20 cloud nextcloud.apache[2612109]: Resetting log level
Aug 11 13:43:20 cloud nextcloud.apache[2611571]: Unable to upgrade Nextcloud. Will try again.
Aug 11 13:43:20 cloud nextcloud.apache[2611571]: Disabling maintenance mode...
Aug 11 13:43:21 cloud nextcloud.apache[2611571]: done
Aug 11 13:43:33 cloud nextcloud.apache[2611543]: Failed to setup nextcloud
Aug 11 13:43:33 cloud systemd[1]: snap.nextcloud.apache.service: Main process exited, code=exited, status=1/FAILURE
Aug 11 13:43:33 cloud systemd[1]: snap.nextcloud.apache.service: Failed with result 'exit-code'.
Aug 11 13:43:33 cloud systemd[1]: snap.nextcloud.apache.service: Scheduled restart job, restart counter is at 12881.
Aug 11 13:43:33 cloud systemd[1]: Stopped Service for snap application nextcloud.apache.
Aug 11 13:43:33 cloud systemd[1]: Started Service for snap application nextcloud.apache.
Aug 11 13:43:33 cloud nextcloud.apache[2612231]: Making sure nextcloud is setup...
Aug 11 13:43:33 cloud nextcloud.apache[2612374]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:33 cloud nextcloud.apache[2612374]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:33 cloud nextcloud.apache[2612374]: System config value redis => host set to string /tmp/sockets/redis.sock
Aug 11 13:43:34 cloud nextcloud.apache[2612444]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:34 cloud nextcloud.apache[2612444]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:34 cloud nextcloud.apache[2612444]: System config value redis => port set to integer 0
Aug 11 13:43:34 cloud nextcloud.apache[2612515]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:34 cloud nextcloud.apache[2612515]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:34 cloud nextcloud.apache[2612515]: System config value memcache.locking set to string \OC\Memcache\Redis
Aug 11 13:43:34 cloud nextcloud.apache[2612585]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:34 cloud nextcloud.apache[2612585]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:34 cloud nextcloud.apache[2612585]: System config value memcache.local set to string \OC\Memcache\Redis
Aug 11 13:43:34 cloud nextcloud.apache[2612656]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:34 cloud nextcloud.apache[2612656]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:34 cloud nextcloud.apache[2612656]: No such app enabled: updatenotification
Aug 11 13:43:35 cloud nextcloud.apache[2612259]: Making sure nextcloud is fully upgraded...
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Setting log level to debug
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Turned on maintenance mode
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Updating database schema
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Updated database
Aug 11 13:43:35 cloud nextcloud.apache[2612799]: Updating <duplicatefinder> ...
Aug 11 13:43:36 cloud nextcloud.apache[2612799]: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE INDEX duplicatefinder_path_idx ON oc_duplicatefinder_finfo (path)':
Aug 11 13:43:36 cloud nextcloud.apache[2612799]: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
Aug 11 13:43:36 cloud nextcloud.apache[2612799]: Update failed
Aug 11 13:43:36 cloud nextcloud.apache[2612799]: Maintenance mode is kept active
Aug 11 13:43:36 cloud nextcloud.apache[2612799]: Resetting log level
Aug 11 13:43:36 cloud nextcloud.apache[2612259]: Unable to upgrade Nextcloud. Will try again.
Aug 11 13:43:36 cloud nextcloud.apache[2612259]: Disabling maintenance mode...
Aug 11 13:43:36 cloud nextcloud.apache[2612259]: done
Aug 11 13:43:41 cloud kernel: [197899.291691] [UFW BLOCK] IN=eth0 OUT= MAC=b2:79:f0:ff:44:a8:fe:00:00:00:01:01:08:00 SRC=109.248.6.9 DST=104.131.77.207 LEN=44 TOS=0x00 PREC=0x00 TTL=71 ID=49909 PROTO=TCP SPT=51338 DPT=8888 WINDOW=1024 RES=0x00 SYN URGP=0 
Aug 11 13:43:48 cloud nextcloud.apache[2612231]: Failed to setup nextcloud
Aug 11 13:43:48 cloud systemd[1]: snap.nextcloud.apache.service: Main process exited, code=exited, status=1/FAILURE
Aug 11 13:43:48 cloud systemd[1]: snap.nextcloud.apache.service: Failed with result 'exit-code'.
Aug 11 13:43:48 cloud systemd[1]: snap.nextcloud.apache.service: Scheduled restart job, restart counter is at 12882.
Aug 11 13:43:48 cloud systemd[1]: Stopped Service for snap application nextcloud.apache.
Aug 11 13:43:48 cloud systemd[1]: Started Service for snap application nextcloud.apache.
Aug 11 13:43:48 cloud nextcloud.apache[2612912]: Making sure nextcloud is setup...
Aug 11 13:43:49 cloud nextcloud.apache[2613053]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:49 cloud nextcloud.apache[2613053]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:49 cloud nextcloud.apache[2613053]: System config value redis => host set to string /tmp/sockets/redis.sock
Aug 11 13:43:49 cloud nextcloud.apache[2613123]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:49 cloud nextcloud.apache[2613123]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:49 cloud nextcloud.apache[2613123]: System config value redis => port set to integer 0
Aug 11 13:43:49 cloud nextcloud.apache[2613193]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:49 cloud nextcloud.apache[2613193]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:49 cloud nextcloud.apache[2613193]: System config value memcache.locking set to string \OC\Memcache\Redis
Aug 11 13:43:49 cloud nextcloud.apache[2613265]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:49 cloud nextcloud.apache[2613265]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:49 cloud nextcloud.apache[2613265]: System config value memcache.local set to string \OC\Memcache\Redis
Aug 11 13:43:50 cloud nextcloud.apache[2613335]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:50 cloud nextcloud.apache[2613335]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:50 cloud nextcloud.apache[2613335]: No such app enabled: updatenotification
Aug 11 13:43:50 cloud nextcloud.apache[2612940]: Making sure nextcloud is fully upgraded...
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Setting log level to debug
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Turned on maintenance mode
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Updating database schema
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Updated database
Aug 11 13:43:50 cloud nextcloud.apache[2613480]: Updating <duplicatefinder> ...
Aug 11 13:43:51 cloud nextcloud.apache[2613480]: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE INDEX duplicatefinder_path_idx ON oc_duplicatefinder_finfo (path)':
Aug 11 13:43:51 cloud nextcloud.apache[2613480]: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
Aug 11 13:43:51 cloud nextcloud.apache[2613480]: Update failed
Aug 11 13:43:51 cloud nextcloud.apache[2613480]: Maintenance mode is kept active
Aug 11 13:43:51 cloud nextcloud.apache[2613480]: Resetting log level
Aug 11 13:43:51 cloud nextcloud.apache[2612940]: Unable to upgrade Nextcloud. Will try again.
Aug 11 13:43:51 cloud nextcloud.apache[2612940]: Disabling maintenance mode...
Aug 11 13:43:51 cloud nextcloud.apache[2612940]: done
Aug 11 13:44:03 cloud nextcloud.apache[2612912]: Failed to setup nextcloud
Aug 11 13:44:03 cloud systemd[1]: snap.nextcloud.apache.service: Main process exited, code=exited, status=1/FAILURE
Aug 11 13:44:03 cloud systemd[1]: snap.nextcloud.apache.service: Failed with result 'exit-code'.
Aug 11 13:44:03 cloud systemd[1]: snap.nextcloud.apache.service: Scheduled restart job, restart counter is at 12883.
Aug 11 13:44:03 cloud systemd[1]: Stopped Service for snap application nextcloud.apache.
Aug 11 13:44:03 cloud systemd[1]: Started Service for snap application nextcloud.apache.
Aug 11 13:44:03 cloud nextcloud.apache[2613597]: Making sure nextcloud is setup...
Aug 11 13:44:04 cloud nextcloud.apache[2613737]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:04 cloud nextcloud.apache[2613737]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:04 cloud nextcloud.apache[2613737]: System config value redis => host set to string /tmp/sockets/redis.sock
Aug 11 13:44:04 cloud nextcloud.apache[2613807]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:04 cloud nextcloud.apache[2613807]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:04 cloud nextcloud.apache[2613807]: System config value redis => port set to integer 0
Aug 11 13:44:04 cloud nextcloud.apache[2613879]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:04 cloud nextcloud.apache[2613879]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:04 cloud nextcloud.apache[2613879]: System config value memcache.locking set to string \OC\Memcache\Redis
Aug 11 13:44:05 cloud nextcloud.apache[2613948]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:05 cloud nextcloud.apache[2613948]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:05 cloud nextcloud.apache[2613948]: System config value memcache.local set to string \OC\Memcache\Redis
Aug 11 13:44:05 cloud nextcloud.apache[2614017]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:05 cloud nextcloud.apache[2614017]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:05 cloud nextcloud.apache[2614017]: No such app enabled: updatenotification
Aug 11 13:44:05 cloud nextcloud.apache[2613625]: Making sure nextcloud is fully upgraded...
Aug 11 13:44:05 cloud nextcloud.apache[2614160]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:05 cloud nextcloud.apache[2614160]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:05 cloud nextcloud.apache[2614160]: Setting log level to debug
Aug 11 13:44:05 cloud nextcloud.apache[2614160]: Turned on maintenance mode
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Updating database schema
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Updated database
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Updating <duplicatefinder> ...
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE INDEX duplicatefinder_path_idx ON oc_duplicatefinder_finfo (path)':
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Update failed
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Maintenance mode is kept active
Aug 11 13:44:06 cloud nextcloud.apache[2614160]: Resetting log level
Aug 11 13:44:06 cloud nextcloud.apache[2613625]: Unable to upgrade Nextcloud. Will try again.
Aug 11 13:44:06 cloud nextcloud.apache[2613625]: Disabling maintenance mode...
Aug 11 13:44:07 cloud nextcloud.apache[2613625]: done
Aug 11 13:44:19 cloud nextcloud.apache[2613597]: Failed to setup nextcloud
Aug 11 13:44:19 cloud systemd[1]: snap.nextcloud.apache.service: Main process exited, code=exited, status=1/FAILURE
Aug 11 13:44:19 cloud systemd[1]: snap.nextcloud.apache.service: Failed with result 'exit-code'.
Aug 11 13:44:19 cloud systemd[1]: snap.nextcloud.apache.service: Scheduled restart job, restart counter is at 12884.
Aug 11 13:44:19 cloud systemd[1]: Stopped Service for snap application nextcloud.apache.
Aug 11 13:44:19 cloud systemd[1]: Started Service for snap application nextcloud.apache.
Aug 11 13:44:19 cloud nextcloud.apache[2614278]: Making sure nextcloud is setup...
Aug 11 13:44:19 cloud nextcloud.apache[2614423]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:19 cloud nextcloud.apache[2614423]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:19 cloud nextcloud.apache[2614423]: System config value redis => host set to string /tmp/sockets/redis.sock
Aug 11 13:44:20 cloud nextcloud.apache[2614493]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:20 cloud nextcloud.apache[2614493]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:20 cloud nextcloud.apache[2614493]: System config value redis => port set to integer 0
Aug 11 13:44:20 cloud nextcloud.apache[2614563]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:20 cloud nextcloud.apache[2614563]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:20 cloud nextcloud.apache[2614563]: System config value memcache.locking set to string \OC\Memcache\Redis
Aug 11 13:44:20 cloud nextcloud.apache[2614633]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:20 cloud nextcloud.apache[2614633]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:20 cloud nextcloud.apache[2614633]: System config value memcache.local set to string \OC\Memcache\Redis
Aug 11 13:44:20 cloud nextcloud.apache[2614705]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:20 cloud nextcloud.apache[2614705]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:20 cloud nextcloud.apache[2614705]: No such app enabled: updatenotification
Aug 11 13:44:21 cloud nextcloud.apache[2614308]: Making sure nextcloud is fully upgraded...
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Nextcloud or one of the apps require upgrade - only a limited number of commands are available
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: You may use your browser or the occ upgrade command to do the upgrade
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Setting log level to debug
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Turned on maintenance mode
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Updating database schema
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Updated database
Aug 11 13:44:21 cloud nextcloud.apache[2614846]: Updating <duplicatefinder> ...
Aug 11 13:44:22 cloud kernel: [197939.606519] [UFW BLOCK] IN=eth0 OUT= MAC=b2:79:f0:ff:44:a8:fe:00:00:00:01:01:08:00 SRC=104.206.128.26 DST=104.131.77.207 LEN=44 TOS=0x00 PREC=0x00 TTL=244 ID=23888 PROTO=TCP SPT=64303 DPT=990 WINDOW=1024 RES=0x00 SYN URGP=0 
Aug 11 13:44:22 cloud nextcloud.apache[2614846]: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE INDEX duplicatefinder_path_idx ON oc_duplicatefinder_finfo (path)':
Aug 11 13:44:22 cloud nextcloud.apache[2614846]: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
Aug 11 13:44:22 cloud nextcloud.apache[2614846]: Update failed
Aug 11 13:44:22 cloud nextcloud.apache[2614846]: Maintenance mode is kept active
Aug 11 13:44:22 cloud nextcloud.apache[2614846]: Resetting log level
Aug 11 13:44:22 cloud nextcloud.apache[2614308]: Unable to upgrade Nextcloud. Will try again.
Aug 11 13:44:22 cloud nextcloud.apache[2614308]: Disabling maintenance mode...
Aug 11 13:44:22 cloud nextcloud.apache[2614308]: done

Excerpt from /var/snap/nextcloud/26119/logs/mysql_errors.log:

Show/Hide

root@cloud# cat /var/snap/nextcloud/26119/logs/mysql_errors.log
2021-08-09T06:43:37.533404Z mysqld_safe mysqld from pid file /tmp/pids/mysql.pid ended
2021-08-09T06:45:37.223761Z mysqld_safe Logging to ‘/var/snap/nextcloud/26119/mysql/…/logs/mysql_errors.log’.
2021-08-09T06:45:37.464026Z mysqld_safe Starting mysqld daemon with databases from /var/snap/nextcloud/26119/mysql
2021-08-09T06:45:38.635141Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-08-09T06:45:38.635260Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2021-08-09T06:45:38.635291Z 0 [Note] /snap/nextcloud/26119/bin/mysqld (mysqld 5.7.33) starting as process 2008 …
2021-08-09T06:45:38.696511Z 0 [Note] InnoDB: PUNCH HOLE support available
2021-08-09T06:45:38.696571Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-08-09T06:45:38.696578Z 0 [Note] InnoDB: Uses event mutexes
2021-08-09T06:45:38.696583Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2021-08-09T06:45:38.696589Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2021-08-09T06:45:38.696594Z 0 [Note] InnoDB: Using Linux native AIO
2021-08-09T06:45:38.733103Z 0 [Note] InnoDB: Number of pools: 1
2021-08-09T06:45:38.848094Z 0 [Note] InnoDB: Using CPU crc32 instructions
2021-08-09T06:45:38.870186Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2021-08-09T06:45:38.978225Z 0 [Note] InnoDB: Completed initialization of buffer pool
2021-08-09T06:45:39.216170Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2021-08-09T06:45:39.359345Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-08-09T06:45:39.359451Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2021-08-09T06:45:39.460681Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2021-08-09T06:45:39.461617Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2021-08-09T06:45:39.461637Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2021-08-09T06:45:39.462090Z 0 [Note] InnoDB: Waiting for purge to start
2021-08-09T06:45:39.512465Z 0 [Note] InnoDB: 5.7.33 started; log sequence number 42696257626
2021-08-09T06:45:39.513480Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/snap/nextcloud/26119/mysql/ib_buffer_pool
2021-08-09T06:45:39.680853Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2021-08-09T06:45:39.680903Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2021-08-09T06:45:39.690380Z 0 [Warning] CA certificate ca.pem is self signed.
2021-08-09T06:45:39.690460Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2021-08-09T06:45:39.696106Z 0 [Warning] Insecure configuration for --pid-file: Location ‘/tmp’ in the path is accessible to all OS users. Consider choosing a different directory.
2021-08-09T06:45:39.736319Z 0 [Note] InnoDB: Buffer pool(s) load completed at 210809 6:45:39
2021-08-09T06:45:39.796584Z 0 [Note] Event Scheduler: Loaded 0 events
2021-08-09T06:45:39.796886Z 0 [Note] /snap/nextcloud/26119/bin/mysqld: ready for connections.
Version: ‘5.7.33’ socket: ‘/tmp/sockets/mysql.sock’ port: 0 MySQL Community Server (GPL)

Excerpt from /var/snap/nextcloud/26119/logs/php-fpm_errors.log:

Show/Hide

root@cloud# cat /var/snap/nextcloud/26119/logs/php-fpm_errors.log
[09-Aug-2021 06:45:42] NOTICE: fpm is running, pid 2560
[09-Aug-2021 06:45:42] NOTICE: ready to handle connections

Excerpt from /var/snap/nextcloud/26119/logs/redis.log:

Show/Hide

root@cloud# cat /var/snap/nextcloud/26119/logs/redis.log
1173:M 11 Aug 2021 13:36:30.040 * 10 changes in 300 seconds. Saving…
1173:M 11 Aug 2021 13:36:30.041 * Background saving started by pid 2582839
2582839:C 11 Aug 2021 13:36:30.208 * DB saved on disk
2582839:C 11 Aug 2021 13:36:30.209 * RDB: 0 MB of memory used by copy-on-write
1173:M 11 Aug 2021 13:36:30.242 * Background saving terminated with success
1173:M 11 Aug 2021 13:41:31.046 * 10 changes in 300 seconds. Saving…
1173:M 11 Aug 2021 13:41:31.047 * Background saving started by pid 2607015
2607015:C 11 Aug 2021 13:41:31.218 * DB saved on disk
2607015:C 11 Aug 2021 13:41:31.218 * RDB: 0 MB of memory used by copy-on-write
1173:M 11 Aug 2021 13:41:31.248 * Background saving terminated with success
1173:M 11 Aug 2021 13:46:32.071 * 10 changes in 300 seconds. Saving…
1173:M 11 Aug 2021 13:46:32.072 * Background saving started by pid 2630252
2630252:C 11 Aug 2021 13:46:32.244 * DB saved on disk
2630252:C 11 Aug 2021 13:46:32.244 * RDB: 0 MB of memory used by copy-on-write
1173:M 11 Aug 2021 13:46:32.273 * Background saving terminated with success
1173:M 11 Aug 2021 13:51:33.066 * 10 changes in 300 seconds. Saving…
1173:M 11 Aug 2021 13:51:33.067 * Background saving started by pid 2654138
2654138:C 11 Aug 2021 13:51:33.262 * DB saved on disk
2654138:C 11 Aug 2021 13:51:33.263 * RDB: 0 MB of memory used by copy-on-write
1173:M 11 Aug 2021 13:51:33.268 * Background saving terminated with success

I cross-posted this to the nextcloud-snap Issue tracker, and it turned out that the problem was with an app called duplicatefinder. Disabling the app with the following command resolved the problem for the time being:

$ sudo nextcloud.occ occ app:disable duplicatefinder

…though, obviously, disabling the app means I can’t use it.

I linked back to the first Issue from a related Issue on the duplicatefinder Issue tracker, so hopefully the bug gets fixed before too long.

I had the same problem.

Run sudo nextcloud.occ maintenance:repair
Try accessing the page again or run sudo nextcloud.occ upgrade.
If the maintenance page keep visible, run sudo nextcloud.occ maintenance:mode --off.

I would suggest to reboot the server after each step but it may be it voodoo.

How can I execute this command?

I get this error message: nextcloud.occ: command not found
I have found another way to use this command in the nextcloud documentation (Using the occ command — Nextcloud latest Administration Manual latest documentation). But with this command its not possble to disbale the duplicatefinder because it doesnt exists.