504 Error after signing into Nextcloud

Nextcloud version (eg, 20.0.5): 27.1.5
Operating system and version (eg, Ubuntu 20.04): Debian 12
Apache or nginx version (eg, Apache 2.4.25): NGINX 1.22.1
PHP version (eg, 7.4): 8.2

The issue you are facing:

Nextcloud backend is working, my laptop and workstation syncing is working, iPhone/iPad apps can access/delete files fine, webDAV works too.

I just can’t seem to access the webUI. It’s slow to load, then once I reach the sign-in page, I get a 504 error after signing in.

I just updated to 27.1.5 after getting the error, but no success after the update. Last time I updated was a few months back… It was on v27.1.3 previously. From what I remember, I had issues with PHP, had to update to php8.2. I seemingly resolved all issues at that time. I just went on using the server… but I never really access the webUI, so I don’t know when it started happening, I only went in because I accidentally deleted a file and wanted to recover it. That’s when I discovered the webUI has issues!

I’ve tried purging the php installation and re-installing, but no difference. I’m pretty stumped…

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

Steps to replicate it:

  1. Navigate to nextcloud URL
  2. Sign in
  3. 504 Error

The output of your Nextcloud log in Admin > Logging:

Unable to access

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

$CONFIG = array (
  'instanceid' => '--',
  'passwordsalt' => '--',
  'secret' => '--',
  'trusted_domains' => 
  array (
    0 => '<server_private_IP>',
    1 => '<public_URL>',
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://<server_private_IP>',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost:3307',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => '---',
  'installed' => true,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  'twofactor_enforced_excluded_groups' => 
  array (
  'app_install_overwrite' => 
  array (
    0 => 'twofactor_rcdevsopenotp',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'loglevel' => 2,
  'theme' => '',
  'default_phone_region' => 'CA',
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'pipe',
  'memories.exiftool' => '/var/www/nextcloud/apps/memories/bin-ext/exiftool-amd64-glibc',
  'memories.vod.path' => '/var/www/nextcloud/apps/memories/bin-ext/go-vod-amd64',

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

2024/01/15 05:03:27 [error] 740#740: *199 upstream timed out (110: Connection timed out) while reading response header from upstream, client: <workstation_ip>, server: <public_URL>, request: "GET /apps/dashboard/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock", host: "<public_URL>"

The 504 indicates a problem that will either show up in the nextcloud.log (if it’s a Nextcloud issue) (or) your FPM logs (if it’s a php-fpm matter).

You’ll need to look in those places for clues.