Influxdb not installing properly

Installing Mycodo onto raspberry pi zero. Using 32bit OS. Everything loads without error until the end of the installation when I get problems installing infuxdb. I can run Mycodo at the end of the installation and even add inputs. However I am unable to get any readings from any of the inputs (CO2 monitor and temp/humidity sensors) which I am assuming is due to the data base not working.
I have attempted 4 seperate installations with two different SD cards (16GB and 64GB) all with the same result.
I have looked for the data base to see if it exists but can’t find it (basically cause I don’t know were to look/it is stored).
Checking the Mycodo Log I get this result:-

2023-04-26 15:07:39,451 - INFO - mycodo - Mycodo daemon v8.15.8 starting
2023-04-26 15:07:40,103 - INFO - mycodo.pyro_daemon - Starting Pyro5 daemon
2023-04-26 15:07:51,430 - INFO - mycodo.controllers.controller_output - Activated in 6782.3 ms
2023-04-26 15:07:51,932 - INFO - mycodo - All activated Conditional controllers started
2023-04-26 15:07:51,936 - INFO - mycodo - All activated Trigger controllers started
2023-04-26 15:08:02,876 - INFO - mycodo.controllers.controller_input_97708267 - Activated in 8229.8 ms
2023-04-26 15:08:13,870 - INFO - mycodo.controllers.controller_input_d40532e2 - Activated in 6542.3 ms
2023-04-26 15:08:13,876 - INFO - mycodo - All activated Input controllers started
2023-04-26 15:08:13,907 - INFO - mycodo - All activated PID controllers started
2023-04-26 15:08:13,919 - INFO - mycodo - All activated Function controllers started
2023-04-26 15:08:19,852 - INFO - mycodo.controllers.controller_widget - Activated in 5897.8 ms
2023-04-26 15:08:20,869 - INFO - mycodo - Mycodo daemon started in 41.408 seconds

If I tick the logging within the input function I get from the mycodo log:-

2023-04-26 15:07:39,451 - INFO - mycodo - Mycodo daemon v8.15.8 starting
2023-04-26 15:07:40,103 - INFO - mycodo.pyro_daemon - Starting Pyro5 daemon
2023-04-26 15:07:51,430 - INFO - mycodo.controllers.controller_output - Activated in 6782.3 ms
2023-04-26 15:07:51,932 - INFO - mycodo - All activated Conditional controllers started
2023-04-26 15:07:51,936 - INFO - mycodo - All activated Trigger controllers started
2023-04-26 15:08:02,876 - INFO - mycodo.controllers.controller_input_97708267 - Activated in 8229.8 ms
2023-04-26 15:08:13,870 - INFO - mycodo.controllers.controller_input_d40532e2 - Activated in 6542.3 ms
2023-04-26 15:08:13,876 - INFO - mycodo - All activated Input controllers started
2023-04-26 15:08:13,907 - INFO - mycodo - All activated PID controllers started
2023-04-26 15:08:13,919 - INFO - mycodo - All activated Function controllers started
2023-04-26 15:08:19,852 - INFO - mycodo.controllers.controller_widget - Activated in 5897.8 ms
2023-04-26 15:08:20,869 - INFO - mycodo - Mycodo daemon started in 41.408 seconds
2023-04-26 16:50:40,970 - INFO - mycodo.controllers.controller_input_97708267 - Deactivated in 99.5 ms
2023-04-26 16:51:12,510 - DEBUG - mycodo.controllers.controller_input_97708267 - get_measurement() found
2023-04-26 16:51:12,540 - DEBUG - mycodo.controllers.controller_input_97708267 - listener() not found
2023-04-26 16:51:12,544 - INFO - mycodo.controllers.controller_input_97708267 - Activated in 6475.9 ms
2023-04-26 16:51:13,396 - DEBUG - mycodo.controllers.controller_input_97708267 - Adding measurements to InfluxDB with ID 97708267-5b68-4419-8bb9-bc7ed9949f77: {0: {‘measurement’: ‘temperature’, ‘unit’: ‘C’, ‘value’: 20.698100251773866, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 12, 630035)}, 1: {‘measurement’: ‘humidity’, ‘unit’: ‘percent’, ‘value’: 74.90653849088274, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 12, 630240)}, 3: {‘measurement’: ‘vapor_pressure_deficit’, ‘unit’: ‘Pa’, ‘value’: 612.4658600360754, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 12, 630552)}}
2023-04-26 16:51:27,315 - DEBUG - mycodo.controllers.controller_input_97708267 - Adding measurements to InfluxDB with ID 97708267-5b68-4419-8bb9-bc7ed9949f77: {0: {‘measurement’: ‘temperature’, ‘unit’: ‘C’, ‘value’: 20.698100251773866, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 26, 993409)}, 1: {‘measurement’: ‘humidity’, ‘unit’: ‘percent’, ‘value’: 74.87907225146868, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 26, 993550)}, 3: {‘measurement’: ‘vapor_pressure_deficit’, ‘unit’: ‘Pa’, ‘value’: 613.1362392078995, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 26, 993850)}}
2023-04-26 16:51:45,540 - DEBUG - mycodo.controllers.controller_input_97708267 - Adding measurements to InfluxDB with ID 97708267-5b68-4419-8bb9-bc7ed9949f77: {0: {‘measurement’: ‘temperature’, ‘unit’: ‘C’, ‘value’: 20.724803540093077, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 42, 5017)}, 1: {‘measurement’: ‘humidity’, ‘unit’: ‘percent’, ‘value’: 74.9034866865034, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 42, 5162)}, 3: {‘measurement’: ‘vapor_pressure_deficit’, ‘unit’: ‘Pa’, ‘value’: 613.5480974693311, ‘timestamp_utc’: datetime.datetime(2023, 4, 26, 6, 51, 42, 5462)}}

So I am assuming that something is being logged somewhere but it is just not available were Mycodo expects it to be.

I will add the outputs of the installation log as well as any further info I can find, but if anyone has any pointers on what I am doing wrong it would be appreciated…

This is from the setup.log:-

Ensuring compatible version of influxdb 1.x is installed

Incorrect InfluxDB version (v(none)) installed. Should be v1.8.10-1

Stopping influxdb 2.x (if installed)…

Failed to stop influxd.service: Unit influxd.service not loaded.

Uninstalling influxdb 2.x (if installed)…

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists…

Building dependency tree…

Reading state information…

E: Unable to locate package influxdb2

E: Unable to locate package influxdb2-cli

Installing InfluxDB v1.8.10-1…

Selecting previously unselected package influxdb.

(Reading database … 46544 files and directories currently installed.)

Preparing to unpack influxdb_1.8.10_armhf.deb …

Unpacking influxdb (1.8.10-1) …

Setting up influxdb (1.8.10-1) …

Created symlink /etc/systemd/system/influxd.service → /lib/systemd/system/influxdb.service.

Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service → /lib/systemd/system/influxdb.service.

Processing triggers for man-db (2.9.4-2) …

Flux found to not be enabled. Enabling and restarting InfluxDB.

Job for influxdb.service failed because a timeout was exceeded.

See “systemctl status influxdb.service” and “journalctl -xe” for details.

Creating InfluxDB 1.x database and user

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Attempting to connect…

Could not connect to Influxdb. Waiting 60 seconds then trying again…

Running initialization

Creating mycodo user

And finally:-

dcj@raspberrypi:~ $ systemctl status influxdb.service
● influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: activating (start) since Wed 2023-04-26 16:27:37 AEST; 18s ago
Docs: InfluxDB OSS 2.7 Documentation
Cntrl PID: 12431 (influxd-systemd)
Tasks: 7 (limit: 724)
CPU: 15.325s
CGroup: /system.slice/influxdb.service
├─12431 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
├─12432 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
└─12495 sleep 1

Apr 26 16:27:43 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 4 attempts…
Apr 26 16:27:44 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 5 attempts…
Apr 26 16:27:46 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 6 attempts…
Apr 26 16:27:47 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 7 attempts…
Apr 26 16:27:48 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 8 attempts…
Apr 26 16:27:50 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 9 attempts…
Apr 26 16:27:51 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 10 attempts…
Apr 26 16:27:53 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 11 attempts…
Apr 26 16:27:54 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 12 attempts…
Apr 26 16:27:55 raspberrypi influxd-systemd-start.sh[12431]: InfluxDB API unavailable after 13 attempts…

Have you searched the github issues for “Pi zero Could not connect to InfluxDB”?

Thanks Kyle, despite numerous searches I was previously not able to find any help (I thought discord was the place to look, not github) but with your pointer on what to search for I have managed to get the database up and running so far. Thank you for your help and time…

1 Like