When a Dockerized Vapor app gets a “connection refused” error from PostgreSQL, the log provided in Docker Dashboard is not helpful and does not have all the details.
To Reproduce
Build a simple Vapor app (based on the template app) with this Dockerfile and docker-compose.yml.
Observe that there is an error in docker-compose.yml. DATABASE_PORT is specified as 6432, which is the externally visible port. Yet the Dockerized app should use the internal port 5432. With this setup, the app tries to connect to an inaccessible port when running in Docker context.
When you compose this setup, the database containers run fine. The app exits shortly after starting with error code 132.
Docker Dashboard shows this log.
When inspecting the log with Terminal, there is a bit more info and a mention of Connection refused (errno: 111).
Expected behavior
Docker Dashboard should have an indication of the connection error.
The connection error itself could be more helpful and specific.
Environment
Vapor Framework version: 4.45.3
Vapor Toolbox version: 18.3.3
OS version: macOS Big Sur 11.3.1 (20E241)
The text was updated successfully, but these errors were encountered:
Describe the bug
When a Dockerized Vapor app gets a “connection refused” error from PostgreSQL, the log provided in Docker Dashboard is not helpful and does not have all the details.
To Reproduce
Build a simple Vapor app (based on the template app) with this
Dockerfileanddocker-compose.yml.dockerfiles.zip
Observe that there is an error in
docker-compose.yml.DATABASE_PORTis specified as 6432, which is the externally visible port. Yet the Dockerized app should use the internal port 5432. With this setup, the app tries to connect to an inaccessible port when running in Docker context.When you compose this setup, the database containers run fine. The app exits shortly after starting with error code 132.
Docker Dashboard shows this log.
When inspecting the log with Terminal, there is a bit more info and a mention of
Connection refused (errno: 111).Expected behavior
Docker Dashboard should have an indication of the connection error.
The connection error itself could be more helpful and specific.
Environment
The text was updated successfully, but these errors were encountered: