linuxserver / docker-healthchecks

GNU General Public License v3.0
177 stars 38 forks source link

failed to start: CommandError: Compressor is disabled. Set the COMPRESS_ENABLED setting or use --force to override. #83

Closed liushapku closed 1 year ago

liushapku commented 2 years ago

linuxserver.io


Expected Behavior

When deployed using portainer with docker-composer, it should run smoothly.

Current Behavior

The server fails to start. The log message says:

running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...
314 static files copied to '/app/healthchecks/static-collected'.
running "exec:/usr/bin/python3 ./manage.py compress" (pre app)...
CommandError: Compressor is disabled. Set the COMPRESS_ENABLED setting or use --force to override.
command "/usr/bin/python3 ./manage.py compress" exited with non-zero code: 1
Sat Dec 25 03:24:37 2021 - FATAL hook failed, destroying instance

Steps to Reproduce

  1. use the following composer file

# https://hub.docker.com/r/linuxserver/healthchecks
# https://healthchecks.io/docs/self_hosted/

version: "2.1"
services:
  healthchecks:
    image: lscr.io/linuxserver/healthchecks
    container_name: healthchecks
    environment:
      - PUID=1000
      - PGID=1000
      - SITE_ROOT=localhost:9001
      - SITE_NAME=Health Check

      - DEFAULT_FROM_EMAIL=root@example.com
      - EMAIL_HOST=example.com
      - EMAIL_PORT=465
      - EMAIL_HOST_USER=root
      - EMAIL_HOST_PASSWORD=xxxxxx
      - EMAIL_USE_TLS=True # <True or False>

      #- ALLOWED_HOSTS=<ALLOWED_HOSTS>
      - SUPERUSER_EMAIL=root@example.com
      - SUPERUSER_PASSWORD=xxxxxx

      #- REGENERATE_SETTINGS=False # True/False #optional
      #- SITE_LOGO_URL=<SITE_LOGO_URL> #optional
      #- SECRET_KEY=<SECRET_KEY> #optional
    volumes:
      - /data/docker/healthcheck:/config
    ports:
      - "127.0.0.1:9001:8000"
    restart: unless-stopped
  1. deploy the stack using portainer
  2. go to the log, I can see that the server fails to start

Environment

OS: ubuntu CPU architecture: x86_64 How docker service was installed: sudo apt install docker.io

Command used to create docker container (run/create/compose/screenshot)

I use portainer and clicked "deploy the stack."

Docker logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/

Brought to you by linuxserver.io
-------------------------------------

To support LSIO projects visit:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    1000
User gid:    1000
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 30-config: executing... 
New container detected. Setting up app folder and fixing permissions.
Operations to perform:
  Apply all migrations: accounts, admin, api, auth, contenttypes, payments, sessions
Running migrations:
  No migrations to apply.
Superuser creation skipped. Already exists.
[cont-init.d] 30-config: exited 0.
[cont-init.d] 90-custom-folders: executing... 
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[uWSGI] getting INI configuration from uwsgi.ini
[uwsgi-static] added mapping for /static => static-collected
*** Starting uWSGI 2.0.19.1 (64bit) on [Sat Dec 25 03:57:02 2021] ***
compiled with version: 10.3.1 20210424 on 05 April 2021 18:18:03
os: Linux-5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021
nodename: c79c0d627af2
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 24
current working directory: /app/healthchecks
detected binary path: /usr/sbin/uwsgi
your memory page size is 4096 bytes
detected max file descriptor number: 1048576
building mime-types dictionary from file /etc/mime.types...1311 entry found
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address :8000 fd 3
Python version: 3.9.5 (default, Nov 24 2021, 21:19:13)  [GCC 10.3.1 20210424]
Python main interpreter initialized at 0x7f65d8127bf0
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 203184 bytes (198 KB) for 1 cores
*** Operational MODE: single process ***
running "exec:/usr/bin/python3 ./manage.py collectstatic --noinput" (pre app)...

314 static files copied to '/app/healthchecks/static-collected'.
running "exec:/usr/bin/python3 ./manage.py compress" (pre app)...
CommandError: Compressor is disabled. Set the COMPRESS_ENABLED setting or use --force to override.
command "/usr/bin/python3 ./manage.py compress" exited with non-zero code: 1
Sat Dec 25 03:57:03 2021 - FATAL hook failed, destroying instance
SIGINT/SIGQUIT received...killing workers...
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0x7f65d8127bf0 pid: 285 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 285)
spawned uWSGI worker 1 (pid: 302, cores: 1)
[uwsgi-daemons] spawning "/usr/bin/python3 ./manage.py sendalerts" (uid: 1000 gid: 1000)
github-actions[bot] commented 2 years ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

liushapku commented 2 years ago

I also tried the following from ubuntu shell docker exec -it healthchecks /bin/bash

Then in the shell, cd /app/healthchecks

After this, run manually: /usr/bin/python3 ./manage.py compress. It quit immediately with error

    CommandError: Compressor is disabled. Set the COMPRESS_ENABLED setting or use --force to override.

Setting COMPRESS_ENABLED does not work, adding --force to the command line works.

But I don't know how I can let docker automatically append --force

fmoledina commented 2 years ago

Adding a COMPRESS_ENABLED = True in /config/local_settings.py works to get past this error.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.