Docker: KeyError in mayan-edms.py because of -e MAYAN_DOCUMENTS_LANGUAGE_CODES versions > 3.1.6
I'm running Mayan-EDMS in docker since 3.x until now version 3.1.6. When I try to update to anything greater than 3.1.6 I get a KeyError: '['
in /opt/mayan-edms/bin/mayan-edms.py
. See: mayan-error.log
Confirmed on 3.1.7 and 3.1.9
The docker container is started via docker-compose (see docker-compose.yml).
I tried those steps to reproduce:
docker run -d --name mayan-edms-postgres --restart=always -p 5432:5432 -e POSTGRES_USER=mayan -e POSTGRES_DB=mayan -e POSTGRES_PASSWORD=mayanuserpass -v /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data -d postgres:9.5
docker run -d --name mayan-edms --restart=always -p 80:8000 -e MAYAN_APT_INSTALLS=tesseract-ocr-deu\ tesseract-ocr-ita -e MAYAN_DOCUMENTS_LANGUAGE='deu' -e MAYAN_DOCUMENTS_LANGUAGE_CODES=['deu','eng','ita','spa'] -e MAYAN_DATABASE_ENGINE=django.db.backends.postgresql -e MAYAN_DATABASE_HOST=172.17.0.1 -e MAYAN_DATABASE_NAME=mayan -e MAYAN_DATABASE_PASSWORD=mayanuserpass -e MAYAN_DATABASE_USER=mayan -e MAYAN_DATABASE_CONN_MAX_AGE=60 -v /docker-volumes/mayan-edms/media:/var/lib/mayan mayanedms/mayanedms:3.1.6
- ininial configuration, add a document
- stop the Mayan-EDMS container
docker run -d --name mayan-edms --restart=always -p 80:8000 -e MAYAN_APT_INSTALLS=tesseract-ocr-deu\ tesseract-ocr-ita -e MAYAN_DOCUMENTS_LANGUAGE='deu' -e MAYAN_DOCUMENTS_LANGUAGE_CODES=['deu','eng','ita','spa'] -e MAYAN_DATABASE_ENGINE=django.db.backends.postgresql -e MAYAN_DATABASE_HOST=172.17.0.1 -e MAYAN_DATABASE_NAME=mayan -e MAYAN_DATABASE_PASSWORD=mayanuserpass -e MAYAN_DATABASE_USER=mayan -e MAYAN_DATABASE_CONN_MAX_AGE=60 -v /docker-volumes/mayan-edms/media:/var/lib/mayan mayanedms/mayanedms:3.1.7
- Execution stops with error: mayan-error.log
Mitigation
Because of the KeyError: '['
I had the suspicion that MAYAN_DOCUMENTS_LANGUAGE_CODES=['deu','eng','ita','spa']
might be the issue. I tried starting the container without that variable which then worked. Following the documentation at https://docs.mayan-edms.com/chapters/languages.html I changed the parameter to MAYAN_DOCUMENTS_LANGUAGE_CODES='["deu", "eng", "ita", "spa"]'
which didn't help either.
Edited by Bebef