Docker compose borked too? <class 'django.db.utils.OperationalError'>

When things don't work as they should.
Post Reply
gargantvan
Posts: 27
Joined: Thu Sep 06, 2018 10:57 pm

Docker compose borked too? <class 'django.db.utils.OperationalError'>

Post by gargantvan » Thu Jul 04, 2019 2:25 am

Hi

I was having uprgading the regular docker image (which I already posted about it previously) so I wanted to try Docker compose path from scratch however that does not go well either. Mayan app starts for a bit then crashes.

I am pretty using the provided docker compose file except I defined two volumes for the `/var/lib/postgresql/data` and `/var/lib/mayan` which is what I use for the regular Docker method.

I am on Debian Buster X64

Code: Select all

mayan-edms-broker | 2019-07-04 02:19:52.755 [info] <0.219.0> Running boot step background_gc defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.756 [info] <0.219.0> Running boot step connection_tracking defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.763 [info] <0.219.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit@2f18256a9640
mayan-edms-broker | 2019-07-04 02:19:52.770 [info] <0.219.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit@2f18256a9640
mayan-edms-broker | 2019-07-04 02:19:52.771 [info] <0.219.0> Running boot step routing_ready defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.771 [info] <0.219.0> Running boot step pre_flight defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.771 [info] <0.219.0> Running boot step notify_cluster defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.771 [info] <0.219.0> Running boot step networking defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.774 [warning] <0.485.0> Setting Ranch options together with socket options is deprecated. Please use the new map syntax that allows specifying socket options separately from other options.
mayan-edms-broker | 2019-07-04 02:19:52.775 [info] <0.499.0> started TCP listener on 0.0.0.0:5672
mayan-edms-broker | 2019-07-04 02:19:52.775 [info] <0.219.0> Running boot step direct_client defined by app rabbit
mayan-edms-broker | 2019-07-04 02:19:52.898 [info] <0.8.0> Server startup complete; 0 plugins started.
mayan-edms-broker |  completed with 0 plugins.
mayan-edms-app | mayan: os_package_installs()
mayan-edms-app | mayan: pip_installs()
mayan-edms-app | mayan: upgrade()

mayan-edms-app | CommandError: Error during pre_upgrade signal: could not translate host name "db" to address: No address associated with hostname
mayan-edms-app | , <class 'django.db.utils.OperationalError'>
mayan-edms-app exited with code 1


gargantvan
Posts: 27
Joined: Thu Sep 06, 2018 10:57 pm

Re: Docker compose borked too? <class 'django.db.utils.OperationalError'>

Post by gargantvan » Thu Jul 04, 2019 2:52 am

I also started getting when I tried to restart second time, since I am no expert in this stuff, I do not know how to proceed with this.

Code: Select all

Recreating mayan-edms-broker  ... done
Recreating mayan-edms-results ... done
Recreating mayan-edms-db      ... done

ERROR: for mayan-edms  Container "da118386024e" is unhealthy.
ERROR: Encountered errors while bringing up the project.


User avatar
rosarior
Posts: 387
Joined: Tue Aug 21, 2018 3:28 am

Re: Docker compose borked too? <class 'django.db.utils.OperationalError'>

Post by rosarior » Fri Jul 05, 2019 4:39 am

From the output log it appears that the database host name is being referred as "db" when it should be "mayan-edms-db" instead. Try that.

gargantvan
Posts: 27
Joined: Thu Sep 06, 2018 10:57 pm

Re: Docker compose borked too? <class 'django.db.utils.OperationalError'>

Post by gargantvan » Mon Sep 30, 2019 3:52 pm

Thanks but what does that mean? :(

this is my compose fi;e

Code: Select all


version: '2.1'

volumes:
    broker:
        driver: local
    app:
        driver: local
    db:
        driver: local
    results:
        driver: local

services:
  broker:
    container_name: mayan-edms-broker
    image: healthcheck/rabbitmq
    restart: always
    environment:
      RABBITMQ_DEFAULT_USER: mayan
      RABBITMQ_DEFAULT_PASS: mayan
      RABBITMQ_DEFAULT_VHOST: mayan
    volumes:
      - ./broker:/var/lib/rabbitmq
  results:
    container_name: mayan-edms-results
    image: healthcheck/redis
    volumes:
      - ./results:/data
  db:
    container_name: mayan-edms-db
    image: healthcheck/postgres
    restart: always
    environment:
      POSTGRES_DB: mayan
      POSTGRES_PASSWORD: mayanuserpass
      POSTGRES_USER: mayan
    volumes:
      - /media/DRIVE/DRIVE/mayanedms/postgres:/var/lib/postgresql/data
  mayan-edms:
    container_name: mayan-edms-app
    image: mayanedms/mayanedms:latest
    depends_on:
      broker:
        condition: service_healthy
      db:
        condition: service_healthy
      results:
        condition: service_healthy
    environment:
      MAYAN_BROKER_URL: amqp://mayan:mayan@broker:5672/mayan
      MAYAN_CELERY_RESULT_BACKEND: redis://results:6379/0
      MAYAN_DATABASE_ENGINE: django.db.backends.postgresql
      MAYAN_DATABASE_HOST: db
      MAYAN_DATABASE_NAME: mayan
      MAYAN_DATABASE_PASSWORD: mayanuserpass
      MAYAN_DATABASE_USER: mayan
    ports:
      - "8080:8000"
    volumes:
      - /media/DRIVE/DRIVE/mayanedms/media:/var/lib/mayan




Post Reply