Chirpstack Docker compose on RaspberryPi4

Trying to install the ChirpStack on a Raspberrypi4 according to the description: Quickstart Docker Compose - ChirpStack open-source LoRaWAN<sup>®</sup> Network Server. I already have two docker containers running on the Raspberrypi using port 1883 and 8080 externally so I did the following changes to the docker-compose.yml file:

chirpstack-application-server:
image: chirpstack/chirpstack-application-server:3
ports:
- 8090:8080

mosquitto:
image: eclipse-mosquitto:2
ports:
- 1884:1883

Is that the right way to handle this situation?
I get a errors when running docker-compose:

postgresql_1 |
postgresql_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgresql_1 |
postgresql_1 | LOG: startup process (PID 20) was terminated by signal 11: Segmentation fault
postgresql_1 | LOG: aborting startup due to startup process failure
postgresql_1 | LOG: database system is shut down
mosquitto_1 | 1630228978: mosquitto version 2.0.11 starting
mosquitto_1 | 1630228978: Config loaded from /mosquitto/config/mosquitto.conf.
mosquitto_1 | 1630228978: Opening ipv4 listen socket on port 1883.
chirpstack-docker_postgresql_1 exited with code 1
mosquitto_1 | 1630228978: Opening ipv6 listen socket on port 1883.
mosquitto_1 | 1630228978: mosquitto version 2.0.11 running
redis_1 | 1:C 12 Apr 2071 12:04:24.000 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1 | 1:C 12 Apr 2071 12:04:24.000 # Redis version=5.0.13, bits=32, commit=00000000, modified=0, pid=1, just started
redis_1 | 1:C 12 Apr 2071 12:04:24.000 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1 | 1:M 12 Apr 2071 12:00:56.000 # Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ‘noeviction’ policy now.
chirpstack-network-server_1 | standard_init_linux.go:211: exec user process caused “exec format error”
redis_1 | 1:M 12 Apr 2071 12:03:36.000 * Running mode=standalone, port=6379.
redis_1 | 1:M 12 Apr 2071 12:04:24.000 # Server initialized
redis_1 | 1:M 12 Apr 2071 12:04:16.000 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add ‘vm.overcommit_memory = 1’ to /etc/sysctl.conf and then reboot or run the command ‘sysctl vm.overcommit_memory=1’ for this to take effect.
redis_1 | 1:M 12 Apr 2071 12:04:24.000 * Ready to accept connections
chirpstack-gateway-bridge_1 | standard_init_linux.go:211: exec user process caused “exec format error”
chirpstack-application-server_1 | standard_init_linux.go:211: exec user process caused “exec format error”
chirpstack-docker_chirpstack-gateway-bridge_1 exited with code 1
chirpstack-docker_chirpstack-network-server_1 exited with code 1
chirpstack-docker_chirpstack-application-server_1 exited with code 1

Any input is appreciated.

1 Like

Same problem here.
I tried also with other images of postgres but it always shows segmentation fault

I can’t help with the segmentation fault, but this should be fixed when you are pulling the latest tags. Just one or two days after your post support for ARM64 and ARMv6 and v7 was added. Before the Docker images were AMD64 only (which results in the “exec format” error on the Pi, which is ARM based).

I magically managed to fix the error on my rpi:

  1. change postgres:9.6-alpine into postgres:9.6-buster in docker-compose.yml and docker-compose-env.yml
  2. change postgresqldata:/var/lib/postgresql/data into ./postgresqldata:/var/lib/postgresql/data in docker-compose.yml and docker-compose-env.yml
  3. sudo mkdir postgresqldata (if the directory is not owned by root it doesn’t work)

This fixes the segmentation fault of postgres

Thanks for the input. After fetching the latest image for the ChirpStack and changing to the 9.6-buster variant of postgres I manage to get the system started. However, I have one remaining issue and that is how to setup the postgresql roles? I get the following errors:

chirpstack-network-server_1 | time=“2021-09-06T20:31:16.881842439Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user “chirpstack_ns””
postgresql_1 | FATAL: password authentication failed for user “chirpstack_as”
postgresql_1 | DETAIL: Role “chirpstack_as” does not exist.

and

hirpstack-application-server_1 | time=“2021-09-06T20:31:18.502673328Z” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: password authentication failed for user “chirpstack_as””
postgresql_1 | FATAL: password authentication failed for user “chirpstack_ns”
postgresql_1 | DETAIL: Role “chirpstack_ns” does not exist.