2

I am trying to run Odoo using docker-compose. I have followed the instructions here. I can start the Postgres and Odoo servers using Docker and access the Odoo server correctly. When I run the first 'simplest' docker-compose example, it appears to start the Postgres server correctly but after a few minutes an error message appears from the web server:

    Attaching to testdocker_db_1, testdocker_web_1
db_1   | 
db_1   | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1   | 
db_1   | 2022-09-01 14:54:47.015 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_1   | 2022-09-01 14:54:47.016 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2022-09-01 14:54:47.016 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2022-09-01 14:54:47.021 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2022-09-01 14:54:47.027 UTC [26] LOG:  database system was shut down at 2022-09-01 14:54:22 UTC
db_1   | 2022-09-01 14:54:47.033 UTC [1] LOG:  database system is ready to accept connections
web_1  | Database connection failure: connection to server at "db" (172.21.0.2), port 5432 failed: Connection timed out
web_1  |    Is the server running on that host and accepting TCP/IP connections?
web_1  | 
testdocker_web_1 exited with code 1

The docker-compose.yml is copied exactly from the docker hub page except that I noticed I have Postgresql v14 installed so I have changed the postgres image:

version: '3.1'
services:
  web:
    image: odoo:15.0
    depends_on:
      - db
    ports:
      - "8069:8069"
  db:
    image: postgres:14
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_USER=odoo
kpg
  • 7,644
  • 6
  • 34
  • 67
  • Are you able to access the path using curl/wget? ERR_SOCKET_NOT_CONNECTED could occur due to issues with the browser itself, rather than the server. –  Sep 01 '22 at 04:31
  • I tried exactly the code you posted and it works as expected, no issues. Run it with `docker-compose up` only so that you can see any errors. Check the logs and make sure both service are running. I would also suggest the same thing as @s3vt – Mihai Sep 01 '22 at 06:15
  • Check your proxy settings in firefox that they are turned off – OpenBSDNinja Sep 01 '22 at 11:37
  • Tried with curl: curl: (7) Failed to connect to localhost port 8069 after 0 ms: Connection refused – kpg Sep 01 '22 at 11:41
  • Also tried rebooting the system but no change. – kpg Sep 01 '22 at 11:53
  • Have tried Firefox and Vivaldi browsers – kpg Sep 01 '22 at 12:02
  • No proxy settings in browser – kpg Sep 01 '22 at 12:03

1 Answers1

0

I had installed Docker on my Linux Mint 21 system using snap. I did that because the installation instructions here didn't work on my system.

I have now been able to install the Docker Debian packages and this problem is solved.

In order to get the Debian package to install correctly,I changed:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

To:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  jammy stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
kpg
  • 7,644
  • 6
  • 34
  • 67