No login possible after update to Nextcloud 20

Nextcloud version (eg, 18.0.2): 20.0.1
Operating system and version (eg, Ubuntu 20.04): Docker on QNAP NAS
Apache or nginx version (eg, Apache 2.4.25): NGNX proxy (steveltn/https-portal)
PHP version (eg, 7.1):

The issue you are facing:

After docker image update from version 19 to 20, I can not login any more over Web UI. Previously connected clients work as expected. New clients can not be added, due to login fail on Web UI.

After entering the credentials I will always be redirected back to login page, without any error message. Only the URL changes from /login to /login?redirect_url=/apps/dashboard/.

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

Steps to replicate it:

  1. Have no replication steps.

The log from docker log command:

nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:47 +0000] "POST /login HTTP/1.0" 303 908 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:48 +0000] "GET /apps/dashboard/ HTTP/1.0" 303 902 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:48 +0000] "GET /login?redirect_url=/apps/dashboard/ HTTP/1.0" 200 6307 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

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

<?php
$CONFIG = array (
  'htaccess.RewriteBase' => '/',
  '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' => 'xxx',
    'port' => 6379,
  ),
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'nextcloud.xxx.de',
  ),
  'datadirectory' => '/var/www/html/data',
  'dbtype' => 'mysql',
  'version' => '20.0.1.1',
  'overwrite.cli.url' => 'http://nextcloud.xx.de',
  'dbname' => 'nextcloud',
  'dbhost' => 'nextcloud_db',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxx',
  'installed' => true,
  'app_install_overwrite' => 
  array (
    0 => 'bruteforcesettings',
  ),
  'maintenance' => false,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_from_address' => 'xxx',
  'mail_domain' => 'xxx',
  'mail_smtphost' => 'xxx',
  'mail_smtpport' => '587',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'overwriteprotocol' => 'https',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'loglevel' => 2,
  'theme' => '',
  'encryption.legacy_format_support' => true,
  'encryption.key_storage_migrated' => false,
);

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

nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:47 +0000] "POST /login HTTP/1.0" 303 908 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:48 +0000] "GET /apps/dashboard/ HTTP/1.0" 303 902 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
nextcloud_1        | 172.29.4.2 - - [28/Oct/2020:08:46:48 +0000] "GET /login?redirect_url=/apps/dashboard/ HTTP/1.0" 200 6307 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"

Here is my docker compose configuration

version: '2.4'
services:
    https_proxy:
        image: steveltn/https-portal:1.13
        ports:
            - "6080:80"
            - "6443:443"
        restart: always
        environment:
            STAGE: production #
            CLIENT_MAX_BODY_SIZE: 10G
            HSTS_MAX_AGE: 15552000
            GZIP: "on"
            NUMBITS: '4096'
            DOMAINS: 'nextcloud.xxx.de -> http://nextcloud:80'
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock:ro
            - ./data/proxy/certs:/var/lib/https-portal
            - ./config/nextcloud_http.conf:/var/lib/nginx-conf/nextcloud.wdurl.de.conf.erb:ro
            - ./config/nextcloud_https.conf:/var/lib/nginx-conf/nextcloud.wdurl.de.ssl.conf.erb:ro
        cpus: 0.25
        cpu_count: 1
        mem_limit: 1g
        mem_reservation: 8m

    nextcloud_db:
        image: mariadb:10.5.6-focal
        command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-buffer-pool-size=256M
        restart: always
        volumes:
            - ./data/nextcloud/db:/var/lib/mysql
        env_file:
            - db.env
        cpus: 0.5
        cpu_count: 1
        mem_limit: 1G
        mem_reservation: 128m

    nextcloud_redis:
        image: redis:6.0.9-alpine
        restart: always
        volumes:
            - ./data/nextcloud/cache:/data
        command: redis-server --requirepass 'xxx'
        cpus: 0.25
        cpu_count: 1
        mem_limit: 512m
        mem_reservation: 8m
        
    nextcloud_cron:
        image: nextcloud:20-apache
        restart: always
        volumes:
            - ./data/nextcloud/html:/var/www/html
        entrypoint: /cron.sh
        depends_on:
            - nextcloud_db
            - nextcloud_redis
        cpus: 1
        cpu_count: 1
        mem_limit: 256m
        mem_reservation: 32m

    nextcloud:
        image: nextcloud:20-apache
        hostname: "nextcloud.xxx.de"
        restart: always
        volumes:
            - ./data/nextcloud/html:/var/www/html
        environment:
            MYSQL_HOST: nextcloud_db
            REDIS_HOST: nextcloud_redis
        env_file:
            - db.env
        depends_on:
            - nextcloud_db
            - nextcloud_redis
        cpus: 1
        cpu_count: 2
        mem_limit: 4g
        mem_reservation: 32m
1 Like

Test setting default app to “files”.

Add 'defaultapp' => 'files', to /config/config.php.

Doesn’t help. The only change was, that after login I was redirected to /login?redirect_url=/apps/files/ instead of /login?redirect_url=/apps/dashboard/.

I found the problem. This was the REDIS cache, that have to have --requirepass from NC20. The password I used, had & in it, so it was differently handled if I passed them in command (see docker compose file) and environment variable.

@WebDucer Thank you. That was exactly the cause of the problem in my case, too. Solved now!
Is there a reason why you have all these cpu & mem limits? Docker seems to cap containers anyway based on the system specs it’s installed on.

Thank you for this! I would never have worked it out myself!