[Fixed] Nextcloud 20.0.1 Nginx error 504 Gateway Time-out

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, 18.0.2): 20.0.1
Operating system and version (eg, Ubuntu 20.04): 20.04
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.18.0
PHP version (eg, 7.1): 7.3

The issue you are facing:

Today my nextcloud starting to give me this error when trying to access from anywhere, i get a 504 page and doesnt let me do anything.

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

Steps to replicate it:

  1. Access to nextcloud page i get 504
  2. Turn on maintnance mode and restart php service allows me to access the nextcloud maintnance page
  3. if i disable maintnance mode and refresh, i get again 504 bad gateway until i set it to maintnance mode again and restart php service

The output of your Nextcloud log in Admin > Logging: Cant access to the admin page

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

<?php
$CONFIG = array (
  'passwordsalt' => '***SENSITIVE***',
  'secret' => '***SENSITIVE***',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    2 => 'ubuntu-mysite',
    1 => 'nextcloud.mysite.com',
  ),
  'datadirectory' => '/usr/share/nginx/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '19.0.4.2',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '***SENSITIVE***',
  'installed' => true,
  'instanceid' => '***SENSITIVE***',
  'integrity.check.disabled' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'skeletondirectory' => '',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updater.secret' => '***SENSITIVE***',
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'updater.release.channel' => 'stable',
);

The output of your Apache/nginx/system log in /var/log/____: which one do i need to post?

-rw-r----- 1 www-data adm 3876107 Dec 11 14:42 access.log
-rw-r----- 1 www-data adm 18096614 Dec 11 06:24 access.log.1
-rw-r----- 1 www-data adm 728062 Dec 2 06:25 access.log.10.gz
-rw-r----- 1 www-data adm 593547 Dec 1 06:25 access.log.11.gz
-rw-r----- 1 www-data adm 133119 Nov 30 06:03 access.log.12.gz
-rw-r----- 1 www-data adm 136388 Nov 29 06:24 access.log.13.gz
-rw-r----- 1 www-data adm 534714 Nov 28 06:24 access.log.14.gz
-rw-r----- 1 www-data adm 847213 Dec 10 06:01 access.log.2.gz
-rw-r----- 1 www-data adm 715962 Dec 9 06:24 access.log.3.gz
-rw-r----- 1 www-data adm 493445 Dec 8 06:24 access.log.4.gz
-rw-r----- 1 www-data adm 124496 Dec 7 06:24 access.log.5.gz
-rw-r----- 1 www-data adm 237633 Dec 6 06:24 access.log.6.gz
-rw-r----- 1 www-data adm 528849 Dec 5 06:25 access.log.7.gz
-rw-r----- 1 www-data adm 1138533 Dec 4 06:24 access.log.8.gz
-rw-r----- 1 www-data adm 811448 Dec 3 06:24 access.log.9.gz
-rw-r----- 1 www-data adm 1482079 Dec 11 14:41 error.log
-rw-r----- 1 www-data adm 164038 Dec 11 06:22 error.log.1
-rw-r----- 1 www-data adm 644 Dec 2 04:51 error.log.10.gz
-rw-r----- 1 www-data adm 658 Dec 1 06:25 error.log.11.gz
-rw-r----- 1 www-data adm 580 Nov 29 23:37 error.log.12.gz
-rw-r----- 1 www-data adm 615 Nov 29 06:25 error.log.13.gz
-rw-r----- 1 www-data adm 675 Nov 28 06:25 error.log.14.gz
-rw-r----- 1 www-data adm 651 Dec 10 06:09 error.log.2.gz
-rw-r----- 1 www-data adm 722 Dec 9 06:25 error.log.3.gz
-rw-r----- 1 www-data adm 1116 Dec 8 02:39 error.log.4.gz
-rw-r----- 1 www-data adm 1006 Dec 7 06:25 error.log.5.gz
-rw-r----- 1 www-data adm 701 Dec 6 05:09 error.log.6.gz
-rw-r----- 1 www-data adm 741 Dec 5 05:57 error.log.7.gz
-rw-r----- 1 www-data adm 578 Dec 3 22:39 error.log.8.gz
-rw-r----- 1 www-data adm 793 Dec 3 04:19 error.log.9.gz

Found the solution, since i have my nextcloud doing active directory authentication, the addon was giving me an error cause it wasnt able to comunicate with the active directory server, the reason of this is that for some reason that im still wondering, my server dns was reporting the wrong address in my ubuntu server, what i did was change the name of the server and instead of using the dns address i used the ip address and all was good again :slight_smile: