This will be my 3rd time reinstalling mycodo from scratch again and I can’t figure out why the same keeps happening but this is the current state of things:
service mycodo status
● mycodo.service - Mycodo server
Loaded: loaded (/home/gg/Mycodo/install/mycodo.service; enabled; vendor preset: enabled)
Active: activating (start-pre) since Sun 2022-07-24 14:35:02 SAST; 11min ago
Cntrl PID: 1235 (bash)
Tasks: 2 (limit: 415)
CPU: 17.464s
CGroup: /system.slice/mycodo.service
└─1235 /bin/bash /var/mycodo-root/install/influxdb_wait_until_running.sh
Currently I have the following setup, 1x Temp & Humidity sensor, 1x Co2 Sensor, 1x 20x4 LCD display, 1x 3 port Kasa Smart plug & 1x 6 Port Kasa smart plug.
Whenever I add a function to control humidity, exactly according to documentation, and I restart mycodo I have this issue. Could be something else but this is what I’ve noticed so far when setting it up from scratch again.
What I’ve tried:
Rebooting.
Restarting the mycodo daemon with sudo service mycodo restart
Killing the mycodo, influxd.
Recovering from a working backup. When I recovered from a working backup it got to the point where it restarts the mycodo daemon, but then the daemon never starts up again and the recovery process sits and waits until it starts. If I manually kill the daemon it carries on with the recovery and says recovery successful. Daemon never starts and I’m unable to start it manually. Shows same message as above, “Active: activating (start-pre)”
Creating an empty influxd db.
Waiting hours for the influxd and mycodo daemon to start
Reinstalling mycodo from scratch. This works until I get to the above point with my config and then restart.
What I have:
Raspberry Pi Zero W
64gb Sandisk Extreme Micro SD Card
3 Port Kasa
6 Port Kasa
MH-Z19B C02 sensor
AM2315C - Encased I2C Temperature/Humidity Sensor
HiLetgo 2004 20X4 LCD Display
TerraBloom ECMF-100
Will you let me know what logs I can supply to help? I’ve attached mycodo, sys and daemon logs. Mycodo logs.zip (3.8 MB)
Ok in my case i had to reinstall completly Mycodo and i purged all influxDB packages before to reinstall mycodo.
Directly after i changed the time sleep.
The problem reappears if I do a sudo update && upgrade at startup while influxDB is starting too.
I had my two RPI zero which had that problem.
Hope it will be the same for you
Ok going to try this now, correct me if I’m wrong, I’ve got a freshly formatted sd card, going to install Raspberry Pi OS Lite 32bit again, then install Mycodo but without running sudo update && upgrade at startup? Then after it has been installed I edit /usr/lib/influxdb/scripts/influxd-systemd-start.sh?
Also did you have the issue where Mycodo daemon started but the InfluxDB could not and gave the above errors?
Hi, I am having the same problem here.
Everything was working perfectly for weeks, then I shut down the raspberry pi for a week. When I restarted, inlfluxdb could not start.
● 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 Sun 2023-04-09 18:04:26 EDT; 30s ago
Docs: InfluxDB OSS 2.7 Documentation
Cntrl PID: 5304 (influxd-systemd)
Tasks: 13 (limit: 1595)
CPU: 39.863s
CGroup: /system.slice/influxdb.service
├─5304 /bin/bash -e /usr/lib/influxdb/scripts/influxd-systemd-start.sh
├─5305 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
└─5597 sleep 1
Apr 09 18:04:47 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 20 attempts…
Apr 09 18:04:48 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 21 attempts…
Apr 09 18:04:50 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 22 attempts…
Apr 09 18:04:51 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 23 attempts…
Apr 09 18:04:52 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 24 attempts…
Apr 09 18:04:53 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 25 attempts…
Apr 09 18:04:54 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 26 attempts…
Apr 09 18:04:55 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 27 attempts…
Apr 09 18:04:56 raspi influxd-systemd-start.sh[5304]: InfluxDB API unavailable after 28 attempts…
Tried changing the sleep time in the scrtipt as suggested, but it didn’t work. Any ideas?
Thanks for this thread which also helped diagnose/fix my problem. I added a camera into a working system and after the camera dependencies were installed the web UI could not connect to influxdb.
journalctl -xe
May 22 16:53:57 mushroompi influxd-systemd-start.sh[11747]: InfluxDB API unavailable after 19 attempts…
May 22 16:53:58 mushroompi influxd-systemd-start.sh[11747]: InfluxDB API unavailable after 20 attempts…
May 22 16:53:59 mushroompi influxd-systemd-start.sh[11747]: InfluxDB API unavailable after 21 attempts…
May 22 16:53:59 mushroompi influxd-systemd-start.sh[11747]: InfluxDB API unavailable after 21 attempts…