[SOLVED] Problem initializing project, postgresql related

When things don't work as they should.
Post Reply
MBerlin
Posts: 10
Joined: Fri Apr 03, 2020 9:12 am

[SOLVED] Problem initializing project, postgresql related

Post 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 https://docs.mayan-edms.com/chapters/deploying.html 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':'127.0.0.1'}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py initialsetup
So I did. But it results in

Code: Select all

django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "127.0.0.1", 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             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

# test für mayan
host    all             all             0.0.0.0/0               md5
I do not know why these entries are not sufficient. Can you please help with some advice?
Thanks!
Last edited by MBerlin on Tue Apr 07, 2020 6:48 am, edited 1 time in total.

MBerlin
Posts: 10
Joined: Fri Apr 03, 2020 9:12 am

Re: Problem initializing project, postgresql related

Post by MBerlin »

I would still appreciate help.

MBerlin
Posts: 10
Joined: Fri Apr 03, 2020 9:12 am

Re: Problem initializing project, postgresql related

Post 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 __init__.py of the python postgresql driver. And then the install script ran smoothly.

Post Reply