ERROR - mycodo.influx - Unknown Influxdb version:

Hi there,
I have a fresh installed Mycodo ( Mycodo 8.15.13 /influxDB v.1.8.10/ raspberry pi OS lite (32 bit) on a Raspberry zero W)
For testing i added the cpu-Load input and activated it. When I go to the live-Measurement page the input is shown but it gets no data.
The mycodo-logs show: 2024-01-28 11:58:35,001 - ERROR - mycodo.influx - Unknown Influxdb version:
So I guess the problem is Mycodo can’t connect to influxDB.
I would be happy if anyone knows a solution for this, or can give me advice how to handle this! Thankful for help

Dan

Versions:

  • Mycodo Version: [8.15.13]
  • Raspberry Pi Version: [Raspberry zero W]
  • Raspbian OS Version: [Raspberry Pi OS lite (32 bit)]

Hi Dan,

Which version of influxdb did you install?

mycodo installed version 1.8.10

I’m doing a new install:
while installation :

Installing InfluxDB v1.8.10-1…

Selecting previously unselected package influxdb.
(Reading database … 46768 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…

and this final part keeps coming again…

This is an issue with Influxdb and not Mycodo. You can find many topics that have discussed this issue on Pi Zeros on github issues and this forum. This is just one of those:

I did all the recomendations from linked issue, but nothing fixed the problem…
(increasing sleep time / setting the TimeoutStartSec to 45 / comenting out ‘Type = forking’

I don’t know what do try next…
and would be thankful for any recomendations :grimacing:

sudo ~/Mycodo/env/bin/python ~/Mycodo/mycodo/mycodo_daemon.py
2024-02-06 00:02:04,987 Mycodo daemon v8.15.13 starting
2024-02-06 00:02:05,147 Starting Pyro5 daemon
2024-02-06 00:02:05,184 PyroDaemon
Traceback (most recent call last):
File “/home/pi/Mycodo/mycodo/mycodo_daemon.py”, line 1320, in run
serve({
File “/home/pi/Mycodo/env/lib/python3.9/site-packages/Pyro5/server.py”, line 826, in serve
daemon = Daemon(host, port)
File “/home/pi/Mycodo/env/lib/python3.9/site-packages/Pyro5/server.py”, line 237, in init
self.transportServer.init(self, host, port, unixsocket)
File “/home/pi/Mycodo/env/lib/python3.9/site-packages/Pyro5/svr_threads.py”, line 124, in init
self.sock = socketutil.create_socket(bind=bind_location,
File “/home/pi/Mycodo/env/lib/python3.9/site-packages/Pyro5/socketutil.py”, line 278, in create_socket
sock.bind(bind)
OSError: [Errno 98] Address already in use
2024-02-06 00:02:11,110 Activated in 4062.7 ms
2024-02-06 00:02:11,613 All activated Conditional controllers started
2024-02-06 00:02:11,616 All activated Trigger controllers started
2024-02-06 00:02:14,820 Activated in 2231.5 ms
2024-02-06 00:02:14,835 All activated Input controllers started
2024-02-06 00:02:14,857 All activated PID controllers started
2024-02-06 00:02:14,860 All activated Function controllers started
2024-02-06 00:02:16,827 Activated in 1949.9 ms
2024-02-06 00:02:17,833 Mycodo daemon started in 12.842 seconds
2024-02-06 00:02:23,183 Unknown Influxdb version:
2024-02-06 00:02:30,029 Unknown Influxdb version:
2024-02-06 00:02:45,119 Unknown Influxdb version:
2024-02-06 00:02:59,723 Unknown Influxdb version:
2024-02-06 00:03:15,284 Unknown Influxdb version:
2024-02-06 00:03:30,250 Unknown Influxdb version:
2024-02-06 00:03:45,133 Unknown Influxdb version:
^CTraceback (most recent call last):
File “/home/pi/Mycodo/mycodo/mycodo_daemon.py”, line 1415, in
mycodo_daemon.start_daemon()
File “/home/pi/Mycodo/mycodo/mycodo_daemon.py”, line 1377, in start_daemon
self.mycodo.run() # Start daemon thread that manages controllers
File “/home/pi/Mycodo/mycodo/mycodo_daemon.py”, line 191, in run
time.sleep(1)
KeyboardInterrupt

Can you provide a screenshot of your influxdb settings under General Settings?

Thanks for responding so fast!
InfluxDB v1.8.10 (git: 1.8 688e697c51fd)

here the screenshot:

You likely don’t have the database version set. Press Save and see if that fixes it.

can’t do, there’s just a dropdown menu…
Bildschirmfoto vom 2024-02-06 15-55-44

Go to the bottom of the page and press Save.

was set to ’ influxdb 1.x’ before… after saving again nothing changed :sleepy:

You won’t see any change to the option, since there are only two possible options. Saving the value to the database (if it didn’t previously have a value saved), will fix the “Unknown db version” error.

Please be specific with diagnostic feedback. What exactly does “nothing changed” mean? Does it mean the same “Unknown db version” error persists after restarting the backend or does it mean the drop down is still set to 1.x (which is expected)?

After restarting backend the Mycodo Logs show that the daemon started:


2024-02-06 21:18:33,962 - INFO - mycodo - Mycodo daemon v8.15.13 starting
2024-02-06 21:18:34,115 - INFO - mycodo.pyro_daemon - Starting Pyro5 daemon
2024-02-06 21:18:37,202 - INFO - mycodo.controllers.controller_output - Activated in 1967.5 ms
2024-02-06 21:18:37,704 - INFO - mycodo - All activated Conditional controllers started
2024-02-06 21:18:37,707 - INFO - mycodo - All activated Trigger controllers started
2024-02-06 21:18:40,359 - INFO - mycodo.controllers.controller_input_c71c0cd1 - Activated in 1816.5 ms
2024-02-06 21:18:40,367 - INFO - mycodo - All activated Input controllers started
2024-02-06 21:18:40,390 - INFO - mycodo - All activated PID controllers started
2024-02-06 21:18:40,393 - INFO - mycodo - All activated Function controllers started
2024-02-06 21:18:42,481 - INFO - mycodo.controllers.controller_widget - Activated in 2072.6 ms
2024-02-06 21:18:43,488 - INFO - mycodo - Mycodo daemon started in 9.518 seconds


when i switch to Data> Live Measurements, says : no data last 30 sec

back to the Mycodo Logs: there’s no entry since the daemon restarted (10 minutes ago). **Influxdb.service shows : **
failed to initialize execute s>

$ systemctl status influxd.service``

influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 21:02:34 CET; 19min ago
Docs: InfluxDB OSS v2 Documentation
Main PID: 257 (influxd)
Tasks: 9 (limit: 414)
CPU: 3min 46.913s
CGroup: /system.slice/influxdb.service
└─257 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Feb 06 21:20:52 raspberrypi influxd-systemd-start.sh[257]: ts=2024-02-06T20:20:52.809889Z lvl=error msg="[500] - "failed to initialize execute s>
Feb 06 21:20:55 raspberrypi influxd-systemd-start.sh[257]: [httpd] ::1 - - [06/Feb/2024:21:20:55 +0100] "POST /api/v2/write?org=mycodo&bucket=myc>
Feb 06 21:21:06 raspberrypi influxd-systemd-start.sh[257]: [httpd] ::1 - - [06/Feb/2024:21:21:05 +0100] "POST /api/v2/query?org=mycodo HTTP/1.1 “>
Feb 06 21:21:06 raspberrypi influxd-systemd-start.sh[257]: ts=2024-02-06T20:21:06.510166Z lvl=error msg=”[500] - "failed to initialize execute s>
Feb 06 21:21:06 raspberrypi influxd-systemd-start.sh[257]: [httpd] ::1 - - [06/Feb/2024:21:21:06 +0100] "POST /api/v2/query?org=mycodo HTTP/1.1 ">
lines 1-15/20 59%

then I restarted influxdb and there was no error shown anymore, but still no data on the live Measurements…

$ sudo systemctl restart influxdb

$ systemctl status influxd.service

influxdb.service - InfluxDB is an open-source, distributed, time series database
Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2024-02-06 21:52:31 CET; 21s ago
Docs: InfluxDB OSS v2 Documentation
Main PID: 1537 (influxd-systemd)
Tasks: 7 (limit: 414)
CPU: 17.995s
CGroup: /system.slice/influxdb.service
├─1537 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
├─1538 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
└─1568 sleep 10

Feb 06 21:52:31 raspberrypi systemd[1]: Started InfluxDB is an open-source, distributed, time series database.
Feb 06 21:52:32 raspberrypi influxd-systemd-start.sh[1540]: Merging with configuration at: /etc/influxdb/influxdb.conf
Feb 06 21:52:32 raspberrypi influxd-systemd-start.sh[1538]: ts=2024-02-06T20:52:32.137891Z lvl=info msg=“InfluxDB starting” log_id=0nC2x32G000 ve>
lines 1-15

…and the Mycodo logs show something again (more than 30 min later, when I deactivated and thenactivated the cpu-load input again)

2024-02-06 21:18:42,481 - INFO - mycodo.controllers.controller_widget - Activated in 2072.6 ms
2024-02-06 21:18:43,488 - INFO - mycodo - Mycodo daemon started in 9.518 seconds
2024-02-06 21:55:50,178 - INFO - mycodo.controllers.controller_input_c71c0cd1 - Deactivated in 76.6 ms
2024-02-06 21:56:24,138 - INFO - mycodo.controllers.controller_input_c71c0cd1 - Activated in 4551.6 ms

influxd is a part of influxdb 2.x. influxdb is what you would have running if it were 1.x. Perhaps you should format and start completely fresh, because there is conflicting information given here and it would be far more difficult to fix your broken system than for you to start over.

that sound logic! how do I prevent this to happen again with a new installation (did it at least four times starting with format…)?
…install influxdb 1.8.x manually ?

Just make sure you don’t select the wrong option and attach the setup log (if there is an issue). Without the setup log, any install diagnostics is impossible.

ok, I will try that (but I’m pretty shure I opted the right influxdb version)
thanks so far anyway, your help is appreciated!

New Installation, still not working
while installation :

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 … 46768 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


like before:

  • no data on the live measurements

  • no error in the mycodo logs
    2024-02-07 00:12:42,071 - INFO - mycodo - Mycodo daemon v8.15.13 starting
    2024-02-07 00:12:42,389 - INFO - mycodo.pyro_daemon - Starting Pyro5 daemon
    2024-02-07 00:12:50,106 - INFO - mycodo.controllers.controller_output - Activated in 4186.9 ms
    2024-02-07 00:12:50,609 - INFO - mycodo - All activated Conditional controllers started
    2024-02-07 00:12:50,613 - INFO - mycodo - All activated Trigger controllers started
    2024-02-07 00:12:50,627 - INFO - mycodo - All activated Input controllers started
    2024-02-07 00:12:50,631 - INFO - mycodo - All activated PID controllers started
    2024-02-07 00:12:50,634 - INFO - mycodo - All activated Function controllers started
    2024-02-07 00:12:52,284 - INFO - mycodo.controllers.controller_widget - Activated in 1645.2 ms
    2024-02-07 00:12:53,287 - INFO - mycodo - Mycodo daemon started in 11.199 seconds
    2024-02-07 00:43:14,502 - INFO - mycodo.controllers.controller_input_d0230120 - Activated in 4420.6 ms

  • Influxdb API unavailable:

$ 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 2024-02-07 01:00:09 CET; 28s ago
Docs: InfluxDB OSS v2 Documentation
Cntrl PID: 14534 (influxd-systemd)
Tasks: 7 (limit: 414)
CPU: 15.013s
CGroup: /system.slice/influxdb.service
├─14534 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
├─14535 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
└─14633 curl -k -s -o /dev/null http://localhost:8086/health -w %{http_code}

Feb 07 01:00:23 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 7 attemp>
Feb 07 01:00:24 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 8 attemp>
Feb 07 01:00:26 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 9 attemp>
Feb 07 01:00:27 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 10 attem>
Feb 07 01:00:29 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 11 attem>
Feb 07 01:00:30 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 12 attem>
Feb 07 01:00:31 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 13 attem>
Feb 07 01:00:33 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 14 attem>
Feb 07 01:00:34 raspberrypi influxd-systemd-start.sh[14534]: InfluxDB API unavailable after 15 attem>
F

You need to apply the fix previously mentioned: