ChirpStack FUOTA Server – PostgreSQL Connection Refused Issue

Hello ChirpStack Community,

I’m trying to set up FUOTA using the ChirpStack FUOTA server, but I’m facing an issue with the PostgreSQL connection. Here’s what I’ve done so far:

  1. Successfully built the LoRaWAN_FUOTA project from the stm32cube_wl_fw_v1.3.0 library provided by STMicroelectronics.
  2. Installed the ChirpStack FUOTA server from the GitHub repository and ran it using Docker. The containers seem to start properly:
sudo docker compose up -d
[+] Running 3/3
✔ Network chirpstack-fuota-server_default                   Created
✔ Container chirpstack-fuota-server-postgres-1                 Started
✔ Container chirpstack-fuota-server-chirpstack-fuota-server-1  Started

However, when I run the main.go script for the fuota deployment, it gets stuck after downloading dependencies:

go: downloading golang.org/x/text v0.3.3

Checking the FUOTA server container logs shows the following error repeatedly:

chirpstack-fuota-server-1  | time="2025-03-25T05:12:02Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:04Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:06Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:08Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:10Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:12Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:14Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:16Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:18Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"
chirpstack-fuota-server-1  | time="2025-03-25T05:12:20Z" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="dial tcp [::1]:5432: connect: connection refused"

I verified that the PostgreSQL container is running, but the FUOTA server still fails to connect.

Has anyone faced a similar issue or can provide guidance on resolving this? I’d appreciate any help or pointers to get this working.

Thank you!

Best regards,
Pratham

The address is probably wrong, since it keeps trying to connect to localhost?

Hey @sp193,

Thank you for your response!

I investigated further and found that the issue was with the Dockerfile. After making the necessary fixes, the problem is now resolved.

I appreciate your help!