Page 1 of 1

[SOLVED] Problem initializing project, postgresql related

Posted: Fri Apr 03, 2020 9:25 am
by MBerlin
Hi everyone

I am very excited to install Mayan as it looks very promising. However, I am not an expert. I tried to follow the guidelines at and use a chroot on my NAS. So far most of it run smoothly and I could even solve a few problems by my own.

But now I arrived at step 9 in order to initialize the project.
I should adjust the command

Code: Select all

sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':''}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/ initialsetup
So I did. But it results in

Code: Select all

django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "", user "mayan", database "mayan"
As I have no clue about postgresql I googled it and found my pg_hba.conf in /etc/postgresql/9.6/main
In it the config says:

Code: Select all

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

# test für mayan
host    all             all                  md5
I do not know why these entries are not sufficient. Can you please help with some advice?

Re: Problem initializing project, postgresql related

Posted: Sun Apr 05, 2020 8:11 pm
by MBerlin
I would still appreciate help.

Re: Problem initializing project, postgresql related

Posted: Tue Apr 07, 2020 6:46 am
by MBerlin
Dear all

I finally figured it out. Might be rather exotic, but perhaps it can help someone else in the future, too. Was getting this pg_hba.conf error again and again. And finally I realized that Mayan was connecting to another database.

I was working in a chroot environment. The host OS also had a postgresql server running for some internal services. Therefore I set up a chroot internal server running on a different port. I did not think about it first, but when I tried to connect manually with or without a port specified using psql I finally saw that without a given port the usual port was used. And of course there was no corresponding entry in the pg_hba.conf.

However, I also could not find something in the install documentation how to specify a different port for the postgresql server. Finally I did something that must be terrible from the point of view of an experienced developer and hard coded the port into the of the python postgresql driver. And then the install script ran smoothly.