Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Psycopg2 error: Cannot connect to database using Docker in Odoo 12

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
databaseodoodockerodoo12v12
1 Răspunde
12449 Vizualizări
Imagine profil
Steven Deweirt

So I'm trying to start run my Odoo project. This has always worked in the past, but for some reason, afer restarting the host computer, it's giving me an error when I try to start up the project. I didn't change anything related to configuration so I'm stunned as to why it's giving me this error.

Here is the error:

2019-08-06 12:03:34,199 1 INFO ? odoo.sql_db: Connection to the database failed 
odoo_1  | 2019-08-06 12:03:34,202 1 INFO ? werkzeug: 192.168.0.249 - - [06/Aug/2019 12:03:34] "POST /longpolling/poll HTTP/1.1" 500 - 0 0.000 0.007
odoo_1  | 2019-08-06 12:03:34,209 1 ERROR ? werkzeug: Error on request:
odoo_1  | Traceback (most recent call last):
odoo_1  |   File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
odoo_1  |     execute(self.server.app)
odoo_1  |   File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 193, in execute
odoo_1  |     application_iter = app(environ, start_response)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 409, in app
odoo_1  |     return self.app(e, s)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 128, in application
odoo_1  |     return application_unproxied(environ, start_response)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 117, in application_unproxied
odoo_1  |     result = odoo.http.root(environ, start_response)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1318, in __call__
odoo_1  |     return self.dispatch(environ, start_response)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1291, in __call__
odoo_1  |     return self.app(environ, start_wrapped)
odoo_1  |   File "/usr/lib/python3/dist-packages/werkzeug/wsgi.py", line 599, in __call__
odoo_1  |     return self.app(environ, start_response)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1451, in dispatch
odoo_1  |     self.setup_db(httprequest)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1374, in setup_db
odoo_1  |     httprequest.session.db = db_monodb(httprequest)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1535, in db_monodb
odoo_1  |     dbs = db_list(True, httprequest)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/http.py", line 1502, in db_list
odoo_1  |     dbs = odoo.service.db.list_dbs(force)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/service/db.py", line 375, in list_dbs
odoo_1  |     with closing(db.cursor()) as cr:
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 657, in cursor
odoo_1  |     return Cursor(self.__pool, self.dbname, self.dsn, serialized=serialized)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 171, in __init__
odoo_1  |     self._cnx = pool.borrow(dsn)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 540, in _locked
odoo_1  |     return fun(self, *args, **kwargs)
odoo_1  |   File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 608, in borrow
odoo_1  |     **connection_info)
odoo_1  |   File "/usr/local/lib/python3.5/dist-packages/psycopg2/__init__.py", line 126, in connect
odoo_1  |     conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
odoo_1  | psycopg2.OperationalError: could not translate host name "db" to address: Name or service not known - - -

My dockerfile


USER root

RUN pip3 install qrcode xlrd==1.2.0 xlwt XlsxWriter
RUN pip3 install --upgrade pip
RUN apt update && apt install -y cups libcups2-dev python3-dev patch && pip3 install pycups
RUN pip install psycopg2-binary
RUN apt-get update

USER odoo

My docker-compose


version: '2'
services:
db:
image: postgres:10
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
odoo:
build: .
depends_on:
- db
ports:
- "80:8069"
volumes:
- ./odoo.conf:/etc/odoo/odoo.conf
- .:/mnt/repo
- ./generator3.py:/opt/.pycharm_helpers/generator3.py

Thanks in advance for any help!

0
Imagine profil
Abandonează
Imagine profil
Paresh Wagh
Cel mai bun răspuns

Hi Brent: Your database container may not have started. Type in docker ps and see if the container db has started. 

0
Imagine profil
Abandonează
Steven Deweirt
Autor

Hi, the docker container was running. I started the program up today and the it worked, but it doesn't find back my db anymore? any tips?

Steven Deweirt
Autor

Scratch that, ended up having to restore my previous backup of the database to make it work. Probably should've taken a snapshot before trying stuff :)

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

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
psycopg2.ProgrammingError: no existe la relación «_unknown» Please HELP!!!!
odoo odoo12
Imagine profil
Imagine profil
2
nov. 25
260
How to clear cache after change data_dir path
odoo docker
Imagine profil
Imagine profil
1
iun. 25
12060
clean purchase history
database odoo
Imagine profil
Imagine profil
1
mar. 24
2457
How to track One2many field in Odoo12? Rezolvat
odoo odoo12
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
nov. 23
18458
Error: Couldn't load module web Rezolvat
odoo odoo12
Imagine profil
Imagine profil
Imagine profil
3
nov. 24
26552
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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