Device-profile TTN Import - PostgreSQL Error

I’m trying to follow this article that details how to import TTN device profiles:

I see the following message:

INFO chirpstack::storage: Setting up PostgreSQL connection pool

followed by:

thread ‘main’ panicked at 'called Result::unwrap() on an Err value: Setup PostgreSQL connection pool error

Caused by:
timed out waiting for connection: could not translate host name “$POSTGRESQL_HOST” to address: Name or service not known
', chirpstack/src/
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I’m guessing the issue relates to the “$POSTGRESQL_HOST” how is this set?

Please see Configuration - ChirpStack open-source LoRaWAN® Network Server documentation

You could run:

POSTGRESQL_HOST=localhost chirpstack -c /etc/chirpstack import-ttn-lorawan-devices -d /opt/lorawan-devices

This environment variable is there so that the same example config can be used using Docker (Compose) and for the other packages. Are you using the .deb package? Maybe I should substitute these environment variables automatically on install by the real values (localhost).

1 Like