Page 1 of 1

[SOLVED]Error loading setting environment value: DATABASES; while parsing a flow mapping

Posted: Tue May 31, 2022 2:47 pm
by ninadpchaudhari
Dear Reader, just posting here for anyone who would encounter this error.
The gist:
- The error is caused by docker compose v2.2 and similar versions having a bug in parsing default env variables.

Error that I encountered when using docker-compose.yml obtained from mayan:

Code: Select all

mayan: starting entrypoint.sh
mayan: update_uid_gid()
usermod: no changes
mayan: os_package_installs()
mayan: pip_installs()
mayan: initialsetup()
Error loading setting environment value: DATABASES; while parsing a flow mapping
  in "<unicode string>", line 1, column 1
did not find expected ',' or '}'
  in "<unicode string>", line 2, column 1
The root cause of the issue is that, the "MAYAN_DATABASES" variable required by mayan was wrongly parsed by docker compose binary v2.2.
Notice the
}
in NAME variable in docker environment config

Code: Select all

docker-compose --file docker-compose.yml --project-name mayan config
services:
  app:
    environment:
      MAYAN_CELERY_BROKER_URL: amqp://mayan:mayanrabbitpass@rabbitmq:5672/mayan
      MAYAN_CELERY_RESULT_BACKEND: redis://:mayanredispassword@redis:6379/1
      MAYAN_DATABASES: '{''default'':{''ENGINE'':''django.db.backends.postgresql'',''NAME'':''mayan}'',''PASSWORD'':''mayandbpass'',''USER'':''mayan'',''HOST'':''postgresql''}'
The solution is simple, to upgrade your docker-compose to latest version (2.5/2.6) as of now, this is an error with docker compose, not mayan.