ChirpStack FUOTA Server - Persistent PostgreSQL Connection Refused Error in Docker Compose

Hello Docker Community,

I’m encountering a persistent connection issue while trying to run ChirpStack FUOTA Server with PostgreSQL in a Docker Compose environment. Here are the key details:

Environment:

Issue Description: When launching the containers, the ChirpStack FUOTA Server repeatedly fails to connect to the PostgreSQL database. The error logs consistently show:

level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" 
error="dial tcp [::1]:5432: connect: connection refused"

Troubleshooting Steps Already Attempted:

  1. Verified PostgreSQL container is running
  2. Checked network configurations
  3. Confirmed database user, password, and connection strings match
  4. Tried different Docker Compose network configurations

Docker Compose Configuration:

services:
  chirpstack-fuota-server:
    volumes:
      - /usr/bin/chirpstack-fuota-server:/usr/bin/chirpstack-fuota-server
      - /etc/chirpstack-fuota-server:/etc/chirpstack-fuota-server
    environment:
      - TEST_POSTGRES_DSN=postgres://chirpstack_fuota:chirpstack_fuota@postgres/chirpstack_fuota?sslmode=disable

  postgres:
    image: postgres:9.6-alpine
    environment:
      - POSTGRES_USER=chirpstack_fuota
      - POSTGRES_PASSWORD=chirpstack_fuota
      - POSTGRES_DB=chirpstack_fuota

Specific Questions:

  • What could be causing the connection to be refused specifically to [::1]:5432?
  • Are there any known networking quirks with Docker Compose that might prevent PostgreSQL connections?
  • How can I definitively diagnose the root cause of this connection issue?

Any guidance or insights would be greatly appreciated. I’m happy to provide additional logs or configuration details if needed.

Thank you in advance for your help!

Best regards,
Pratham

[::1] basically means localhost in IPv6, so it would only make sense in a healthcheck in the postgres container. I have no idea why it pings postgres on localhost

@rimelek ,
Thank you for your response.
The problem is with the docker-compose.yml file, that I have solved.