crazy-max / docker-nextcloud

Nextcloud Docker image
MIT License
245 stars 47 forks source link

Loggin in stuck at loading (chrome) #28

Closed aronmgv closed 4 years ago

aronmgv commented 4 years ago

Hi,

After upgrading to 17.0.1 and setting everything from scratch I noticed that logging into app gets stuck for the chrome and android mobile app (after a while it offers old interface and it goes through). When then the site is refreshed again it redirects me into app successfully. For the Firefox it goes through as expected just after hitting submit. Tested it in incognito modes without any add-ons.

image

Steps to reproduce this issue

  1. use latest docker image
  2. use traefik example
  3. go through the initial setup
  4. try to log in via chrome..

Expected behaviour

Redirect to app..

Actual behaviour

Stuck at loading the login - see scrennshot.

Configuration

System info

root@caradhras:[/docker/nextcloud]: docker --version
Docker version 19.03.5, build 633a0ea838
root@caradhras:[/docker/nextcloud]: docker-compose --version
docker-compose version 1.23.2, build 1110ad01
root@caradhras:[/docker/nextcloud]: uname -a
Linux caradhras 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

My docker-compose.yml is build upon your traefik version:

TZ=Europe/Prague

UID=1000
GID=994

MEMORY_LIMIT=4096M
UPLOAD_MAX_SIZE=10G
OPCACHE_MEM_SIZE=1024
APC_SHM_SIZE=1024M

REAL_IP_FROM=0.0.0.0/32
REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=http_x_forwarded_for

HSTS_HEADER=max-age=15768000; includeSubDomains
RP_HEADER=strict-origin
SUBDIR=

DB_TYPE=pgsql
DB_HOST=postgres
DB_NAME=nextcloud
DB_USER=nextcloud
DB_PASSWORD==********************
version: "3.7"

services:
  nextcloud:
    container_name: nextcloud.524
    image: crazymax/nextcloud:latest
    restart: always
    ports:
      - 52480:8000
    depends_on:
      - postgres
      - redis
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
      - "/lvm/raid/private/backups/:/mnt/private/backups"
      - "/lvm/raid/private/data/:/mnt/private/data"
      - "/lvm/raid/private/drive/:/mnt/private/drive"
      - "/lvm/raid/private/media/:/mnt/private/media"
      - "/lvm/raid/public/backups/:/mnt/public/backups"
      - "/lvm/raid/public/drive/:/mnt/public/drive"
      - "/lvm/raid/public/ftp/:/mnt/public/ftp"
    labels:
      - "com.ouroboros.enable=true"
      - "traefik.enable=true"
      - "traefik.port=8000"
      - "traefik.frontend.entryPoints=https"
      - "traefik.frontend.rule=Host:cloud.example.com"
      - "traefik.frontend.redirect.permanent=true"
      - "traefik.frontend.redirect.regex=https://(.*)/.well-known/(card|cal)dav"
      - "traefik.frontend.redirect.replacement=https://$$1/remote.php/dav/"
      - "traefik.backend=nextcloud.524"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
    environment:
      - PUID=1000
      - PGID=994
    env_file:
      - "./nextcloud.env"

  postgres:
    container_name: nextcloud.524.postgres
    image: postgres:latest
    restart: always
    expose:
      - 5432
    volumes:
      - $PWD/postgres:/var/lib/postgresql/data
    environment:
      - PUID=1000
      - PGID=994
      - POSTGRES_DB=nextcloud
      - POSTGRES_USER=nextcloud
      - POSTGRES_PASSWORD=********************
      #docker exec -it nextcloud.524.postgres bash
      #su postgres
      #createuser -P nextcloud
      #createdb -O nextcloud nextcloud

  adminer:
    container_name: nextcloud.524.adminer.82
    image: adminer
    restart: always
    ports:
      - 52482:8080

  redis:
    container_name: nextcloud.524.redis
    image: redis:4.0-alpine
    restart: always

  collabora:
    container_name: nextcloud.524.collabora
    image: collabora/code
    restart: always
    cap_add:
      - MKNOD
    expose:
      - 9980
    labels:
      - "com.ouroboros.enable=true"
      - "traefik.enable=true"
      - "traefik.port=9980"
      - "traefik.frontend.entryPoints=https"
      - "traefik.frontend.rule=Host:collabora.cloud.example.com"
      - "traefik.backend=nextcloud.524.collabora"
      - "traefik.frontend.headers.forceSTSHeader=true"
      - "traefik.frontend.headers.STSSeconds=315360000"
      - "traefik.frontend.headers.STSIncludeSubdomains=true"
      - "traefik.frontend.headers.STSPreload=true"
    environment:
      - "domain=cloud.example.com"
      - "DONT_GEN_SSL_CERT=true"
      - "extra_params=--disable-ssl"
      #- "extra_params=--o:ssl.enable=false"

  cron:
    container_name: nextcloud.524.cron
    image: crazymax/nextcloud:latest
    restart: always
    depends_on:
      - nextcloud
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
    #command:
    #  - "/usr/local/bin/cron"
    env_file:
      - "./nextcloud.env"
    environment:
      - "SIDECAR_CRON=1"
      - "CRON_PERIOD=*/15 * * * *"

  news_updater:
    container_name: nextcloud.524.news_updater
    image: crazymax/nextcloud:latest
    depends_on:
      - nextcloud
    volumes:
      - "$PWD/nextcloud:/data"
      - "/lvm/raid/public/nextcloud/data/:/data/data"
    env_file:
      - "./nextcloud.env"
    environment:
      - "SIDECAR_NEWSUPDATER=1"
      - "NC_NEWSUPDATER_THREADS=10"
      - "NC_NEWSUPDATER_TIMEOUT=300"
      - "NC_NEWSUPDATER_INTERVAL=900"
      - "NC_NEWSUPDATER_LOGLEVEL=error"
    restart: always

Docker info

root@caradhras:[/docker/nextcloud]: docker info
Client:
 Debug Mode: false

Server:
 Containers: 60
  Running: 57
  Paused: 0
  Stopped: 3
 Images: 82
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.19.0-6-amd64
 Operating System: Debian GNU/Linux 10 (buster)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.36GiB
 Name: caradhras
 ID: BJXV:ZBFE:E2PV:3L5L:BHXJ:7ZCU:ANZ6:S7O5:PC2H:WQUH:HXDV:TLE5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Logs

Configured debug level 0 and not much happening:

root@caradhras:[/docker/nextcloud]: dcl nextcloud
Attaching to nextcloud.524
nextcloud.524   | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
nextcloud.524   | [s6-init] ensuring user provided files have correct perms...exited 0.
nextcloud.524   | [fix-attrs.d] applying ownership & permissions fixes...
nextcloud.524   | [fix-attrs.d] done.
nextcloud.524   | [cont-init.d] executing container initialization scripts...
nextcloud.524   | [cont-init.d] 00-fix-logs.sh: executing...
nextcloud.524   | [cont-init.d] 00-fix-logs.sh: exited 0.
nextcloud.524   | [cont-init.d] 01-fix-uidgid.sh: executing...
nextcloud.524   | Switching to PGID 994...
nextcloud.524   | [cont-init.d] 01-fix-uidgid.sh: exited 0.
nextcloud.524   | [cont-init.d] 02-fix-perms.sh: executing...
nextcloud.524   | Fixing perms...
nextcloud.524   | [cont-init.d] 02-fix-perms.sh: exited 0.
nextcloud.524   | [cont-init.d] 03-config.sh: executing...
nextcloud.524   | Setting timezone to Europe/Prague...
nextcloud.524   | Setting PHP-FPM configuration...
nextcloud.524   | Setting PHP configuration...
nextcloud.524   | sed: bad option in substitution expression
nextcloud.524   | Setting Nginx configuration...
nextcloud.524   | Initializing Nextcloud files/folders...
nextcloud.524   | [cont-init.d] 03-config.sh: exited 0.
nextcloud.524   | [cont-init.d] 04-svc-main.sh: executing...
nextcloud.524   | Bootstrapping configuration...
nextcloud.524   | The current PHP memory limit is below the recommended value of 512MB.
nextcloud.524   | Upgrading Nextcloud...
nextcloud.524   | The current PHP memory limit is below the recommended value of 512MB.
nextcloud.524   | Nextcloud is already latest version
nextcloud.524   | [cont-init.d] 04-svc-main.sh: exited 0.
nextcloud.524   | [cont-init.d] 05-svc-cron.sh: executing...
nextcloud.524   | [cont-init.d] 05-svc-cron.sh: exited 0.
nextcloud.524   | [cont-init.d] 06-svc-news-updater.sh: executing...
nextcloud.524   | [cont-init.d] 06-svc-news-updater.sh: exited 0.
nextcloud.524   | [cont-init.d] done.
nextcloud.524   | [services.d] starting services
nextcloud.524   | [services.d] done.
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: using the "epoll" event method
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: nginx/1.16.1
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: OS: Linux 4.19.0-6-amd64
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker processes
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 321
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 322
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 323
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 324
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 325
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 327
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 333
nextcloud.524   | 2019/12/18 14:50:14 [notice] 304#304: start worker process 339
nextcloud.524   | [18-Dec-2019 14:50:14] NOTICE: fpm is running, pid 305
nextcloud.524   | [18-Dec-2019 14:50:14] NOTICE: ready to handle connections
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:41 +0100] "GET / HTTP/1.1" 302 5 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:41 +0100] "GET /login HTTP/1.1" 200 3814 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:42 +0100] "GET /apps/theming/styles?v=0 HTTP/1.1" 200 377 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:42 +0100] "GET /js/core/merged-template-prepend.js?v=9327e1de-0 HTTP/1.1" 200 2950 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:44 +0100] "GET /apps/theming/js/theming?v=0 HTTP/1.1" 200 232 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:44 +0100] "GET /svg/core/logo/logo?color=fff&v=1 HTTP/1.1" 200 194 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:44 +0100] "GET /apps/accessibility/js/accessibility?v=0 HTTP/1.1" 200 65 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
nextcloud.524   | 192.168.255.1 - - [18/Dec/2019:14:50:54 +0100] "POST /login HTTP/1.1" 303 0 "https://cloud.example.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"

Thanks

crazy-max commented 4 years ago

@MacGyver27

      - "/lvm/raid/public/nextcloud/data/:/data/data"
      - "/lvm/raid/private/backups/:/mnt/private/backups"
      - "/lvm/raid/private/data/:/mnt/private/data"
      - "/lvm/raid/private/drive/:/mnt/private/drive"
      - "/lvm/raid/private/media/:/mnt/private/media"
      - "/lvm/raid/public/backups/:/mnt/public/backups"
      - "/lvm/raid/public/drive/:/mnt/public/drive"
      - "/lvm/raid/public/ftp/:/mnt/public/ftp"

What's the point with all those bind mounts? I suspect this one /lvm/raid/public/nextcloud/data/:/data/data could cause issues as /data is already mounted as a volume from this image (overlap). So can you first comments all those bind mounts starting with - "/lvm/raid/... and try again?

UID=1000
GID=994

Typo here, those vars are not used in this image (PUID and PGID instead)... I think it's the root cause of your previous issue #27...

Please review your configuration based on this example.

crazy-max commented 4 years ago

@MacGyver27

for the chrome and android mobile app (after a while it offers old interface and it goes through). When then the site is refreshed again it redirects me into app successfully. For the Firefox it goes through as expected just after hitting submit. Tested it in incognito modes without any add-ons.

If it's ok with Firefox but not on your mobile, I don't think this is an issue with this image, but your network or something else and can't help you here.

aronmgv commented 4 years ago

What's the point with all those bind mounts? I suspect this one /lvm/raid/public/nextcloud/data/:/data/data could cause issues as /data is already mounted as a volume from this image (overlap).

Those mounts are external storage units - NAS to be available via nextcloud interface. I have tested nesting volumes inside another and it works surprisingly nicely..

Anyway I have found the problem and it was related to the upgrade to NC17.. more info here (add 'overwriteprotocol' => 'https', into config.php - maybe you can add it to the readme or chanegelog as well?).