Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
course odoo database community gettingstarted
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
course odoo database community gettingstarted
About this forum
  1. Getting Started
  2. Fòrum

Odoo Community connection to Postgres DB Issues

Subscriure's

Get notified when there's activity on this post

This question has been flagged
databaseconnectiondockercommunityodoo16
1 Respondre
11325 Vistes
Avatar
Joel

I have a deployment of odoo community 16 on kubernetes (microk8s specifically) with postgres db . Both pods are in the same namespace and can communicate, but the odoo pod logs are showing an issue. I dont think this is a kubernetes issue I'm just setting the scene.


I'm assuming I've set this up incorrectly. The logs show this:

Running as user 'root' is a security risk.
2023-07-10 01:02:48,790 1 INFO ? odoo: Odoo version 16.0
2023-07-10 01:02:48,790 1 INFO ? odoo: addons paths: ['/usr/src/app/odoo/addons', '/root/.local/share/Odoo/addons/16.0', '/usr/src/app/addons']
2023-07-10 01:02:48,790 1 INFO ? odoo: database: odoo@postgres-service:5432
2023-07-10 01:02:48,993 1 INFO ? odoo.addons.base.models.ir_actions_report: You need Wkhtmltopdf to print a pdf version of the reports.
2023-07-10 01:02:49,349 1 INFO ? odoo.service.server: HTTP service (werkzeug) running on odoo-58c548cdff-jwvbd:8069
2023-07-10 01:02:53,168 1 ERROR ? odoo.modules.loading: Database odoo not initialized, you can force it with `-i base`
2023-07-10 01:02:53,168 1 INFO ? odoo.modules.registry: Registry loaded in 0.015s
2023-07-10 01:02:53,169 1 ERROR odoo odoo.http: Exception during request handling.
Traceback (most recent call last):
File "/usr/src/app/odoo/http.py", line 1584, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "/usr/src/app/odoo/service/model.py", line 133, in retrying
result = func()
File "/usr/src/app/odoo/http.py", line 1596, in _serve_ir_http
ir_http = self.registry['ir.http']
File "/usr/src/app/odoo/modules/registry.py", line 190, in __getitem__
return self.models[model_name]
KeyError: 'ir.http'

It repeats this error for a while and then starts to show this one:

File "/usr/src/app/odoo/http.py", line 1588, in _serve_db
exc.error_response = self.registry['ir.http']._handle_error(exc)
File "/usr/src/app/odoo/modules/registry.py", line 190, in __getitem__
return self.models[model_name]
KeyError: 'ir.http'
2023-07-10 01:03:08,721 1 INFO odoo werkzeug: 192.168.1.19 - - [10/Jul/2023 01:03:08] "GET /favicon.ico HTTP/1.1" 500 - 2 0.002 0.011
2023-07-10 01:03:49,419 1 ERROR odoo odoo.sql_db: bad query:
SELECT latest_version
FROM ir_module_module
WHERE name='base'

ERROR: relation "ir_module_module" does not exist
LINE 3: FROM ir_module_module
^


My Dockerfile for building Odoo Community 16 from source is this:

# Use a base image with Python and other dependenciesFROMpython:3.9-slim
# Set the working directory in the container

WORKDIR /usr/src/app
# Install build dependencies

RUN apt-getupdate && apt-getinstall-y \

​ ​ ​ ​ ​ ​ ​apt-utils\

​ ​ ​ ​ ​ ​ ​gcc\

​ ​ ​ ​ ​ ​ ​libldap2-dev\

​ ​ ​ ​ ​ ​ ​libsasl2-dev\

​ ​ ​ ​ ​ ​ ​libssl-dev
# Copy the Odoo requirements code into the container

COPY ./odoo/requirements.txt requirements.txt
# Update pip for good measure

RUN pip install --upgradepip
# Avoid pip blowing up by fixing problematic library

RUN pip install psycopg2-binary
# Install Odoo dependencies

RUN pip install -r requirements.txt
# Copy the Odoo source code into the container

COPY ./odoo.
# Enable odoo-bin to be run

RUN chmod u+x /usr/src/app/odoo-bin
# Expose the default Odoo port

EXPOSE8069
# Set the entrypoint command to start Odoo

# This will specify the default addons path and initialise the database and not load any demo data

CMD["/usr/src/app/odoo-bin","--addons-path=/usr/src/app/addons","-iall--without-demo=all"]


When I deploy with microk8s I give both odoo and postgres services the same env variables for db log on and db name etc. (From my deployment.yaml file) I've exec'd into the odoo pod, installed psql and verified that I can connect to the db using the same details that odoo reported when the pod started also:
database: odoo@postgres-service:5432  

env:- name:PGUSERvalue: odoo

name:PGPASSWORDvalue:odoo

​name:PGDATABASEvalue:odoo

​name:PGPORTvalue:5432

​name:PGHOSTvalue:postgres-service

I can't understand the issue here, I had it running on baremetal a few months ago. Any help would be great, I'm hoping it's a silly mistake in my configuration.


Also when I exec into the odoo pod can connect to the PostgreSQL db it seems to connect correctly: 

root@odoo-58c548cdff-hsnlq:/usr/src/app# psql

psql (15.3 (Debian 15.3-0+deb12u1), server 14.8 (Debian 14.8-1.pgdg120+1)) Type "help" for help. 

doo=# \conninfo 

You are connected to database "odoo" as user "odoo" on host "postgres-service" (address "10.152.183.201") at port "5432".

0
Avatar
Descartar
Avatar
Walnut Software Solutions
Best Answer

Hi,
Could you try upgrading base module in your database or try creating a new database from command line and see if this resolves the issue.

Odoo Command-line interface:  https://www.odoo.com/documentation/16.0/developer/reference/cli.html

Thanks & Regards

Walnut Software Solutions

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
please help create database without these errors nonetype and writing errors!
database community gettingstarted
Avatar
Avatar
1
de nov. 25
978
ERROR: relation "ir_module_module" does not exist at character 53
database docker docker-compose
Avatar
Avatar
1
de nov. 22
12810
connecting to online database via client (pgAdmin / dBeaver)
database connection dbeaver
Avatar
0
d’abr. 21
38
Odoo 18 enterprice in Docker
docker
Avatar
Avatar
Avatar
2
de febr. 25
12777
Empresas que presten servicios al Sector Público y Municipal
community
Avatar
0
de gen. 25
7078
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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