Internal Server Error when logging in

I am currently receiving a generic “Internal Server Error” when logging in. The full message is below. This issue just started occuring yesterday after running without issues for close to 2 years. I’ve been on version 15.0.8.1 for several weeks and no known changes have been made to the system. Also, this is my first support request to this forum so I apologize in advance if I’ve left any information out. If more is needed please let me know.

Internal Server Error
The server was unable to complete your request
If this happens again, please send the technical details below to the server administrator.
More details can be found in the server log.
Technical details (nothing follows)
Remote Address: 192.168.XXX.XXX
Request ID: Random

Nextcloud Version: 15.0.8.1
OS: Ubuntu 16.04.6
Apache: 2.4.18
PHP: 7.0

Steps to replicate

  1. Browse to hostname or IP address and login

    Output from /var/log/apache2/error.log
    [Tue Sep 24 08:28:26.377210 2019] [mpm_prefork:notice] [pid 1592] AH00163:
    Apache/2.4.18 (Ubuntu) OpenSSL/1.0.2g configured – resuming normal operations
    [Tue Sep 24 08:28:26.377257 2019] [core:notice] [pid 1592] AH00094: Command line: ‘/usr/sbin/apache2’

    Output from /var/www/nextcloud/config/config.php
    <?php
    $CONFIG = array (
    ‘passwordsalt’ => ‘’,
    ‘secret’ => '
    ’,
    ‘trusted_domains’ =>
    array (
    0 => ‘localhost’,
    1 => ‘192.168.0.50’,
    2 => ‘cloud.X.com’,
    3 => ‘cloud.X.com’,
    ),
    ‘datadirectory’ => ‘/var/ncdata’,
    ‘overwrite.cli.url’ => ‘https://cloud.x.com/’,
    ‘dbtype’ => ‘pgsql’,
    ‘version’ => ‘15.0.8.1’,
    ‘dbname’ => ‘nextcloud_db’,
    ‘dbhost’ => ‘localhost’,
    ‘dbport’ => ‘’,
    ‘dbtableprefix’ => ‘oc_’,
    ‘dbuser’ => ‘ncadmin’,
    ‘dbpassword’ => ‘’,
    ‘installed’ => true,
    ‘instanceid’ => ‘ocpelqgg7o9r’,
    ‘mail_smtpmode’ => ‘smtp’,
    ‘log_rotate_size’ => ‘10485760’,
    ‘memcache.local’ => ‘\OC\Memcache\Redis’,
    ‘filelocking.enabled’ => true,
    ‘memcache.distributed’ => ‘\OC\Memcache\Redis’,
    ‘memcache.locking’ => ‘\OC\Memcache\Redis’,
    ‘redis’ =>
    array (
    ‘host’ => ‘/var/run/redis/redis.sock’,
    ‘port’ => 0,
    ‘timeout’ => 0,
    ‘dbindex’ => 0,
    ‘password’ => '
    ’,
    ),
    ‘htaccess.RewriteBase’ => ‘/’,
    ‘loglevel’ => 1,
    ‘log_type’ => ‘file’,
    ‘logfile’ => ‘/var/ncdata/nextcloud.log’,
    ‘logtimezone’ => ‘America/Chicago’,
    ‘maintenance’ => false,
    ‘ldapIgnoreNamingRules’ => false,
    ‘ldapProviderFactory’ => ‘\OCA\User_LDAP\LDAPProviderFactory’,
    ‘mail_from_address’ => ‘Cloud’,
    ‘mail_smtpauthtype’ => ‘LOGIN’,
    ‘mail_domain’ => ‘’,
    ‘mail_smtphost’ => '
    ’,
    ‘theme’ => ‘’,
    ‘mail_smtpport’ => ‘25’,
    ‘updater.release.channel’ => ‘stable’,
    ‘twofactor_enforced’ => ‘false’,
    ‘twofactor_enforced_groups’ =>
    array (
    ),
    ‘twofactor_enforced_excluded_groups’ =>
    array (
    0 => ‘Service Solutions’,
    ),
    );

    Output from /var/log/redis/redis-server.log
    1477:M 24 Sep 08:28:21.304 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
    1477:M 24 Sep 08:28:21.306 # Redis can’t set maximum open files to 10032 because of OS error: Operation not permitted.
    1477:M 24 Sep 08:28:21.306 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase ‘ulimit -n’.
    .
    .-__ ''-._ _.- .. ‘’-._ Redis 3.0.6 (00000000/0) 64 bit
    .-.-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.-.|’_.-'| Port: 0 |-. ._ / _.-' | PID: 1477-._ -._-./ .-’ .-’
    |-._-.
    -.__.-' _.-'_.-'| |-.
    -._ _.-'_.-' | http://redis.io-._ -._-..-’.-’ .-’
    |-._-.
    -.__.-' _.-'_.-'| |-.
    -._ _.-'_.-' |-._ -._-.
    .-’_.-’ _.-’
    -._-..-’ _.-’
    -._ _.-'-.
    .-’

    1477:M 24 Sep 08:28:21.307 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
    1477:M 24 Sep 08:28:21.307 # Server started, Redis version 3.0.6
    1477:M 24 Sep 08:28:21.307 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command ‘echo never > /sys/kernel/mm/transparent_hugepage/enabled’ as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
    1477:M 24 Sep 08:28:21.417 * DB loaded from disk: 0.110 seconds
    1477:M 24 Sep 08:28:21.417 * The server is now ready to accept connections at /var/run/redis/redis.sock

It appears it was an issue with ldap authentication not working correctly. Once I deleted the old config and created a new one I was able to successfully login.