504 error after login - self resolved

Edit: Was able to solve by rolling back to an earlier version of the database. Seeing VERY poor performance though, will be asking further questions in another thread.

Nextcloud version: 20.0.3
Operating system and version: Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): 1.18.0
PHP version (eg, 7.1): 7.4

The issue you are facing:

I was tweaking a config file a week ago (wish I could remember which one; it was related to max file size) and something in the process hosed my install, or at least I think it did. Luckily, I keep regular backups of everything, and after trying to get things back up I finally said “boop it” and nuked and repaved the system. I installed a fresh copy of NC 20.0.3 (which is what I was on) on top of my Ubuntu/NGINX/MariaDB/PHP7.4 server. (Using the Linuxbabe directions as a template)

Once I did that, I shut off NGINX, edited /usr/share/nginx/nextcloud/config/config.php to point to the actual data directory, and dropped the fresh database and restored the existing one. Then I started NGINX, and logged in, or rather tried to. I can get to the login page once, but entering a username/password gives me a HTTP 504 error code. (This is what it was doing before I scratched and reloaded)

Broken down - what is new:

The underlying system (Everything set up from scratch)

The Nextcloud program directory install + config files

What is old:

The Nextcloud data directory

The MariaDB Nextcloud database table.

Any suggestions on where I should look next to try and figure this out?

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

<?php
$CONFIG = array (
  'instanceid' => 'Nope!',
  'passwordsalt' => 'Nope!',
  'secret' => 'Nope!',
  'trusted_domains' =>
  array (
    0 => 'Nope!',
  ),
  'datadirectory' => '/diskpool/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '20.0.3.2',
  'overwrite.cli.url' => 'Nope!',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextclouduser',
  'dbpassword' => 'Nope!',
  'installed' => true,
);

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

From nginx/nextcloud.error

2020/12/23 18:32:22 [error] 818#818: *783 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:32:33 [error] 818#818: *791 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:33:14 [error] 818#818: *781 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:33:30 [error] 818#818: *783 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:33:34 [error] 818#818: *791 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:34:17 [error] 818#818: *781 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:34:34 [error] 818#818: *783 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"
2020/12/23 18:34:38 [error] 818#818: *791 upstream timed out (110: Connection timed out) while reading response header from upstream, client: Nope!, server: Nope!, request: "PROPFIND /remote.php/webdav/(file) HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "Nope!"

User solved it