docker icon indicating copy to clipboard operation
docker copied to clipboard

NC setup (in docker) fails - kick back to login screen

Open kangaroo72 opened this issue 3 years ago • 1 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug, not a question or a configuration/webserver/proxy issue.
  • [X] This issue is not already reported on Github (I've searched it).
  • [X] Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • [X] Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • [X] I agree to follow Nextcloud's Code of Conduct.

Bug description

Starting NC 24.0.5 with Docker Web-Browser asks for admin-user + Password and MySQL-Credentials (MariaDB). After submit, there's no welcome screen as usual. Instead of that, NC kicks me back to the login screen, but the login with the submitted user doesn't work

Steps to reproduce

  1. Start NC with Docker
  2. Type in your data (User+Pass+ SQL-Creds)
  3. Click submit

Expected behavior

Expecting the welcome screen from NC

Installation method

Community Docker image

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.0

Web server

Other

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • [X] Default user-backend (database)
  • [ ] LDAP/ Active Directory
  • [ ] SSO - SAML
  • [ ] Other

Configuration report

{
    "system": {
        "htaccess.RewriteBase": "\/",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwriteprotocol": "https",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.graficad.de"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "24.0.5.1",
        "overwrite.cli.url": "https:\/\/**REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "memcache.local": "\\OC\\Memcache\\APCu"
    }
}

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - bruteforcesettings: 2.4.0
  - circles: 24.0.1
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - contactsinteraction: 1.5.0
  - dashboard: 7.4.0
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - federation: 1.14.0
  - files: 1.19.0
  - files_pdfviewer: 2.5.0
  - files_rightclick: 1.3.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - files_versions: 1.17.0
  - files_videoplayer: 1.13.0
  - firstrunwizard: 2.13.0
  - logreader: 2.9.0
  - lookup_server_connector: 1.12.0
  - nextcloud_announcements: 1.13.0
  - notifications: 2.12.1
  - oauth2: 1.12.0
  - password_policy: 1.14.0
  - photos: 1.6.0
  - privacy: 1.8.0
  - provisioning_api: 1.14.0
  - recommendations: 1.3.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - sharebymail: 1.14.0
  - support: 1.7.0
  - survey_client: 1.12.0
  - systemtags: 1.14.0
  - text: 3.5.1
  - theming: 1.15.0
  - twofactor_backupcodes: 1.13.0
  - updatenotification: 1.14.0
  - user_status: 1.4.0
  - viewer: 1.8.0
  - weather_status: 1.4.0
  - workflowengine: 2.6.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_ldap

Nextcloud Signing status

n/a

Nextcloud Logs

{"reqId":"DlyILS3B6B0ZXkDsRkaT","level":2,"time":"2022-09-11T00:07:55+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}
{"reqId":"DlyILS3B6B0ZXkDsRkaT","level":2,"time":"2022-09-11T00:07:55+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}
{"reqId":"hNC4bOpapsfuVXLj4TL1","level":2,"time":"2022-09-11T00:08:15+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}
{"reqId":"hNC4bOpapsfuVXLj4TL1","level":2,"time":"2022-09-11T00:08:15+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"GET","url":"/","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}
{"reqId":"CS8RnPX4AEmnCIq7SZQ5","level":2,"time":"2022-09-11T00:08:42+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in https:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}
{"reqId":"CS8RnPX4AEmnCIq7SZQ5","level":2,"time":"2022-09-11T00:08:42+00:00","remoteAddr":"172.18.0.2","user":"--","app":"no app in context","method":"POST","url":"/index.php","message":"Could not detect any host in http:///data/htaccesstest.txt","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:104.0) Gecko/20100101 Firefox/104.0","version":"","data":[]}

Additional info

Ubuntu 22.04 LTS with Traefik 2.8 and Docker Compose.

kangaroo72 avatar Sep 11 '22 00:09 kangaroo72

Important Update: After disabling REDIS, it works. You can keep open the issue, or close, if it's not related. Thanks.

kangaroo72 avatar Sep 13 '22 21:09 kangaroo72

I'm still having this exact issue without using REDIS as well

lawhazl avatar Oct 09 '22 15:10 lawhazl

@kangaroo72 thanks for this comment!

After submit, there's no welcome screen as usual. Instead of that, NC kicks me back to the login screen, but the login with the submitted user doesn't work

I was having this same problem with a more or less fresh install. Will put my complete configs at the end.

Your tip about disabling Redis helped me sort out that I was using Redis with a password, and that I was only providing that password via environment variable REDIS_HOST_PASSWORD to the Nextcloud app container and not to the Redis container itself. I figured by providing the .env file to all containers (Nextcloud:fpm, redis, and db) that it would just...work? It did not.

Here's how I provided Redis the same password.

Create redis.conf:

requirepass <redispassword>

Ensure the redis container in my docker compose file gets that config.

  redis:
    image: redis:latest
    restart: always
    command: ["redis-server", "/etc/redis/redis.conf"]
    volumes:
      - cache:/data
      - ./redis.conf:/etc/redis/redis.conf
    networks:
      - nextcloud

Run a docker compose up -d using the new config, and voila! It now logs me in without issue.


My config.

docker-compose.yml:

version: '3.2'

volumes:
  nextcloud:
  db:
  cache:

networks:
  nextcloud:

services:
  db:
    image: postgres
    restart: always
    volumes:
      - db:/var/lib/postgresql/data
    env_file:
      - .env
    networks:
      - nextcloud

  redis:
    image: redis:latest
    restart: always
    command: ["redis-server", "/etc/redis/redis.conf"]
    volumes:
      - cache:/data
      - ./redis.conf:/etc/redis/redis.conf
    networks:
      - nextcloud

  app:
    image: nextcloud:fpm
    restart: always
    volumes:
      - nextcloud:/var/www/html
    depends_on:
      - db
      - redis
    env_file:
      .env
    networks:
      - nextcloud

  web:
    image: nginx
    restart: always
    ports:
      - 8080:80
    depends_on:
      - app
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
      - nextcloud:/var/www/html
    networks:
      - nextcloud
# Database
POSTGRES_DB=nextcloud
POSTGRES_USER=nextcloud
POSTGRES_PASSWORD=<postgrespassword>
POSTGRES_HOST=db

# Nextcloud
NEXTCLOUD_ADMIN_PASSWORD=<adminpassword>
NEXTCLOUD_ADMIN_USER=admin

# Redis cache
REDIS_HOST=redis
# This password also needs to be set in redis.conf file!
REDIS_HOST_PASSWORD=<redispassword>

NEXTCLOUD_TRUSTED_DOMAINS=192.168.2.x

redis.conf: see above. nginx.conf: unedited from https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/postgres/fpm/web/nginx.conf

leafonthewind avatar Apr 14 '23 23:04 leafonthewind

Glad you all (nearly all - sorry @lawhazl!) got it worked out. As these all seem to be config matters and not bugs in the Nextcloud Docker image, I'm going to close this issue out.

I suggest any further follow-up be taken to the Nextcloud Help Forum (https://help.nextcloud.com). Numerous people have successfully gotten assistance with their Redis configured matters there.

joshtrichards avatar Oct 21 '23 18:10 joshtrichards