odoo / docker

Other
932 stars 1.52k forks source link

odoo command inside docker image OSError #374

Closed DanielLagin closed 2 years ago

DanielLagin commented 3 years ago

Hi,

I have tried to run odoo-bin command inside docker but I ended up with error:

Traceback (most recent call last): File "/usr/bin/odoo", line 8, in odoo.cli.main() File "/usr/lib/python3/dist-packages/odoo/cli/command.py", line 60, in main o.run(args) File "/usr/lib/python3/dist-packages/odoo/cli/server.py", line 178, in run main(args) File "/usr/lib/python3/dist-packages/odoo/cli/server.py", line 172, in main rc = odoo.service.server.start(preload=preload, stop=stop) File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 1287, in start rc = server.run(preload, stop) File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 852, in run self.start() File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 823, in start self.socket.bind(self.address) OSError: [Errno 98] Address already in use

Steps to reproduce:

  1. docker ps
  2. docker exec -u 0 -it odoo_container_name bash
  3. odoo

Docker-compose:

version: '2' services: web-test: restart: always image: odoo:13.0

command: -u all

depends_on:
  - db-test
ports:
  - "8069:8069"
  - "8072:8072"
volumes:
  - ./config:/etc/odoo
  - ./addons:/mnt/extra-addons
  - ./backups:/var/tmp  

db-test: restart: always image: postgres:10 environment:

Thanks.

llacroix commented 3 years ago

It's not an issue with the image more likely. If you start the container, it should start odoo. When you enter the container using docker exec, you'll be in the same container as the running odoo Calling odoo using odoo inside the same container will attempt to spawn odoo on the same port. Since the port is already in the container, it will cause this error.

You can try to start odoo on a different port or call it as such: odoo --no-http

Or you could override the entrypoint/command to not start odoo so calling docker exec odoo would work as normal.

nrome-n commented 1 year ago

Hi i tried odoo --no-http -u name but i am getting psycopg2.OperationalError: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?