odoo / odoo/docker

Cannot work with external databases i.e. AWS RDS Postgres

Open
#297 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
1.2k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

The Environment variable HOST is not working properly:

$ docker run -p 8069:8069 --name odoo -t odoo -e HOST=3.82.97.29 -e PORT=5432 -e USER=XXXXXXXX -e PASSWORD=XXXXXXXXXXXXXXX
Unable to find image 'odoo:latest' locally
latest: Pulling from library/odoo
bc51dd8edc1b: Pull complete
65612bcd6c31: Pull complete
0a59b34b423f: Pull complete
c777e556ebc3: Pull complete
d82a3171af1a: Pull complete
c1fdba9aca9c: Pull complete
7cf602847309: Pull complete
e7e56222b439: Pull complete
424f1ae3150f: Pull complete
Digest: sha256:41c93959d1ff41266fd0d26f58bec3361120268c3f54e66958b2c12fec2083e2
Status: Downloaded newer image for odoo:latest
Database connection failure: could not translate host name "db" to address: Name or service not known

like somehow this code:
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}

is not working properly in the entrypoint script, for start I see an error envolving DB_PORT_5432_TCP_ADDR (Wherever its value comes from) into the HOST definition

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the entrypoint script that contains the HOST, PORT, USER, and PASSWORD defaults, then reproduce the documented docker run command against AWS RDS PostgreSQL. Trace why HOST resolves to db instead of the supplied address and verify that the external connection succeeds without relying on DB_PORT_5432_TCP_ADDR.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker, postgresql, shell
Domain
databases, devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.