Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

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

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
databaseodoodockerodoo12v12
1 Rispondi
12445 Visualizzazioni
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
Abbandona
Avatar
Paresh Wagh
Risposta migliore

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

0
Avatar
Abbandona
Steven Deweirt
Autore

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
Autore

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

Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
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
giu 25
12060
clean purchase history
database odoo
Avatar
Avatar
1
mar 24
2457
How to track One2many field in Odoo12? Risolto
odoo odoo12
Avatar
Avatar
Avatar
Avatar
3
nov 23
18458
Error: Couldn't load module web Risolto
odoo odoo12
Avatar
Avatar
Avatar
3
nov 24
26552
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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