Failed to start Mayan EDMS on docker

When things don't work as they should.
Post Reply
madarwish
Posts: 3
Joined: Wed Mar 04, 2020 9:31 am

Failed to start Mayan EDMS on docker

Post by madarwish »

Dear All,
I have tried to follow the installation guide https://docs.mayan-edms.com/chapters/do ... er-install to install Mayan on my Mac OS X machine

And I have initially used the exact inputs provided

Code: Select all

docker run \
-d \
--name mayan-edms \
--restart=always \
-p 80:8000 \
-e MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'172.17.0.1'}}" \
-e MAYAN_CELERY_BROKER_URL="redis://:mayanredispassword@172.17.0.1:6379/0" \
-e MAYAN_CELERY_RESULT_BACKEND="redis://:mayanredispassword@172.17.0.1:6379/1" \
-v /docker-volumes/mayan-edms/media:/var/lib/mayan \
mayanedms/mayanedms:3.3.14
But it failed, with error that database is not accessible on given IP and port

I have tried to change the IP to use localhost, but also failed

Then I have tried to run ifconfig and get internal IP and used it, only then I got a different error message :

Code: Select all

mayan: performupgrade()
JSONField implementation is: <class 'django.db.models.fields.TextField'>
CommandError: Error during pre_upgrade signal: FATAL:  database "mayan" does not exist
, <class 'django.db.utils.OperationalError'>
I then tried to tail the logs for Postgres DB and I got the following error:

Code: Select all

FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
FATAL:  database "mayan" does not exist
Any suggestions ?

aaribaud
Posts: 18
Joined: Mon Sep 23, 2019 9:30 am

Re: Failed to start Mayan EDMS on docker

Post by aaribaud »

Hi,

Did step 5 (running the Postgresql container which should create the "mayan" database) display anything out of the ordinary?

madarwish
Posts: 3
Joined: Wed Mar 04, 2020 9:31 am

Re: Failed to start Mayan EDMS on docker

Post by madarwish »

Hi ,

I have reviewed the full trace now and I found this log

Code: Select all

waiting for server to start....FATAL:  data directory "/var/lib/postgresql/data" has group or world access
DETAIL:  Permissions should be u=rwx (0700).
pg_ctl: could not start server
Examine the log output.
 stopped waiting


aaribaud
Posts: 18
Joined: Mon Sep 23, 2019 9:30 am

Re: Failed to start Mayan EDMS on docker

Post by aaribaud »

It looks like the Postgres container is not happy with the files in the mayan-edms volume: in the container run command, you can see "-v /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data", which maps the container's /var/lib/postgresql/data to the host's /docker-volumes/mayan-edms/postgres.

However, this docker volume is not stored alongside other docker volumes (it won't appear with "docker volume ls") and is not removed when you uninstall Mayan using docker.

So, if you do a first ever install Mayan through docker, then uninstall but keep /docker-volumes/mayan-edms, then re-install later a newer Mayan with a newer Postgres version, it might try using files in /docker-volumes/mayan-edms which are obsolete; in your case, I suspect a recent version of Postgres added permission constraints on /var/lib/postgresql/data which weren't there in earlier versions, and you ran that newer Postgres with an older /var/lib/postgresql/data.

If this is a fresh install, I'd suggest stopping then destroying all containers and volumes (but not images), and removing the /docker-volumes/mayan-edms/ directory, then installing from scratch again, checking each step carefully.

HTH

madarwish
Posts: 3
Joined: Wed Mar 04, 2020 9:31 am

Re: Failed to start Mayan EDMS on docker

Post by madarwish »

Thanks for your help, I figured this out, I have removed the local volume section in the run command and it worked just fine, by the way what is the default user/password for new docker installation ?

aaribaud
Posts: 18
Joined: Mon Sep 23, 2019 9:30 am

Re: Failed to start Mayan EDMS on docker

Post by aaribaud »

You mean for the Mayan admin? The password is set randomly at install time, and displayed every time you visit your site's login page until you change it in the admin user pages.

User avatar
rssfed23
Moderator
Moderator
Posts: 213
Joined: Mon Oct 14, 2019 1:18 pm
Location: United Kingdom
Contact:

Re: Failed to start Mayan EDMS on docker

Post by rssfed23 »

For users that find themselves in a situation where they've forgotten the admin password or it's not shown on the login page for some reason, you can also run the "mayan-edms.py createsuperuser" command to manually create a superuser as detailed in the documentation
Please bear with us during the current global situation. The team all have families and local communities to look after as well as the community here. Responses may be delayed during this time, but rest assured we will get to your query eventually.

Post Reply