Device-profile TTN Import - PostgreSQL Error

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

https://www.chirpstack.io/docs/chirpstack/features/device-profile-templates.html

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/main.rs:125:14
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