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

I have a docker-compose file with two services: odoo:latest and postgres:13.

I try to update app list in debug mode http://localhost:8070/web?debug=1  

but nothing happens. 
myodoo service has volumes section:

volumes:
- ./extra-addons:/mnt/extra-addons
- data:/var/lib/odoo
- ./config:/etc/odoo


that corresponds to a this directory:

.
├── config
│   └── odoo.conf
├── custom
│   └── estate
│       ├── __init__.py
│       └── __manifest__.py
├── docker-compose.yml
└── extra-addons
    ├── __init__.py
    └── __manifest__.py
Content of of oodo.conf file:
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
-------------


Content of __manifest.py__


{
'name': 'estate',
'depends': [
'base_setup',
],
"installable": True,
"application": True,
"auto_install": False,
}

I also tried to update app list in the terminal.
When I exec in odoo service and issue this command:

/usr/bin/odoo -p 8071 --db_host=172.17.0.2 --db_user=odoo --db_password=odoo -d odoo -u estate

I get:

2022-11-05 15:31:18,096 82 INFO ? odoo: Odoo version 16.0-20221025 

2022-11-05 15:31:18,098 82 INFO ? odoo: Using configuration file at /etc/odoo/odoo.conf 

2022-11-05 15:31:18,098 82 INFO ? odoo: addons paths: ['/usr/lib/python3/dist-packages/odoo/addons', '/var/lib/odoo/addons/16.0', '/mnt/extra-addons'] 

2022-11-05 15:31:18,098 82 INFO ? odoo: database: odoo@172.17.0.2:default 

2022-11-05 15:33:28,763 82 INFO ? odoo.sql_db: Connection to the database failed 

Traceback (most recent call last):

  File "/usr/bin/odoo", line 8, in

    odoo.cli.main()

  ...

  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 638, in borrow

    result = psycopg2.connect(

  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 127, in connect

    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)

psycopg2.OperationalError: connection to server at "172.17.0.2", port 5432 failed: Connection timed out

Is the server running on that host and accepting TCP/IP connections?


THANK YOU!

Avatar
Discard
Best Answer

I noticed two things:

  1. The /custom directory is not specified as volume in docker-compose.yml. Usually you place the /estate directory in the /extra-addons directory.
  2. When trying to connect with the postgres database I suggest you use the container name. So you would use 'postgres' as hostname in the example below:
services:

postgres:
image: postgres:13
odoo:
image: odoo:latest
environment:
HOST: postgres
USER: username
PASSWORD: password

I would also advise to specify the tag (i.e., odoo:16) for the container instead of 'latest'. This will avoid problems for later updates (Odoo v17 or later).

I hope this helps.


Avatar
Discard
Related Posts Replies Views Activity
1
Nov 20
4589
6
Jun 20
19655
0
Jun 20
8862
2
Dec 24
96
2
Oct 23
4276