Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Validations
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Épicerie
    • Quincaillerie
    • Magasin de jouets
    Food & Hospitality
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brewery
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Trades
    • Bricoleur
    • Matériel informatique et support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Browse all Industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenez partenaire
    • Services for Partners
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide

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

  • CRM
  • e-Commerce
  • Comptabilité
  • Inventaire
  • PoS
  • Projet
  • MRP
All apps
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
databaseodoodockerodoo12v12
1 Répondre
12448 Vues
Avatar
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
Avatar
Ignorer
Avatar
Paresh Wagh
Meilleure réponse

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

0
Avatar
Ignorer
Steven Deweirt
Auteur

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
Auteur

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 :)

Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
psycopg2.ProgrammingError: no existe la relación «_unknown» Please HELP!!!!
odoo odoo12
Avatar
Avatar
2
nov. 25
260
How to clear cache after change data_dir path
odoo docker
Avatar
Avatar
1
juin 25
12060
clean purchase history
database odoo
Avatar
Avatar
1
mars 24
2457
How to track One2many field in Odoo12? Résolu
odoo odoo12
Avatar
Avatar
Avatar
Avatar
3
nov. 23
18458
Error: Couldn't load module web Résolu
odoo odoo12
Avatar
Avatar
Avatar
3
nov. 24
26552
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenez partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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