Error 504 Gateway timeout when creating Admin account

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: 23.0.4.1
Operating system and version Unraid 6.10.0 Rc4
Apache or nginx version nginx (MariaDB 10.7.3)
PHP version (eg, 7.4): Uncertain

The issue you are facing:

When I launch the WebUi and attempt to make an admin account the page loads until it eventually pops up with an Error 504 Gateway timed out. The error comes up after loading in my information to configure the database. I am selecting mysql/mariadb, putting in my correct information and hitting install. Then every time i receive the same 504 error. Once I accidentally just selected SQLlite and it loaded right up. So i am pretty sure I am having some sort of error with MariaDB. I have uninstalled and reinstalled MariaDB multiple times to include the official and linuxserver containers from the Unraid apps tab. Both yield the same result. I followed Spaceinvaders nextcloud setup video to a ‘T’. I even went back through and tried it again. So I am pretty sure I did not just make a simple error.

Steps to try and fix it myself:

  1. Uninstalled and re-installed MariaDB, making sure I deleted the folders so the settings would not be automatically reapplied.
  2. uninstalled and reinstalled Nextcloud, making sure I deleted the folders so the settings would not be automatically reapplied.
  3. Completely deleted my shares, pools, and docker from Unraid Flash drive to ensure clean reinstall.
    4.Ensure my password and username was correct from MariaDB setup. Even changed the password to make sure that wasn’t the issue.
  4. I tried just bypassing the admin account creating through the WebUi by just opening the config and editing MariaDB and the user account but that just returned another error.

Extra Backstory:
I had Nextcloud working fine through mariaDB until recently when I switched routers (had external access through reverse proxy working). I couldn’t get the reverse proxy working again so i figured I would start from scratch and re-upload my Nextcloud Data. That is how I am where I am now.

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

Steps to replicate it:

  1. Clean install MariaDB and Nextcloud
  2. Launch WebUI
  3. Attempt to make Admin account using MariaDB to configure the database

The output of your Nextcloud log in Admin > Logging:

User gid:    100
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
using keys found in /config/keys
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 40-config: executing... 
[cont-init.d] 40-config: exited 0.
[cont-init.d] 50-install: executing... 
[cont-init.d] 50-install: exited 0.
[cont-init.d] 60-memcache: executing... 
[cont-init.d] 60-memcache: exited 0.
[cont-init.d] 70-aliases: executing... 
[cont-init.d] 70-aliases: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}
Exception: Not installed in /config/www/nextcloud/lib/base.php:277
Stack trace:
#0 /config/www/nextcloud/lib/base.php(649): OC::checkInstalled()
#1 /config/www/nextcloud/lib/base.php(1089): OC::init()
#2 /config/www/nextcloud/cron.php(43): require_once('/config/www/nex...')
#3 {main}

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

<?php
$CONFIG = array (
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'datadirectory' => '/data',
  'instanceid' => 'ocfnsmemh4qh',
  'passwordsalt' => 'La1iWPJklKA4ZtC6BjNYtfcJkpnSMG',
  'secret' => 'N+r1FKwC9ifiQUreLokD+pdPS+7QYnCBpNlC3reU/BX0GLYo',
  'trusted_domains' => 
  array (
    0 => '172.20.2.200:444',
  ),
  'dbtype' => 'mysql',
  'version' => '23.0.4.1',
  'overwrite.cli.url' => 'https://172.20.2.200:444',
  'dbname' => 'nextcloud',
  'dbhost' => '172.20.2.200:444',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
);

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

2022-04-28 15:48:53 0 [Note] InnoDB: Number of transaction pools: 1
2022-04-28 15:48:53 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-04-28 15:48:53 0 [Note] InnoDB: Using Linux native AIO
2022-04-28 15:48:53 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-04-28 15:48:53 0 [Note] InnoDB: Completed initialization of buffer pool
2022-04-28 15:48:53 0 [Note] InnoDB: 128 rollback segments are active.
2022-04-28 15:48:53 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-04-28 15:48:53 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-04-28 15:48:53 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-04-28 15:48:53 0 [Note] InnoDB: 10.7.3 started; log sequence number 42185; transaction id 14
2022-04-28 15:48:53 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-04-28 15:48:53 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-04-28 15:48:53 0 [Note] InnoDB: Buffer pool(s) load completed at 220428 15:48:53
2022-04-28 15:48:53 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-04-28 15:48:53 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-04-28 15:48:53 0 [Note] Server socket created on IP: '::'.
2022-04-28 15:48:53 0 [Note] mariadbd: ready for connections.
Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2022-04-28 15:52:06 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
2022-04-28 15:52:06 0 [Note] InnoDB: FTS optimize thread exiting.
2022-04-28 15:52:06 0 [Note] InnoDB: Starting shutdown...
2022-04-28 15:52:06 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-04-28 15:52:06 0 [Note] InnoDB: Buffer pool(s) dump completed at 220428 15:52:06
2022-04-28 15:52:06 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-04-28 15:52:06 0 [Note] InnoDB: Shutdown completed; log sequence number 42341; transaction id 15
2022-04-28 15:52:06 0 [Note] mariadbd: Shutdown complete

2022-04-28 16:53:22-07:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
2022-04-28 16:53:22-07:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-04-28 16:53:22 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 1 ...
2022-04-28 16:53:22 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-04-28 16:53:22 0 [Note] InnoDB: Number of transaction pools: 1
2022-04-28 16:53:22 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-04-28 16:53:22 0 [Note] InnoDB: Using Linux native AIO
2022-04-28 16:53:22 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-04-28 16:53:22 0 [Note] InnoDB: Completed initialization of buffer pool
2022-04-28 16:53:22 0 [Note] InnoDB: 128 rollback segments are active.
2022-04-28 16:53:22 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-04-28 16:53:22 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-04-28 16:53:22 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-04-28 16:53:22 0 [Note] InnoDB: 10.7.3 started; log sequence number 42341; transaction id 14
2022-04-28 16:53:22 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-04-28 16:53:22 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-04-28 16:53:22 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-04-28 16:53:22 0 [Note] InnoDB: Buffer pool(s) load completed at 220428 16:53:22
2022-04-28 16:53:22 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-04-28 16:53:22 0 [Note] Server socket created on IP: '::'.
2022-04-28 16:53:22 0 [Note] mariadbd: ready for connections.
Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2022-04-29  3:17:43 0 [Note] mariadbd (initiated by: unknown): Normal shutdown
2022-04-29  3:17:43 0 [Note] InnoDB: FTS optimize thread exiting.
2022-04-29  3:17:43 0 [Note] InnoDB: Starting shutdown...
2022-04-29  3:17:43 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2022-04-29  3:17:43 0 [Note] InnoDB: Buffer pool(s) dump completed at 220429  3:17:43
2022-04-29  3:17:44 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
2022-04-29  3:17:44 0 [Note] InnoDB: Shutdown completed; log sequence number 42353; transaction id 15
2022-04-29  3:17:44 0 [Note] mariadbd: Shutdown complete

2022-04-29 03:18:35-07:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:10.7.3+maria~focal started.
2022-04-29 03:18:35-07:00 [Note] [Entrypoint]: MariaDB upgrade not required
2022-04-29  3:18:35 0 [Note] mariadbd (server 10.7.3-MariaDB-1:10.7.3+maria~focal) starting as process 1 ...
2022-04-29  3:18:35 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-04-29  3:18:35 0 [Note] InnoDB: Number of transaction pools: 1
2022-04-29  3:18:35 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2022-04-29  3:18:35 0 [Note] InnoDB: Using Linux native AIO
2022-04-29  3:18:35 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2022-04-29  3:18:35 0 [Note] InnoDB: Completed initialization of buffer pool
2022-04-29  3:18:35 0 [Note] InnoDB: 128 rollback segments are active.
2022-04-29  3:18:35 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-04-29  3:18:35 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-04-29  3:18:35 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2022-04-29  3:18:35 0 [Note] InnoDB: 10.7.3 started; log sequence number 42353; transaction id 14
2022-04-29  3:18:35 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-04-29  3:18:35 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2022-04-29  3:18:35 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2022-04-29  3:18:35 0 [Note] InnoDB: Buffer pool(s) load completed at 220429  3:18:35
2022-04-29  3:18:35 0 [Note] Server socket created on IP: '0.0.0.0'.
2022-04-29  3:18:35 0 [Note] Server socket created on IP: '::'.
2022-04-29  3:18:35 0 [Note] mariadbd: ready for connections.
Version: '10.7.3-MariaDB-1:10.7.3+maria~focal'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

PASTE HERE


Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

PASTE HERE

Solved: I put the wrong port number like an idiot.

Hi, I’m living your exact life in regards to the installation of NextCloud on Unraid! With mariadb and such. I have the 500 gateway timeout error too when first popping the UI and creating admin stuff for the first time. I followed precisely what Space Invader says in his tutorial too.

Can you tell me where you wrote the wrong port and what your wrote instead? I’d really like to finally succeed installing this and keep my hair on my head :))

much thanks!!

gateway timeout then it already creats an account in the background which you cant use because nextcloud still wants you to create a new account. needs a bug fix

Change the Nginx settings like this to bypass parameters:

location / {
try_files $uri $uri/ /index.php?$args;
}