Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

odoo 10 can't connect to postgres server

Subscribe

Get notified when there's activity on this post

This question has been flagged
configurationdatabasepostgresqlodoo10Odoo10.0
2 Replies
16287 Views
Avatar
zeroun

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 ?


0
Avatar
Discard
Avatar
Thanh Loyal
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.

1
Avatar
Discard
Avatar
Jainesh Shah(Aktiv Software)
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

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
How to fine tune DB connections
configuration database postgresql
Avatar
0
Oct 22
3308
In what step is creating a database, tables and populating with provisional data done in the installation steps? Solved
configuration installation database postgresql
Avatar
Avatar
Avatar
2
May 20
8424
Run odoo 12 with a postgresql user that IS NOT THE DATABASE OWNER
configuration database postgresql permissions odoo12
Avatar
0
Feb 20
2150
How to migrate data from Odoo 10 enterprise with PostgreSQL 9.5 to PostgreSQL 12?
postgresql odoo10
Avatar
Avatar
1
Nov 23
3282
Database Migration
database postgresql
Avatar
Avatar
1
Jul 23
6629
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now