Skip to Content
Menu
This question has been flagged
1 Reply
1819 Views

Hi, 

I am trying to test odoo deployment under docker on my testing PC without reverse proxy. After `docker-compose up`, I get the following error: `ERROR: relation "ir_module_module" does not exist at character 53`, and the browser at `https://localhost:8069/` says approximately: `Secure connexion failure - error while connecting to localhost:8069. PR_END_OF_FILE_ERROR`.


The terminal where I have launched `docker-compose up` logs:

db    | PostgreSQL init process complete; ready for start up.
db |
db | 2022-09-11 16:52:28.526 UTC [1] LOG: starting PostgreSQL 14.5 (Debian 14\\.5\\-1\\.pgdg110\\+1\\)\\ on\\ x86_64\\-pc\\-linux\\-gnu,\\ compiled\\ by\\ gcc\\ \\(Debian\\ 10\\.2\\.1\\-6\\)\\ 10\\.2\\.1\\ 20210110,\\ 64\\-bit
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:52:28\\.526\\ UTC\\ \\[1\\]\\ LOG:\\ \\ listening\\ on\\ IPv4\\ address\\ "0\\.0\\.0\\.0",\\ port\\ 5432
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:52:28\\.526\\ UTC\\ \\[1\\]\\ LOG:\\ \\ listening\\ on\\ IPv6\\ address\\ "::",\\ port\\ 5432
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:52:28\\.529\\ UTC\\ \\[1\\]\\ LOG:\\ \\ listening\\ on\\ Unix\\ socket\\ "/var/run/postgresql/\\.s\\.PGSQL\\.5432"
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:52:28\\.534\\ UTC\\ \\[62\\]\\ LOG:\\ \\ database\\ system\\ was\\ shut\\ down\\ at\\ 2022\\-09\\-11\\ 16:52:28\\ UTC
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:52:28\\.541\\ UTC\\ \\[1\\]\\ LOG:\\ \\ database\\ system\\ is\\ ready\\ to\\ accept\\ connections
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:53:35\\.060\\ UTC\\ \\[76\\]\\ ERROR:\\ \\ relation\\ "ir_module_module"\\ does\\ not\\ exist\\ at\\ character\\ 53
db\\ \\ \\ \\ \\|\\ 2022\\-09\\-11\\ 16:53:35\\.060\\ UTC\\ \\[76\\]\\ STATEMENT:\\ \\
db\\ \\ \\ \\ \\|\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ SELECT\\ latest_version
db\\ \\ \\ \\ \\|\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ FROM\\ ir_module_module
db\\ \\ \\ \\ \\|\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ WHERE\\ name='base'

There\ is\ something\ interesting\ here, but it has changed nothing to the result for me:


Error about db not initialized may still show up when using volume:
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata # removing this volume removes the error
Somehow got it to work by:
docker-compose exec web bash
odoo -i base -d odoo --stop-after-init --db_host=db -r odoo -w odoo
...
re-up using docker-compose

Here is my `docker-compose.yml`:

version: '3.9'
services:
odoo:
container_name: odoo
image: odoo:15.0
volumes:
- ./extra-addons:/opt/odoo/extra-addons
- ./etc:/etc/odoo
- odoo-web-data:/var/lib/odoo
ports:
- "8069:8069"
depends_on:
- db
environment:
- PASSWORD_FILE=/run/secrets/postgresql_password
secrets:
- postgresql_password
restart: always
db:
container_name: db
image: postgres:14
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
- POSTGRES_USER=glopibuf
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
secrets:
- postgresql_password
ports:
- 5432:5432
restart: always
volumes:
odoo-web-data:
odoo-db-data:

secrets:
postgresql_password:
file: odoo_pg_pass

and my `odoo.conf`:

[options]
db_host = db
db_user = glopibuf
db_name = postgres
db_template = template0
db_maxconn = 64
db_filter = ^xxxxxx.*$
db_sslmode = allow
logfile = /var/log/odoo/openerp-server.log
logrotate = True
log-db = False
syslog = False
log-level = warn
interface = localhost
port = 8069
secure = True
proxy_mode = False
addons_path = /opt/odoo/extra-addons,/opt/openerp/odoo/addons,/home/myaddons
timezone = Europe/Paris
secure_cert_file = server.cert
secure_pkey_file = server.pkey
xmlrpcs = False
xmlrpcs_interface = 127.0.0.1
xmlrpcs_port = 8071
xmlrpc = False
xmlrpc_interface = 127.0.0.1
xmlrpc_port = 8069
longpolling_port = 8072
import_partial =
unaccent = False
translate_modules = ['all']
server_wide_modules = None
smtp_server = localhost
smtp_user = False
smtp_password = False
smtp_ssl = False
email_from = "xxx@yyy.com"
smtp_port = 25
workers = 1
max_cron_threads = 1
limit_time_cpu = 60
limit_time_real = 170
limit_memory_soft = 255652815
limit_memory_hard = 1395864371
limit_request = 8196
osv_memory_count_limit = False
osv_memory_age_limit = 1.0
test_enable = False
test_file = False
test_report_directory = False
test_commit = False
without_demo = none

Here is the project tree:

.
├── docker-compose.yml
├── etc
│   └── odoo.conf
├── extra-addons
├── odoo_pg_pass








Avatar
Discard
Best Answer

Hi,

Try to change your docker-composer.yaml file like below

version: '3'
services:
odoo:
image: odoo:15.0 #image of the odoo
env_file: .env #environment file(contains odoo environment)
depends_on:
- postgres
ports:
- "8000:8069" #port mapping
Volumes: #mapping directory
- data:/var/lib/odoo
- ./config:/etc/odoo 
- ./extra-addons:/mnt/extra-addons
postgres: 
image: postgres:13 #postgres image
env_file: .env #environment file(contains postgres environment)
volumes:
- db:/var/lib/postgresql/data/pgdata

volumes:
data:
db:

Try to create an .env file with following configuration.

#psql environment variable
POSTGRES_DB=postgres
POSTGRES_PASSWORD=odoo
POSTGRES_USER=odoo15
PGDATA=/var/lib/postgresql/data/pgdata
#odoo environment variables
HOST=postgres
USER=odoo15
PASSWORD=odoo

For any further reference visit following link

https://www.cybrosys.com/blog/odoo-14-deployment-using-docker

Regards

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
1341
1
Aug 23
1650
1
Jan 23
1255
1
Oct 24
137
1
Aug 24
452