"Install Recommended Apps" causing nextcloud to take too long to load, causing timeouts with my nginx web server using fpm

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, 20.0.5): 19.0.10, 20.0.9, 21.0.1
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.19.10
PHP version (eg, 7.4): 7.4

The issue you are facing:
Running nextcloud-fpm using docker and nginx as my web server with Traefik as my reverse proxy. During installation, if I select the “Install Recommended Apps” option, after the installation finished I am unable to load nextcloud and will get the Nginx 504 Gateway Timeout Error. If I skip selecting the install recommended apps, nextcloud is able to load fast enough to avoid this error. The virtual machine running docker is a digitalocean 1gb of ram 1cpu instance. This seems to be consistent across both debian and ubuntu, as well as Nextcloud 19, 20, and 21. Occasionally, nextcloud will load fast enough where I am actually able to get to the dashboard, but will usually get the 504 error again after clicking on any of the menus. Nextcloud seems to function fine as long as I don’t select the install recommended apps option. I am able to install all these recommended apps after the fact without any issues. I am using object storage as my primary storage, but also had the same problem when using the regular storage method.

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

Steps to replicate it:

Fresh install of nextcloud–fpm, nginx, traefik, mariadb. Select “Install Recommended Apps” during installation.

The output of your Nextcloud log in Admin > Logging:

Not able to access the gui, so can't get the logs from there. Looking in my nextcloud docker container /var/www/html/data/nextcloud.log seems to be empty.

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',
  'apps_paths' => 
  array (
    0 => 
    array (
      'path' => '/var/www/html/apps',
      'url' => '/apps',
      'writable' => false,
    ),
    1 => 
    array (
      'path' => '/var/www/html/custom_apps',
      'url' => '/custom_apps',
      'writable' => true,
    ),
  ),
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'nextcloud_redis',
    'password' => '<password>',
    'port' => 6379,
  ),
  'overwritehost' => '<domain_name>',
  'overwriteprotocol' => 'https',
  'trusted_proxies' => 
  array (
    0 => 'nextcloud_nginx',
  ),
  'objectstore' => 
  array (
    'class' => '\\OC\\Files\\ObjectStore\\S3',
    'arguments' => 
    array (
      'bucket' => '<bucket>',
      'key' => '<key>',
      'secret' => '<secret>',
      'region' => '<region>',
      'hostname' => '<hostname>',
      'port' => '443',
      'objectPrefix' => 'urn:oid:',
      'autocreate' => false,
      'use_ssl' => true,
      'use_path_style' => false,
      'legacy_auth' => false,
    ),
  ),
  'instanceid' => '<instanceid>',
  'passwordsalt' => '<pwsalt>',
  'secret' => '<secret>',
  'trusted_domains' => 
  array (
    0 => '<domain_name>',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.9.1',
  'overwrite.cli.url' => 'https://<domain_name>',
  'dbname' => 'nextcloud-database',
  'dbhost' => 'nextcloud_mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '<db_user>',
  'dbpassword' => '<password>',
  'installed' => true,
);


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

2021/04/19 23:52:21 [error] 29#29: *493 upstream timed out (110: Connection timed out) while reading response header from upstream, client: <ip-address>, server: , request: "GET /apps/files/ HTTP/1.1", upstream: "fastcgi://192.168.192.5:9000", host: "<host-name>"
1 Like

I’ve got exactly the same issue. Even resetting (stop, rm -f -s, up -d) both Docker containers, Nextcloud and its database, didn’t do the trick.

Any idea would be highly appreciated!

I run nextcloud in a docker container reverse proxied by an nginx container on a Ubuntu Server host machine.

In my case, I was also running into the exact same issue. After a bit of testing, it turned out that my UFW was blocking ports 80 and 443. I didn’t notice this, because I was able to visit the nextcloud sites despite the firewall. This is probably due to the docker/UFW issue. After releasing these ports the problem went away for me.