Skip to content

Unable to connect to Postgres container on EC2 instance #814

@agundu-mdsol

Description

@agundu-mdsol

Hi,
We have setup an EC2 instance where we installed docker and required containers. We are using this EC2 instance as a codebuild executor. Once the code pushes to GIT it will trigger the codebuild where the containers will be used to reproduce an actual execution scenario.

Our issue is, except postgres all other containers are accepting connections from external systems. We checked the inbound and outbound rules where the port 5432 is allowed for access. when we checked on the EC2 node, we are seeing that 5432 port is in LISTEN state. we are not able to figure out this. Appreciate if we get some help. Thanks

2021-02-05 12:28:14.348 UTC [1] LOG: starting PostgreSQL 13.1 (Debian 13.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
2021-02-05 12:28:14.348 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2021-02-05 12:28:14.348 UTC [1] LOG: listening on IPv6 address "::", port 5432
2021-02-05 12:28:14.356 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2021-02-05 12:28:14.365 UTC [63] LOG: database system was shut down at 2021-02-05 12:28:14 UTC
2021-02-05 12:28:14.375 UTC [1] LOG: database system is ready to accept connections

I am able to connect from host machine to container using psql cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions