I am running venus-influx-loader on Raspberry PI talking to Influx DB via basic docker-compose.yaml file that uses (old and now deprecated) dependency mechanism to start containers in order like this:
This works great during manual docker compose up assuming service healthcheck is properly implemented (full details below).
But this fails miserably during automated system reboot because docker will ignore depends_oncondition after reboot.
After experiencing multiple times that my loader does not work after automatic system reboot, I noticed that loader should attempt to automatically reconnect in 5 second intervals should InfluxDB become unreachable, which would work around the wrong startup order docker problem. But the code does not work. After the system reboot, loader service attempts to connect once and then never again:
venus-influx-loader: Use --help to learn how to use this program
venus-influx-loader: Config Path: /config
venus-influx-loader: Discovery API: disabled
venus-influx-loader: Admin API: /admin-api/
venus-influx-loader: Grafana JSON Datasource API: /grafana-api/
venus-influx-loader: API Port: 8088
[info] [influxdb] Attempting connection to influxdb:8086/venus using undefined:*****
[info] [upnp] Running UPNP Discovery...
[info] [venus-influx-loader] setting up /admin-api/ routes
[info] [venus-influx-loader] setting up /grafana-api/ routes
[info] [venus-influx-loader] running at 0.0.0.0:8088
[error] [influxdb] Unable to connect: Error: connect ECONNREFUSED 172.20.0.2:8086
TODO: Need to investigate this and make sure venus-influx-loader properly handles InfluxDB not being available initially, or disappearing and then re-appearing on the network to make the functionality robust.
I am running
venus-influx-loader
on Raspberry PI talking to Influx DB via basicdocker-compose.yaml
file that uses (old and now deprecated) dependency mechanism to start containers in order like this:This works great during manual
docker compose up
assuming service healthcheck is properly implemented (full details below).But this fails miserably during automated system reboot because
docker
will ignoredepends_on
condition
after reboot.After experiencing multiple times that my loader does not work after automatic system reboot, I noticed that loader should attempt to automatically reconnect in 5 second intervals should InfluxDB become unreachable, which would work around the wrong startup order docker problem. But the code does not work. After the system reboot,
loader service
attempts to connect once and then never again:The code managing this should be here:
https://github.com/victronenergy/venus-influx-loader/blob/536c20726786788bade1defb536e34fe4fc7b190/src/server/influxdb.js#L47-L60
TODO: Need to investigate this and make sure
venus-influx-loader
properly handles InfluxDB not being available initially, or disappearing and then re-appearing on the network to make the functionality robust.Full
docker-compose.yaml
for reference: