Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
course odoo database community gettingstarted
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
course odoo database community gettingstarted
Om dette forum
  1. Getting Started
  2. Forum

Odoo Community connection to Postgres DB Issues

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
databaseconnectiondockercommunityodoo16
1 Svar
11338 Visninger
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
Kassér
Avatar
Walnut Software Solutions
Bedste svar

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
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
please help create database without these errors nonetype and writing errors!
database community gettingstarted
Avatar
Avatar
1
nov. 25
984
ERROR: relation "ir_module_module" does not exist at character 53
database docker docker-compose
Avatar
Avatar
1
nov. 22
12810
connecting to online database via client (pgAdmin / dBeaver)
database connection dbeaver
Avatar
0
apr. 21
38
Odoo 18 enterprice in Docker
docker
Avatar
Avatar
Avatar
2
feb. 25
12777
Empresas que presten servicios al Sector Público y Municipal
community
Avatar
0
jan. 25
7078
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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