InfluxDB via Docker on RPi 3 -- exit code 139?

influxdb

#1

I’m trying to get InfluxDB bootstrapped on an RPi 3 box but I’m running into issues getting the latest container to even run.

I’m running with:

root@pi-hole:/home/dietpi# docker run -it --rm influxdb influxd config
root@pi-hole:/home/dietpi# echo $?
139

I get no output from the config call. The image it downloads was built only 3 days ago:

root@pi-hole:/home/dietpi# docker images influxdb
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
influxdb            latest              7fe7c85ef99d        3 days ago          203MB

I’m pretty new to InfluxDB – any debugging tips for this one?

Thanks!


#2

What happens if you just run

docker run -it --rm influxdb influxd

Also, what happens if you run

docker ps


#3

@Esity here’s what I’ve got:

root@pi-hole:/home/dietpi# docker run -it --rm influxdb influxd
root@pi-hole:/home/dietpi# echo $?
139
root@pi-hole:/home/dietpi# docker ps
CONTAINER ID        IMAGE                          COMMAND             CREATED             STATUS              PORTS               NAMES
4487422d581b        oznu/homebridge:raspberry-pi   "/init"             11 days ago         Up 21 hours                             homebridge_homebridge_1_3c825abae8fa 

I’m going to try https://github.com/hypriot/rpi-influxdb/blob/master/README.md instead.


#4

Oh. Hypriot’s container works. Must be something in the official container that’s ARM-incompatible?

root@pi-hole:/home/dietpi# docker run -it --rm hypriot/rpi-influxdb
Unable to find image 'hypriot/rpi-influxdb:latest' locally
latest: Pulling from hypriot/rpi-influxdb
4dafb6abed6e: Pull complete
df30b47d7954: Pull complete
0ce100592e45: Pull complete
a0f100c51b3c: Pull complete
9e0908cbe276: Pull complete
d33a04a179ae: Pull complete
10a0b709b88a: Pull complete
82da330ecbf1: Pull complete
553412c7ed8e: Pull complete
54ea67ac1cf6: Pull complete
0450eef22fb5: Pull complete
44b4077e7d98: Pull complete
Digest: sha256:f4c799390a50dacb367c2e007f5b8be8394a4dc04fdcd47fa2ddc8a10424d7b9
Status: Downloaded newer image for hypriot/rpi-influxdb:latest
=> Starting InfluxDB ...
=> No database need to be pre-created
exec influxd -config=${CONFIG_FILE}

 8888888           .d888 888                   8888888b.  888888b.
   888            d88P"  888                   888  "Y88b 888  "88b
   888            888    888                   888    888 888  .88P
   888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
   888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
   888   888  888 888    888 888  888   X88K   888    888 888    888
   888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
 8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"

[I] 2018-12-20T02:19:32Z InfluxDB starting, version 1.2.2, branch master, commit 1bcf3ae74c6b9c4897dab68d513d056277eb24f7
[I] 2018-12-20T02:19:32Z Go version go1.7.4, GOMAXPROCS set to 1
[I] 2018-12-20T02:19:32Z Using configuration at: /etc/influxdb/influxdb.conf
[I] 2018-12-20T02:19:32Z Using data dir: /data/data service=store
[I] 2018-12-20T02:19:32Z opened service service=subscriber
[I] 2018-12-20T02:19:32Z Starting monitor system service=monitor
[I] 2018-12-20T02:19:32Z 'build' registered for diagnostics monitoring service=monitor
[I] 2018-12-20T02:19:32Z 'runtime' registered for diagnostics monitoring service=monitor
[I] 2018-12-20T02:19:32Z 'network' registered for diagnostics monitoring service=monitor
[I] 2018-12-20T02:19:32Z 'system' registered for diagnostics monitoring service=monitor
[I] 2018-12-20T02:19:32Z Starting precreation service with check interval of 10m0s, advance period of 30m0s service=shard-precreation
[I] 2018-12-20T02:19:32Z Starting snapshot service service=snapshot
[I] 2018-12-20T02:19:32Z Starting continuous query service service=continuous_querier
[I] 2018-12-20T02:19:32Z Starting HTTP service service=httpd
[I] 2018-12-20T02:19:32Z Authentication enabled:false service=httpd
[I] 2018-12-20T02:19:32Z Listening on HTTP:0.0.0.0:8086 service=httpd
[I] 2018-12-20T02:19:32Z Starting retention policy enforcement service with check interval of 30m0s service=retention
[I] 2018-12-20T02:19:32Z Listening for signals
[I] 2018-12-20T02:19:32Z Storing statistics in database '_internal' retention policy 'monitor', at interval 10s service=monitor
[I] 2018-12-20T02:19:32Z Sending usage statistics to usage.influxdata.com

I’d rather get the official image working. It’s up-to-date, whereas this one is like 19 months old now.


#5

Ok, I got this Dockerfile to work on my RPi 3: https://github.com/ianchesal/rpi-influxdb/tree/stretch-1.7.2-official

And it boots after building on the RPi 3:

root@pi-hole:/home/code/rpi-influxdb# docker run -it --rm ianchesal/rpi-influxdb

 8888888           .d888 888                   8888888b.  888888b.
   888            d88P"  888                   888  "Y88b 888  "88b
   888            888    888                   888    888 888  .88P
   888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
   888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
   888   888  888 888    888 888  888   X88K   888    888 888    888
   888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
 8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"

2018-12-20T06:30:19.450804Z	info	InfluxDB starting	{"log_id": "0CU_lfDG000", "version": "1.7.2", "branch": "1.7", "commit": "76f907b0fada2f16931e37471da695349fcdf8c6"}
2018-12-20T06:30:19.453400Z	info	Go runtime	{"log_id": "0CU_lfDG000", "version": "go1.11", "maxprocs": 1}
2018-12-20T06:30:19.571350Z	info	Using data dir	{"log_id": "0CU_lfDG000", "service": "store", "path": "/var/lib/influxdb/data"}
2018-12-20T06:30:19.575899Z	info	Compaction settings	{"log_id": "0CU_lfDG000", "service": "store", "max_concurrent_compactions": 1, "throughput_bytes_per_second": 50331648, "throughput_bytes_per_second_burst": 50331648}
2018-12-20T06:30:19.579341Z	info	Open store (start)	{"log_id": "0CU_lfDG000", "service": "store", "trace_id": "0CU_lfjl000", "op_name": "tsdb_open", "op_event": "start"}
2018-12-20T06:30:19.582170Z	info	Open store (end)	{"log_id": "0CU_lfDG000", "service": "store", "trace_id": "0CU_lfjl000", "op_name": "tsdb_open", "op_event": "end", "op_elapsed": "2.889ms"}
2018-12-20T06:30:19.585499Z	info	Opened service	{"log_id": "0CU_lfDG000", "service": "subscriber"}
2018-12-20T06:30:19.586105Z	info	Starting monitor service	{"log_id": "0CU_lfDG000", "service": "monitor"}
2018-12-20T06:30:19.586770Z	info	Registered diagnostics client	{"log_id": "0CU_lfDG000", "service": "monitor", "name": "build"}
2018-12-20T06:30:19.587303Z	info	Registered diagnostics client	{"log_id": "0CU_lfDG000", "service": "monitor", "name": "runtime"}
2018-12-20T06:30:19.589741Z	info	Registered diagnostics client	{"log_id": "0CU_lfDG000", "service": "monitor", "name": "network"}
2018-12-20T06:30:19.591732Z	info	Registered diagnostics client	{"log_id": "0CU_lfDG000", "service": "monitor", "name": "system"}
2018-12-20T06:30:19.592500Z	info	Starting precreation service	{"log_id": "0CU_lfDG000", "service": "shard-precreation", "check_interval": "10m", "advance_period": "30m"}
2018-12-20T06:30:19.594260Z	info	Starting snapshot service	{"log_id": "0CU_lfDG000", "service": "snapshot"}
2018-12-20T06:30:19.594956Z	info	Starting continuous query service	{"log_id": "0CU_lfDG000", "service": "continuous_querier"}
2018-12-20T06:30:19.596611Z	info	Starting HTTP service	{"log_id": "0CU_lfDG000", "service": "httpd", "authentication": false}
2018-12-20T06:30:19.597209Z	info	opened HTTP access log	{"log_id": "0CU_lfDG000", "service": "httpd", "path": "stderr"}
2018-12-20T06:30:19.637876Z	info	Listening on HTTP	{"log_id": "0CU_lfDG000", "service": "httpd", "addr": "0.0.0.0:8086", "https": false}
2018-12-20T06:30:19.638410Z	info	Starting retention policy enforcement service	{"log_id": "0CU_lfDG000", "service": "retention", "check_interval": "30m"}
2018-12-20T06:30:19.644408Z	info	Listening for signals	{"log_id": "0CU_lfDG000"}
2018-12-20T06:30:19.647474Z	info	Storing statistics	{"log_id": "0CU_lfDG000", "service": "monitor", "db_instance": "_internal", "db_rp": "monitor", "interval": "10s"}
2018-12-20T06:30:19.651428Z	info	Sending usage statistics to usage.influxdata.com	{"log_id": "0CU_lfDG000"}
^C2018-12-20T06:30:25.368480Z	info	Signal received, initializing clean shutdown...	{"log_id": "0CU_lfDG000"}
2018-12-20T06:30:25.369014Z	info	Waiting for clean shutdown...	{"log_id": "0CU_lfDG000"}
2018-12-20T06:30:25.371019Z	info	Shutting down monitor service	{"log_id": "0CU_lfDG000", "service": "monitor"}
2018-12-20T06:30:25.383302Z	info	Terminating storage of statistics	{"log_id": "0CU_lfDG000", "service": "monitor"}
2018-12-20T06:30:25.378439Z	info	Listener closed	{"log_id": "0CU_lfDG000", "service": "snapshot"}
2018-12-20T06:30:25.389570Z	info	Terminating precreation service	{"log_id": "0CU_lfDG000", "service": "shard-precreation"}
2018-12-20T06:30:25.400346Z	info	Terminating continuous query service	{"log_id": "0CU_lfDG000", "service": "continuous_querier"}
2018-12-20T06:30:25.406116Z	info	Closing retention policy enforcement service	{"log_id": "0CU_lfDG000", "service": "retention"}
2018-12-20T06:30:25.417237Z	info	Closed service	{"log_id": "0CU_lfDG000", "service": "subscriber"}
2018-12-20T06:30:25.422358Z	info	Server shutdown completed	{"log_id": "0CU_lfDG000"}

Where as the official image does not:

root@pi-hole:/home/code/rpi-influxdb# docker run -it --rm influxdb:latest
root@pi-hole:/home/code/rpi-influxdb# echo $?
139

So maybe something is up with the official image that’s leaving it ARM-incompatible?


#6

I just realized I don’t know what docker image this is.
Where did you get it from?

Is there a reason you are using that over the official Influxdb image?
https://hub.docker.com/_/influxdb/


#7

That image is the one that’s failing to start on my RPi running DietPi (a stripped down Raspbian release, based on stretch).

root@pi-hole:/home/code/rpi-influxdb# docker run -it --rm influxdb:latest
root@pi-hole:/home/code/rpi-influxdb# echo $?
139

Is all I get out of the official container.

If I take the official container’s Dockerfile and replace the base layer in the image with resin.io’s raspbian base image I can get to a working container for InfluxDB on my RPi. Resin is a reasonably trusted OS provider for IoT devices.

You can see my modified, working, Dockerfile here: https://github.com/ianchesal/rpi-influxdb/blob/stretch-1.7.2-official/Dockerfile – that builds and runs correctly on my RPi.

What I didn’t try, was just building from scratch on my RPi using InfluxDB’s Dockerfile. I’ll try that tonight. But I’d be very surprised if that fixed the problem for the official image.

Has anyone successfully run the official container image on an armhf device running stretch?


#8

hi @irc,

I’ve been running the official container images on Raspberry Pis and Raspbian for the better part of a year. I’m able to run the official images using the commands you provided. Just tested with the latest image.

This is the command I use to run the InfluxDB container on my Pis:

docker run --rm -d \
    -p 8086:8086 \
    -p 8082:8082 \
    -p 8089:8089 \
    -v /Users/fprefect/influxdb/data/:/var/lib/influxdb \
    -v /Users/fprefect/influxdb/config:/etc/influxdb \
    --name influxdb \
    influxdb:1.7.2

Or using Docker Compose.

This looks like an issue with DietPi, and not the ARM architecture. Official Docker images have been multi-platform for a bit over a year now. I tried taking a look at the DietPi documentation and forums, but I wasn’t able to determine what they might be doing differently that would cause this kind of issue. I recommend posting an issue on their forums to see if anyone can shine some light on what is happening.


#9

@noahcrowley yea, given I can compile the container using the beefier raspbian base for it and get it to work, I too suspect DietPi is missing something essential that’s preventing the lighter container from behaving. Thanks for the sanity check.