tryton with postgresql on another server & permissions


A little follow-up to my post about setting up tryton on Gentoo:

If you run postgresql on a different server you need to deal with setting up the permissions on the postgresql side.

What I was not aware of at that time is that trytond (not trytond-admin it seems) requires access to the template1 database too.

For some reason Trytond did silently fail to start. The only log messages I did see were of level INFO about connecting to template1:

Sat Jul 14 13:17:44 2018] INFO:trytond.backend.postgresql.database:connect to "template1"
Sat Jul 14 13:17:44 2018] INFO:werkzeug: - - [14/Jul/2018 13:17:44] "POST / HTTP/1.1" 200 -
Sat Jul 14 13:17:44 2018] INFO:werkzeug: - - [14/Jul/2018 13:17:44] "POST / HTTP/1.1" 200 -

so you need to set that up in your pg_hba.conf too. To give an example:

# TYPE  DATABASE        USER            ADDRESS                 METHOD
host    trytond         trytond         192.168.0.X/0          scram-sha-256
host    template1       trytond         192.168.0.X/0          scram-sha-256

As you can see I give the trytond user access to the trytond database (and in the next line to template1 too). For some reason trytond-admin does not require this, but it would be nice if trytond did log about not getting access to "template".

Of course it needs to be set up to accept connections on the tcp/ip port you set up in postgresql.conf.

Currently unrated


There are currently no comments

New Comment


required (not published)