Not able to log in or sync after update

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:

I run Nextcloud on a Synology-NAS.
I updated from 20.0.11 to 21.0.3 a few days ago. As I was facing some problems, i updated PHP from 7.3 to 7.4 (fixed a problem with a missing module). I still got the problems described here and tried the fixes mentioned there, but it didn’t work. So I updated to 22.0.0 and now it’s broken. Using the webinterface, I get to the login page but after that I get 504 gateway time-out error. Syncing won’t work either.

Thanks for your help as I’m completely lost.

Nextcloud version (eg, 20.0.5): 22.0.0
Operating system and version (eg, Ubuntu 20.04): Synology DSM 6.2.4
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.43
PHP version (eg, 7.4): 7.4

The issue you are facing:
504 gateway time-out

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

Steps to replicate it:

  1. log in
  2. or try to sync

The output of your Nextcloud log in Admin > Logging:

{"reqId":"uGpS76b5W6dArlmi7Twk","level":3,"time":"2021-07-23T07:48:45+00:00","remoteAddr":"217.226.168.112","user":"frido","app":"core","method":"POST","url":"/index.php/login","message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","userAgent":"Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0","version":"22.0.0.11","exception":{"Exception":"Doctrine\\DBAL\\Exception","Message":"Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused","Code":2002,"Trace":[{"file":"/volume1/web/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1486,"function":"connect","class":"OC\\DB\\Connection","type":"->","args":[]},{"file":"/volume1/web/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1014,"function":"getWrappedConnection","class":"Doctrine\\DBAL\\Connection","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/DB/Connection.php","line":231,"function":"executeQuery","class":"Doctrine\\DBAL\\Connection","type":"->","args":["SELECT `id`, `numeric_id`, `available`, `last_checked` FROM `oc_storages` WHERE `id` = :dcValue1",{"dcValue1":"home::frido"},{"dcValue1":2},null]},{"file":"/volume1/web/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php","line":210,"function":"executeQuery","class":"OC\\DB\\Connection","type":"->","args":["SELECT `id`, `numeric_id`, `available`, `last_checked` FROM `oc_storages` WHERE `id` = :dcValue1",{"dcValue1":"home::frido"},{"dcValue1":2}]},{"file":"/volume1/web/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php","line":287,"function":"execute","class":"Doctrine\\DBAL\\Query\\QueryBuilder","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/Files/Cache/StorageGlobal.php","line":78,"function":"execute","class":"OC\\DB\\QueryBuilder\\QueryBuilder","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/Files/Cache/Storage.php","line":98,"function":"getStorageInfo","class":"OC\\Files\\Cache\\StorageGlobal","type":"->","args":["home::frido"]},{"file":"/volume1/web/nextcloud/lib/private/Files/Cache/Storage.php","line":76,"function":"getStorageById","class":"OC\\Files\\Cache\\Storage","type":"::","args":["home::frido"]},{"file":"/volume1/web/nextcloud/lib/private/Files/Cache/Cache.php","line":120,"function":"__construct","class":"OC\\Files\\Cache\\Storage","type":"->","args":[{"mountPoint":"/frido/","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\RansomwareProtection\\StorageWrapper"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/Storage/Home.php","line":70,"function":"__construct","class":"OC\\Files\\Cache\\Cache","type":"->","args":[{"mountPoint":"/frido/","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\RansomwareProtection\\StorageWrapper"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":395,"function":"getCache","class":"OC\\Files\\Storage\\Home","type":"->","args":["",{"mountPoint":"/frido/","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\RansomwareProtection\\StorageWrapper"}]},{"file":"/volume1/web/nextcloud/apps/ransomware_protection/lib/StorageWrapper.php","line":412,"function":"getCache","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["",{"mountPoint":"/frido/","cache":null,"scanner":null,"watcher":null,"propagator":null,"updater":null,"__class__":"OCA\\RansomwareProtection\\StorageWrapper"}]},{"file":"/volume1/web/nextcloud/lib/private/Files/Mount/MountPoint.php","line":276,"function":"getCache","class":"OCA\\RansomwareProtection\\StorageWrapper","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/Files/Filesystem.php","line":420,"function":"getStorageRootId","class":"OC\\Files\\Mount\\MountPoint","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/Files/Filesystem.php","line":354,"function":"initMountPoints","class":"OC\\Files\\Filesystem","type":"::","args":["frido"]},{"file":"/volume1/web/nextcloud/lib/private/legacy/OC_Util.php","line":325,"function":"init","class":"OC\\Files\\Filesystem","type":"::","args":["frido","/frido/files"]},{"file":"/volume1/web/nextcloud/lib/private/Files/Mount/Manager.php","line":91,"function":"setupFS","class":"OC_Util","type":"::","args":[]},{"file":"/volume1/web/nextcloud/lib/private/Files/View.php","line":1385,"function":"find","class":"OC\\Files\\Mount\\Manager","type":"->","args":["/appdata_ocm8kk9cd6q9/js/core"]},{"file":"/volume1/web/nextcloud/lib/private/Files/Node/Root.php","line":200,"function":"getFileInfo","class":"OC\\Files\\View","type":"->","args":["/appdata_ocm8kk9cd6q9/js/core"]},{"function":"get","class":"OC\\Files\\Node\\Root","type":"->","args":["/appdata_ocm8kk9cd6q9/js/core"]},{"file":"/volume1/web/nextcloud/lib/private/Files/Node/LazyFolder.php","line":65,"function":"call_user_func_array","args":[[{"__class__":"OC\\Files\\Node\\Root"},"get"],["appdata_ocm8kk9cd6q9/js/core"]]},{"file":"/volume1/web/nextcloud/lib/private/Files/Node/LazyFolder.php","line":142,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["get",["appdata_ocm8kk9cd6q9/js/core"]]},{"file":"/volume1/web/nextcloud/lib/private/Files/AppData/AppData.php","line":141,"function":"get","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["appdata_ocm8kk9cd6q9/js/core"]},{"file":"/volume1/web/nextcloud/lib/private/Template/JSCombiner.php","line":96,"function":"getFolder","class":"OC\\Files\\AppData\\AppData","type":"->","args":["core"]},{"file":"/volume1/web/nextcloud/lib/private/Template/JSResourceLocator.php","line":115,"function":"process","class":"OC\\Template\\JSCombiner","type":"->","args":["/volume1/web/nextcloud","core/js/merged-template-prepend.json","core"]},{"file":"/volume1/web/nextcloud/lib/private/Template/JSResourceLocator.php","line":71,"function":"cacheAndAppendCombineJsonIfExist","class":"OC\\Template\\JSResourceLocator","type":"->","args":["/volume1/web/nextcloud","core/js/merged-template-prepend.json"]},{"file":"/volume1/web/nextcloud/lib/private/Template/ResourceLocator.php","line":78,"function":"doFind","class":"OC\\Template\\JSResourceLocator","type":"->","args":["js/merged-template-prepend"]},{"file":"/volume1/web/nextcloud/lib/private/TemplateLayout.php","line":374,"function":"find","class":"OC\\Template\\ResourceLocator","type":"->","args":[["core/js/dist/main","js/dist/files_fileinfo","js/dist/files_client","js/merged-template-prepend","core/l10n/de","And 4 more entries, set log level to debug to see all entries"]]},{"file":"/volume1/web/nextcloud/lib/private/TemplateLayout.php","line":202,"function":"findJavascriptFiles","class":"OC\\TemplateLayout","type":"::","args":[["core/js/dist/main","js/dist/files_fileinfo","js/dist/files_client","js/merged-template-prepend","core/l10n/de","And 4 more entries, set log level to debug to see all entries"]]},{"file":"/volume1/web/nextcloud/lib/private/legacy/OC_Template.php","line":182,"function":"__construct","class":"OC\\TemplateLayout","type":"->","args":["error",""]},{"file":"/volume1/web/nextcloud/lib/private/Template/Base.php","line":132,"function":"fetchPage","class":"OC_Template","type":"->","args":[]},{"file":"/volume1/web/nextcloud/lib/private/legacy/OC_Template.php","line":331,"function":"printPage","class":"OC\\Template\\Base","type":"->","args":[]},{"file":"/volume1/web/nextcloud/index.php","line":74,"function":"printExceptionErrorPage","class":"OC_Template","type":"::","args":[{"__class__":"OC\\DB\\Exceptions\\DbalException"},500]}],"File":"/volume1/web/nextcloud/lib/private/DB/Connection.php","Line":87,"CustomMessage":"--"}}

{"reqId":"FT5wk3iIvkLgDIebcsXH","level":4,"time":"2021-07-23T01:06:45+00:00","remoteAddr":"217.226.168.112","user":"***","app":"webdav","method":"PROPFIND","url":"/remote.php/dav/calendars/***/","message":"OC\\DB\\Exceptions\\DbalException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","userAgent":"DAVx5/3.3.11-ose (2021/06/02; dav4jvm; okhttp/4.9.1) Android/11","version":"22.0.0.11","exception":{"Exception":"Sabre\\DAV\\Exception\\ServiceUnavailable","Message":"OC\\DB\\Exceptions\\DbalException: An exception occurred while executing a query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away","Code":0,"Trace":[{"file":"/volume1/web/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":182,"function":"check","class":"OCA\\DAV\\Connector\\Sabre\\Auth","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/volume1/web/nextcloud/3rdparty/sabre/dav/lib/DAV/Auth/Plugin.php","line":137,"function":"check","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/volume1/web/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeMethod","class":"Sabre\\DAV\\Auth\\Plugin","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/volume1/web/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":456,"function":"emit","class":"Sabre\\DAV\\Server","type":"->","args":["beforeMethod:PROPFIND",[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/volume1/web/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/volume1/web/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":321,"function":"start","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/volume1/web/nextcloud/remote.php","line":166,"args":["/volume1/web/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/volume1/web/nextcloud/apps/dav/lib/Connector/Sabre/Auth.php","Line":161,"CustomMessage":"--"}}

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

<?php
$CONFIG = array (
  'instanceid' => '***',
  'passwordsalt' => '***',
  'secret' => '***',
  'trusted_domains' => 
  array (
    0 => '***',
  ),
  'datadirectory' => '/volume1/nextcloud',
  'dbtype' => 'mysql',
  'version' => '22.0.0.11',
  'overwrite.cli.url' => '***',
  'dbname' => 'nextcloud',
  'dbhost' => '127.0.0.1:3307',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '***',
  'dbpassword' => '***',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
***
  'app_install_overwrite' => 
  array (
    0 => 'cookbook',
  ),
  'has_rebuilt_cache' => true,
  'maintenance' => false,
  'updater.secret' => '***',
  'loglevel' => 2,
  'theme' => '',
  'updater.release.channel' => 'stable',
);

After update i have had similar problems.
Perhaps delete the following line can solve your problem.
It is no risk to activate/deactivate Memcache APCu.

This seems to fix the “old” problem, but i’m still getting 504

Do you have occ-access? I got the message that maintenance is still on.
Perhaps you can deactivate maintenance and the test again upgrade with occ.

https://docs.nextcloud.com/server/latest/admin_manual/maintenance/upgrade.html#maintenance-mode

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html

maintenance mode was off. the manual upgrade said something like “already up to date…”