Skip to Content
Menu
This question has been flagged

Hi, I have a problem with postgres connection. Please, can any one help me ?

I am deploying an odoo 10 app in my Ubuntu 16.04 server.

I get this error when trying to open the odoo web page :

Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]: 2017-12-29 19:13:49,805 8336 INFO ? werkzeug: 54.36.99.87 - - [29/Dec/2017 19:13:49] "GET /favicon.ico HTTP/1.1" 500 -
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]: 2017-12-29 19:13:49,812 8336 ERROR ? werkzeug: Error on request:
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]: Traceback (most recent call last):
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 180, in run_wsgi
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     execute(self.server.app)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 168, in execute
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     application_iter = app(environ, start_response)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/service/server.py", line 249, in app
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return self.app(e, s)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/service/wsgi_server.py", line 186, in application
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return application_unproxied(environ, start_response)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/service/wsgi_server.py", line 172, in application_unproxied
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     result = handler(environ, start_response)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1308, in __call__
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return self.dispatch(environ, start_response)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1282, in __call__
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return self.app(environ, start_wrapped)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 591, in __call__
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return self.app(environ, start_response)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1446, in dispatch
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     self.setup_db(httprequest)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1368, in setup_db
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     httprequest.session.db = db_monodb(httprequest)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1530, in db_monodb
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     dbs = db_list(True, httprequest)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/http.py", line 1498, in db_list
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     dbs = odoo.service.db.list_dbs(force)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/service/db.py", line 333, in list_dbs
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     with closing(db.cursor()) as cr:
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/sql_db.py", line 635, in cursor
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/sql_db.py", line 177, in __init__
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     self._cnx = pool.borrow(dsn)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/sql_db.py", line 518, in _locked
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     return fun(self, *args, **kwargs)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/opt/odoo/odoo-10.0/odoo/sql_db.py", line 586, in borrow
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     **connection_info)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:   File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]:     conn = _connect(dsn, connection_factory=connection_factory, async=async)
Dec 29 20:13:49 vpsxxxxxx odoo-bin[8336]: OperationalError: fe_sendauth: no password supplied

I am using this configuration file :

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = localhost
db_port = 5432
db_user = odoo
db_password = False
addons_path = /opt/odoo/odoo-10.0/addons


* I've set a password to odoo user and changed db_password to 12345 I get :

Dec 29 20:37:33 vps459020 odoo-bin[8732]: OperationalError: FATAL:  password authentication failed for user "odoo"
Dec 29 20:37:33 vps459020 odoo-bin[8732]: FATAL: password authentication failed for user "odoo"

When try to log to psqgl with odoo user :

postgres@vpsxxxxxx:~$ psql -U odoo
psql: FATAL:  Peer authentication failed for user "odoo"


The pg_hba.conf file contains these lines :

# TYPE  DATABASE        USER            ADDRESS                 METHOD

local   all             postgres                                    peer
# "local" is for Unix domain socket connections only
local   all             all                                                peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5

# trying to allow odoo user
local   all             odoo                                            md5
# IPv6 local connections:
host    all             all             ::1/128                      md5


What is wrong with my configuration ?


Avatar
Discard
Best Answer

For development environment at my laptop, I always configure postgres to allow local connection, without asking for password.

local   all             odoo      trust    # Yeah, replace your 'md5' with 'trust'

and put this line on top of your code snippet in pg_hba.conf.
Remember, this is for development only. In a production deployment, you should learn how postgres authentication works and configure it properly.

Avatar
Discard
Best Answer

Hello Zeroun, 

You can solve this problem using restart postgresql service.

Following command to restart postgresql service in Ubuntu  : sudo service postgresql restart 

Hope this will help you.

Regards,
ARS

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 22
1529
2
May 20
6413
0
Feb 20
2150
1
Nov 23
1119
1
Jul 23
4607