Page 1 of 1

Can't get Docker container to function properly

Posted: Mon Oct 26, 2020 11:52 am
by landcraft
I seem to be having a problem getting MayanEDMS to work.

I've installed it on my Synology DSM using the official Docker image, and when I go to the URL, I'm greeted with a Django site admin page.

The container logs are:

Code: Select all

 -------------- celery@mayan-worker-slow.8fe69ed3c2be v4.3.0 (rhubarb)
---- **** ----- 
--- * ***  * -- Linux-4.4.59+-x86_64-with-debian-10.3 2020-10-25 21:01:08
-- * - **** --- 
- ** ---------- [config]
- ** ---------- .> app:         mayan:0x7fcc553a3748
- ** ---------- .> transport:   redis://:**@redis:6379/0
- ** ---------- .> results:     redis://:**@redis:6379/1
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> common_periodic  exchange=common_periodic(direct) key=common_periodic
                .> document_states  exchange=document_states(direct) key=document_states
                .> mailing          exchange=mailing(direct) key=mailing
                .> ocr              exchange=ocr(direct) key=ocr
                .> parsing          exchange=parsing(direct) key=parsing
                .> statistics       exchange=statistics(direct) key=statistics
                .> tools            exchange=tools(direct) key=tools

[2020-10-25 21:11:34 +0000] [294] [CRITICAL] WORKER TIMEOUT (pid:306)
[2020-10-25 21:11:34 +0000] [306] [INFO] Worker exiting (pid: 306)
[2020-10-25 21:11:35 +0000] [370] [INFO] Booting worker with pid: 370
Can anyone help?

Re: Can't get Docker container to function properly

Posted: Mon Oct 26, 2020 12:24 pm
by landcraft
For completeness, here's the log from redis:

Code: Select all

1:C 25 Oct 2020 20:56:48.678 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 25 Oct 2020 20:56:48.678 # Redis version=5.0.9, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 25 Oct 2020 20:56:48.678 # Configuration loaded
1:M 25 Oct 2020 20:56:48.680 * Running mode=standalone, port=6379.
1:M 25 Oct 2020 20:56:48.680 # WARNING: The TCP backlog setting of 256 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 25 Oct 2020 20:56:48.680 # Server initialized
1:M 25 Oct 2020 20:56:48.680 # 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.
1:M 25 Oct 2020 20:56:48.680 * Ready to accept connections
and from postgres, the logs are too long, so here's the last few lines:

Code: Select all

ERROR:  relation "permissions_storedpermission" does not exist at character 132
STATEMENT:  SELECT "permissions_storedpermission"."id", "permissions_storedpermission"."namespace", "permissions_storedpermission"."name" FROM "permissions_storedpermission" WHERE ("permissions_storedpermission"."name" = 'web_link_instance_view' AND "permissions_storedpermission"."namespace" = 'web_links')
ERROR:  relation "document_states_workflowstateaction" does not exist at character 8
STATEMENT:  UPDATE "document_states_workflowstateaction" SET "action_path" = 'mayan.apps.document_states.workflow_actions.HTTPAction' WHERE "document_states_workflowstateaction"."action_path" = 'mayan.apps.document_states.workflow_actions.HTTPPostAction'

Re: Can't get Docker container to function properly

Posted: Mon Oct 26, 2020 12:30 pm
by landcraft
Finally, my slightly anonymised docker-compose.yml and .env:

Code: Select all

version: '3.7'

networks:
  bridge:
    driver: bridge

services:
  app:
    depends_on:
      - postgresql
      - redis
      # Enable to use RabbitMQ
      #- rabbitmq
    environment: &mayan_env
      # Enable to use RabbitMQ
      # MAYAN_CELERY_BROKER_URL: amqp://${MAYAN_RABBITMQ_USER:-mayan}:${MAYAN_RABBITMQ_PASSWORD:-mayanrabbitpass}@rabbitmq:5672/${MAYAN_RABBITMQ_VHOST:-mayan}
      # To use RabbitMQ as broker, disable Redis as broker
      MAYAN_CELERY_BROKER_URL: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/0
      MAYAN_CELERY_RESULT_BACKEND: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/1
      MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'${MAYAN_DATABASE_DB:-mayan}','PASSWORD':'${MAYAN_DATABASE_PASSWORD:-mayandbpass}','USER':'${MAYAN_DATABASE_USER:-mayan}','HOST':'postgresql'}}"
      MAYAN_DOCKER_WAIT: "postgresql:5432 redis:6379"
      # Replace with the line below when using RabbitMQ
      # MAYAN_DOCKER_WAIT: "postgresql:5432 redis:6379 rabbitmq:5672"
      # To add operating system packages, like additional OCR language,
      # packages, put then in the variable below.
      MAYAN_APT_INSTALLS: "tesseract-ocr-fra"
      # To add Python libraries, like LDAP, put then in the variable below.
      # MAYAN_PIP_INSTALLS: "python-ldap"
    image: mayanedms/mayanedms:latest
    networks:
      - bridge
    ports:
      - "8000:8000"
    restart: unless-stopped
    volumes:
      - ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
      # Optional volumes to access external data like staging or watch folders
      # - /opt/staging_files:/staging_files
      - <DSM watch folder location>:/watch_folder

  postgresql:
    environment:
      POSTGRES_DB: ${MAYAN_DATABASE_DB:-mayan}
      POSTGRES_PASSWORD: ${MAYAN_DATABASE_PASSWORD:-mayandbpass}
      POSTGRES_USER: ${MAYAN_DATABASE_USER:-mayan}
    image: postgres:9.6-alpine
    networks:
      - bridge
    restart: unless-stopped
    volumes:
      - ${MAYAN_POSTGRES_VOLUME:-postgres}:/var/lib/postgresql/data

  redis:
    command:
      - redis-server
      - --appendonly
      - "no"
      - --databases
      - "2"
      - --maxmemory
      - "100mb"
      - --maxclients
      - "500"
      - --maxmemory-policy
      - "allkeys-lru"
      - --save
      - ""
      - --tcp-backlog
      - "256"
      - --requirepass
      - "${MAYAN_REDIS_PASSWORD:-mayanredispassword}"
    image: redis:5.0-alpine
    networks:
      - bridge
    restart: unless-stopped
    volumes:
      - ${MAYAN_REDIS_VOLUME:-redis}:/data

Code: Select all

TZ=Europe/*

MAYAN_APP_VOLUME=/volume1/docker/mayan_edms/media
MAYAN_REDIS_VOLUME=/volume1/docker/mayan_edms/redis
MAYAN_POSTGRES_VOLUME=/volume1/docker/mayan_edms/postgres
UID=1027
GID=100

Re: Can't get Docker container to function properly

Posted: Wed Oct 28, 2020 4:32 pm
by jhr
My guess is that the problem lies with some of your customizations.

After upgrading my docker-compose, I was able to run the docker-compose.yml from the GitLab site with no modifications.

I am running this on an Amazon EC2 instance running a Ubuntu AMI.