Cannot log into Nextcloud instance

Nextcloud version (eg, 20.0.5): 27.1.5
Operating system and version (eg, Ubuntu 20.04): Linux odroid 4.9.333-79 #1 SMP PREEMPT Tue Dec 6 22:41:40 -03 2022 aarch64 aarch64 aarch64 GNU/Linux
Apache or nginx version (eg, Apache 2.4.25): nginx version: nginx/1.25.0
PHP version (eg, 7.4): 8.0

The issue you are facing:
I cannot log into the instance. After entering the username and password it gets stuck:
image
I’ve investigated to the end of my abilities and I suspect it is connected to MariaDB since I keep finind the following in the db log file:

2024-01-12 18:27:07 0 [Note] Starting MariaDB 11.1.2-MariaDB-1:11.1.2+maria~ubu1804-log source revision 9bc25d98209df6810f7a7d5e7dd3ae677a313ab5 as process 3556
2024-01-12 18:27:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-01-12 18:27:07 0 [Note] InnoDB: Number of transaction pools: 1
2024-01-12 18:27:07 0 [Note] InnoDB: Using ARMv8 crc32 + pmull instructions
2024-01-12 18:27:07 0 [Note] InnoDB: Using Linux native AIO
2024-01-12 18:27:07 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB
2024-01-12 18:27:07 0 [Note] InnoDB: Completed initialization of buffer pool
2024-01-12 18:27:07 0 [Note] InnoDB: Resetting space id's in the doublewrite buffer
2024-01-12 18:27:08 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)
2024-01-12 18:27:09 0 [Note] InnoDB: End of log at LSN=54911400639
2024-01-12 18:27:31 0 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 3673018 row operations to undo
2024-01-12 18:27:31 0 [Note] InnoDB: Trx id counter is 147770925
2024-01-12 18:27:31 0 [Note] InnoDB: Opened 3 undo tablespaces
2024-01-12 18:27:31 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.
2024-01-12 18:27:31 0 [Note] InnoDB: Setting file './ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...
2024-01-12 18:27:31 0 [Note] InnoDB: Starting in background the rollback of recovered transactions
2024-01-12 18:27:31 0 [Note] InnoDB: File './ibtmp1' size is now 12.000MiB.
2024-01-12 18:27:31 0 [Note] InnoDB: To roll back: 1 transactions, 3673018 rows
2024-01-12 18:27:31 0 [Note] InnoDB: log sequence number 54911400639; transaction id 147770926
2024-01-12 18:27:31 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-01-12 18:27:31 0 [Note] Plugin 'wsrep-provider' is disabled.
2024-01-12 18:27:31 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-01-12 18:27:31 0 [Note] Server socket created on IP: '127.0.0.1'.
2024-01-12 18:27:31 0 [Note] InnoDB: Buffer pool(s) load completed at 240112 18:27:31
2024-01-12 18:27:31 0 [Note] mariadbd: Event Scheduler: Loaded 0 events
2024-01-12 18:27:31 0 [Note] /usr/sbin/mariadbd: ready for connections.
Version: '11.1.2-MariaDB-1:11.1.2+maria~ubu1804-log'  socket: '/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2024-01-12 19:20:08 0 [Note] InnoDB: To roll back: 1 transactions, 3672885 rows
2024-01-12 19:20:24 0 [Note] InnoDB: To roll back: 1 transactions, 3672429 rows
2024-01-12 19:20:39 0 [Note] InnoDB: To roll back: 1 transactions, 3671494 rows
2024-01-12 19:20:54 0 [Note] InnoDB: To roll back: 1 transactions, 3670825 rows
2024-01-12 19:21:09 0 [Note] InnoDB: To roll back: 1 transactions, 3670714 rows
2024-01-12 19:21:24 0 [Note] InnoDB: To roll back: 1 transactions, 3670629 rows
2024-01-12 19:21:39 0 [Note] InnoDB: To roll back: 1 transactions, 3670447 rows
2024-01-12 19:21:54 0 [Note] InnoDB: To roll back: 1 transactions, 3670195 rows
2024-01-12 19:22:09 0 [Note] InnoDB: To roll back: 1 transactions, 3669578 rows
2024-01-12 19:22:24 0 [Note] InnoDB: To roll back: 1 transactions, 3668414 rows
2024-01-12 19:22:40 0 [Note] InnoDB: To roll back: 1 transactions, 3667497 rows
2024-01-12 19:22:55 0 [Note] InnoDB: To roll back: 1 transactions, 3666494 rows
2024-01-12 19:23:10 0 [Note] InnoDB: To roll back: 1 transactions, 3665960 rows
2024-01-12 19:23:25 0 [Note] InnoDB: To roll back: 1 transactions, 3664891 rows
2024-01-12 19:23:40 0 [Note] InnoDB: To roll back: 1 transactions, 3664072 rows
2024-01-12 19:23:55 0 [Note] InnoDB: To roll back: 1 transactions, 3663950 rows
2024-01-12 19:24:10 0 [Note] InnoDB: To roll back: 1 transactions, 3663793 rows
2024-01-12 19:24:26 0 [Note] InnoDB: To roll back: 1 transactions, 3663776 rows
2024-01-12 19:24:42 0 [Note] InnoDB: To roll back: 1 transactions, 3663764 rows
2024-01-12 19:24:57 0 [Note] InnoDB: To roll back: 1 transactions, 3663753 rows
2024-01-12 19:25:12 0 [Note] InnoDB: To roll back: 1 transactions, 3663743 rows
2024-01-12 19:25:27 0 [Note] InnoDB: To roll back: 1 transactions, 3663732 rows
2024-01-12 19:25:42 0 [Note] InnoDB: To roll back: 1 transactions, 3663722 rows
2024-01-12 19:25:57 0 [Note] InnoDB: To roll back: 1 transactions, 3663711 rows
2024-01-12 19:26:13 0 [Note] InnoDB: To roll back: 1 transactions, 3663700 rows
2024-01-12 19:26:29 0 [Note] InnoDB: To roll back: 1 transactions, 3663689 rows
2024-01-12 19:26:44 0 [Note] InnoDB: To roll back: 1 transactions, 3663678 rows
2024-01-12 19:27:00 0 [Note] InnoDB: To roll back: 1 transactions, 3663667 rows
2024-01-12 19:27:15 0 [Note] InnoDB: To roll back: 1 transactions, 3663658 rows
2024-01-12 19:27:31 0 [Note] InnoDB: To roll back: 1 transactions, 3663649 rows

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

Steps to replicate it:

  1. Try to log in

The output of your Nextcloud log in Admin > Logging:

Cannot access the logs since I cannot login.

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

<?php
$CONFIG = array (
  'instanceid' => 'd089ndq123uhjff',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'somedomain.org',
  ),
  'datadirectory' => '/path_to_data',
  'dbtype' => 'mysql',
  'version' => '27.1.5.1',
  'overwrite.cli.url' => 'https://somedomain.org',
  'dbname' => 'database',
  'dbhost' => 'localhost:/var/run/mysqld/mysqld.sock',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'someuser',
  'dbpassword' => 'somepassword',
  'installed' => true,
  'activity_expire_days' => 14,
  'auth.bruteforce.protection.enabled' => true,
  'sendmail' => false,
  'blacklisted_files' => 
  array (
    0 => '.htaccess',
    1 => 'Thumbs.db',
    2 => 'thumbs.db',
  ),
  'cron_log' => true,
  'default_phone_region' => 'DE',
  'enable_previews' => true,
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\XBitmap',
    5 => 'OC\\Preview\\Movie',
    6 => 'OC\\Preview\\PDF',
    7 => 'OC\\Preview\\MP3',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
  ),
  'filesystem_check_changes' => 0,
  'filelocking.enabled' => 'true',
  'htaccess.RewriteBase' => '/',
  'integrity.check.disabled' => false,
  'knowledgebaseenabled' => false,
  'logfile' => '/path_to_data/nextcloud.log',
  'loglevel' => 1,
  'logtimezone' => 'Europe/Berlin',
  'log_rotate_size' => 104857600,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'overwriteprotocol' => 'https',
  'preview_max_x' => 1024,
  'preview_max_y' => 768,
  'preview_max_scale_factor' => 1,
  'redis' => 
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'quota_include_external_storage' => false,
  'share_folder' => '/Shares',
  'skeletondirectory' => '',
  'theme' => '',
  'trashbin_retention_obligation' => 'auto, 7',
  'updater.release.channel' => 'stable',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtphost' => 'mail.mts.rs',
  'mail_smtpport' => '25',
  'mail_from_address' => 'mail',
  'mail_domain' => 'somedomain.de',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'mail',
  'mail_smtppassword' => 'xxx',
);

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

2024/01/13 14:03:20 [warn] 20695#20695: *1 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 229.192.1.232, server: somedomain.org, request: "GET /js/core/merged-template-prepend.js?v=d8dcfef4-0 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php8.0-fpm.sock:", host: "somedomain.org"

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.