This question has been flagged
3 Replies
4033 Views

I have installed odoo and set up a database on my database server,

however, when odoo starts it tries to access the incorrect database name.

The database I have created is on host 10.0.1.10 and is called "odoo".  I can connect to it from the terminal on the odoo server.

But as you can see from the log, odoo is trying to access a database called "postgres", not "odoo".

OperationalError: FATAL:  no pg_hba.conf entry for host "10.0.1.10", user "odoo", database "postgres", SSL on

FATAL:  no pg_hba.conf entry for host "10.0.1.10", user "odoo", database "postgres", SSL off

I have set up my config correctly as far as I can see, but odoo seems to ignore the db_name option.

any ideas?

[options]
; This is the password that allows database operations:
admin_passwd = mypassword
db_host = 10.0.1.10
db_name = odoo
db_port = 5432
db_user = odoo
db_password = mydbpassword
addons_path = /usr/lib/python2.7/dist-packages/openerp/addons

Avatar
Discard
Best Answer

Figure out what username you use to start your odoo server. Check out the logs. It should be the owner of your database.

Avatar
Discard
Best Answer

I know it's an old topic, but I still have the same problem on the current odoo 17.

I'm running a dedicated postgres server and created one database there for odoo. I have set the connections to the server in the odoo.conf file

db_host = postgresql.my.domain

db_port = 5432

db_user = odoo_cc

db_password = MyPasswd

addons_path = /usr/lib/python3/dist-packages/odoo/addons

db_name = odoo_demo

Obviously it is failing with the error message, that there is access to the "posthres" database.

failed: FATAL:  no pg_hba.conf entry for host "192.168.33.40", user "odoo_cc", database "postgres", no encryption


How do I need to configure odoo, if I want to fix it to one single database and what steps do I need to apply to initialize that database (if that is even necessary).

Since I'm currently experimenting with odoo, I'm still on the community edition, but planning to change to enterprise soon. I just want to have it under my own control.


Avatar
Discard
Author Best Answer

Thanks for the suggestion, but I don't think that is the issue. 

The database user name is correct (as tested using psql -U odoo -W odoo -h 10.0.1.10)

The probelm from the logs is thaty odoo is trying to connect to the database named "postgres", which it does not and should not have permission to.  It is ignoring the directive to connect to db_name = odoo

My database server runs a database for a number of different programs and they should be segregated, connecting to the "postgres" database allows changing of usernames and passwords, not a good move for security.

Perhaps on first run, odoo is trying to create a database and wanting to access the user table?  However, I have already created a database.

 

Avatar
Discard