michaelmob / docker-funkwhale

All-in-one funkwhale docker image.
92 stars 18 forks source link

funkwhale container keeps restarting for ever #48

Closed charlyoleg closed 3 years ago

charlyoleg commented 3 years ago

Describe the bug Following the instructions for mono-container installation on my OVH-VPS server, after the command 'docker-compose up -d', I see my funkwhale container starting and then stopping and then restarting in an endless loop. According to the log, the container received 'Received SIGTERM scheduling shutdown...'. I don't know what emit this SIGTERM: OVH? Some internal error?

Logs

# Stdout
325:M 03 Oct 2020 13:07:06.386 * Running mode=standalone, port=6379.
325:M 03 Oct 2020 13:07:06.386 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
325:M 03 Oct 2020 13:07:06.386 # Server initialized
325:M 03 Oct 2020 13:07:06.386 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
325:M 03 Oct 2020 13:07:06.386 # 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.
325:M 03 Oct 2020 13:07:06.386 * Ready to accept connections
325:signal-handler (1601730426) Received SIGTERM scheduling shutdown...
[services.d] done.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] syncing disks.
325:M 03 Oct 2020 13:07:06.494 # User requested shutdown...
325:M 03 Oct 2020 13:07:06.494 * Saving the final RDB snapshot before exiting.
325:M 03 Oct 2020 13:07:06.864 * DB saved on disk
325:M 03 Oct 2020 13:07:06.864 # Redis is now ready to exit, bye bye...
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

# Logs are located in the `/var/log/funkwhale/` directory.
docker exec -it ${CONTAINER_ID} cat /var/log/funkwhale/{gunicorn,celery-worker,celery-beat}.log

Options Submit your command options and arguments like volumes, environment variables, and ports.

version: "3"
services:
  funkwhale:
    container_name: funkwhale
    restart: unless-stopped
    # change version number here when you want to do an upgrade
    image: funkwhale/all-in-one:1.0
    env_file: .env
    environment:
      # adapt to the pid/gid that own /srv/funkwhale/data
      - PUID=999
      - PGID=998
    volumes:
      - /srv/funkwhale/data:/data
    ports:
      - "5000:80"

System information

docker version
Client: Docker Engine - Community
 Version:           19.03.13
 API version:       1.40
 Go version:        go1.13.15
 Git commit:        4484c46d9d
 Built:             Wed Sep 16 17:02:36 2020
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.13
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       4484c46d9d
  Built:            Wed Sep 16 17:01:06 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.3.7
  GitCommit:        8fba4e9a7d01810a393d5d25a3621dc101981175
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

docker-compose version 1.17.1, build unknown

Additional context This happens on an OVH VPS server and also on my Ubuntu laptop.

agateblue commented 3 years ago

Hi, this error doesn't look familiar. How is the resource usage on your server? Is it possible the container would be killed by your OS because of a lack of available memory?

charlyoleg commented 3 years ago

After getting the error on my OVH VPS, I have tried the docker-compose.yaml on my personal laptop, that has plenty of resources (16GB RAM) and I got exactly the same error. By googling, I saw similar error related to Redis containers. Unfortunately, I'm not familiar with Redis configuration and setup.

agateblue commented 3 years ago

I'm successfully reproducing this on a clean install…

agateblue commented 3 years ago

So I think I found the culprit: in fact, the crash was higher in the stack trace, with an ownership issue on the postgres directory. I suspect the postgres processed crashed, thus causing the redis server to be killed by s6.

Would you mind trying again with the funkwhale/all-in-one:develop tag?

charlyoleg commented 3 years ago

Thank you! The restarting issue is fixed. I will proceed further with the installation.