janw / pi-hole-influx

A python daemon to send Pi-Hole stats for Grafana to InfluxDB
148 stars 25 forks source link

Job for piholeinflux.service failed because the control process exited with error code. #31

Closed C92 closed 5 years ago

C92 commented 5 years ago

Hello, I followed everything according to the instructions. But whenever I want to start the service I get the error below.

Error message:

pi@raspberrypi:~ $ sudo systemctl start piholeinflux.service

Job for piholeinflux.service failed because the control process exited with error code.
See "systemctl status piholeinflux.service" and "journalctl -xe" for details.

journalctl -xe:

root@raspberrypi:/home/pi# journalctl -xe
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit piholeinflux.service has begun starting up.
Sep 08 00:29:13 raspberrypi send-influx.sh[737]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Sep 08 00:29:13 raspberrypi send-influx.sh[737]:                                  Dload  Upload   Total   Spent    Left  Speed
Sep 08 00:29:13 raspberrypi influxd[733]: [httpd] 192.168.178.27 - Christopher [08/Sep/2019:00:29:13 +0200] "POST /write?db=Smart_Home&p=%5BREDACTED%5D&precision=s&u=Christopher HTTP/1.1" 204 0 "-" "curl/7.52.1" eb9a38c1-d1be-11e9-802a-0
Sep 08 00:29:13 raspberrypi send-influx.sh[737]: [158B blob data]
Sep 08 00:29:15 raspberrypi python3[1518]: Traceback (most recent call last):
Sep 08 00:29:15 raspberrypi python3[1518]:   File "/home/pi/pi-hole-influx/piholeinflux.py", line 18, in <module>
Sep 08 00:29:15 raspberrypi python3[1518]:     settings.validators.validate()
Sep 08 00:29:15 raspberrypi python3[1518]:   File "/usr/local/lib/python3.5/dist-packages/dynaconf/validator.py", line 167, in validate
Sep 08 00:29:15 raspberrypi python3[1518]:     validator.validate(self.settings)
Sep 08 00:29:15 raspberrypi python3[1518]:   File "/usr/local/lib/python3.5/dist-packages/dynaconf/validator.py", line 108, in validate
Sep 08 00:29:15 raspberrypi python3[1518]:     self._validate_items(settings, settings.current_env)
Sep 08 00:29:15 raspberrypi python3[1518]:   File "/usr/local/lib/python3.5/dist-packages/dynaconf/validator.py", line 122, in _validate_items
Sep 08 00:29:15 raspberrypi python3[1518]:     "{0} is required in env {1}".format(name, env)
Sep 08 00:29:15 raspberrypi python3[1518]: dynaconf.validator.ValidationError: INSTANCES is required in env DEVELOPMENT
Sep 08 00:29:15 raspberrypi systemd[1]: piholeinflux.service: Main process exited, code=exited, status=1/FAILURE
Sep 08 00:29:15 raspberrypi systemd[1]: Failed to start Pi-hole-Influx - Send Pi-hole statistics to InfluxDB for visualization.
-- Subject: Unit piholeinflux.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit piholeinflux.service has failed.
--
-- The result is failed.
Sep 08 00:29:15 raspberrypi systemd[1]: piholeinflux.service: Unit entered failed state.
Sep 08 00:29:15 raspberrypi systemd[1]: piholeinflux.service: Failed with result 'exit-code'.
Sep 08 00:29:20 raspberrypi telegraf[727]: 2019-09-07T22:29:20Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command '/usr/local/bin/piholestats.sh'
Sep 08 00:29:20 raspberrypi influxd[733]: [httpd] ::1 - - [08/Sep/2019:00:29:20 +0200] "POST /write?db=telegraf HTTP/1.1" 204 0 "-" "telegraf" efd8763a-d1be-11e9-802b-000000000000 21030
Sep 08 00:29:23 raspberrypi send-influx.sh[737]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Sep 08 00:29:23 raspberrypi send-influx.sh[737]:                                  Dload  Upload   Total   Spent    Left  Speed
Sep 08 00:29:23 raspberrypi influxd[733]: [httpd] 192.168.178.27 - Christopher [08/Sep/2019:00:29:23 +0200] "POST /write?db=Smart_Home&p=%5BREDACTED%5D&precision=s&u=Christopher HTTP/1.1" 204 0 "-" "curl/7.52.1" f1a3f152-d1be-11e9-802c-0
Sep 08 00:29:23 raspberrypi send-influx.sh[737]: [158B blob data]
Sep 08 00:29:30 raspberrypi telegraf[727]: 2019-09-07T22:29:30Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command '/usr/local/bin/piholestats.sh'
Sep 08 00:29:30 raspberrypi influxd[733]: [httpd] ::1 - - [08/Sep/2019:00:29:30 +0200] "POST /write?db=telegraf HTTP/1.1" 204 0 "-" "telegraf" f5ce30fb-d1be-11e9-802d-000000000000 17293
Sep 08 00:29:34 raspberrypi send-influx.sh[737]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Sep 08 00:29:34 raspberrypi send-influx.sh[737]:                                  Dload  Upload   Total   Spent    Left  Speed
Sep 08 00:29:34 raspberrypi influxd[733]: [httpd] 192.168.178.27 - Christopher [08/Sep/2019:00:29:34 +0200] "POST /write?db=Smart_Home&p=%5BREDACTED%5D&precision=s&u=Christopher HTTP/1.1" 204 0 "-" "curl/7.52.1" f7a5ae3c-d1be-11e9-802e-0
Sep 08 00:29:34 raspberrypi send-influx.sh[737]: [158B blob data]
Sep 08 00:29:40 raspberrypi sudo[1560]:     root : TTY=pts/1 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/systemctl status piholeinflux.service
Sep 08 00:29:40 raspberrypi sudo[1560]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Sep 08 00:29:40 raspberrypi sudo[1560]: pam_unix(sudo:session): session closed for user root
Sep 08 00:29:40 raspberrypi telegraf[727]: 2019-09-07T22:29:40Z E! Error in plugin [inputs.exec]: exec: exit status 1 for command '/usr/local/bin/piholestats.sh'
Sep 08 00:29:40 raspberrypi influxd[733]: [httpd] ::1 - - [08/Sep/2019:00:29:40 +0200] "POST /write?db=telegraf HTTP/1.1" 204 0 "-" "telegraf" fbc41c5e-d1be-11e9-802f-000000000000 16595
Sep 08 00:29:44 raspberrypi send-influx.sh[737]:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Sep 08 00:29:44 raspberrypi send-influx.sh[737]:                                  Dload  Upload   Total   Spent    Left  Speed
Sep 08 00:29:44 raspberrypi influxd[733]: [httpd] 192.168.178.27 - Christopher [08/Sep/2019:00:29:44 +0200] "POST /write?db=Smart_Home&p=%5BREDACTED%5D&precision=s&u=Christopher HTTP/1.1" 204 0 "-" "curl/7.52.1" fdaef683-d1be-11e9-8030-0
Sep 08 00:29:44 raspberrypi send-influx.sh[737]: [158B blob data]
Sep 08 00:29:45 raspberrypi systemd[1]: piholeinflux.service: Service hold-off time over, scheduling restart.
Sep 08 00:29:45 raspberrypi systemd[1]: Stopped Pi-hole-Influx - Send Pi-hole statistics to InfluxDB for visualization.
-- Subject: Unit piholeinflux.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit piholeinflux.service has finished shutting down.
Sep 08 00:29:45 raspberrypi systemd[1]: Starting Pi-hole-Influx - Send Pi-hole statistics to InfluxDB for visualization...
-- Subject: Unit piholeinflux.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit piholeinflux.service has begun starting up.
lines 2301-2363/2363 (END)
C92 commented 5 years ago

any ideas?

janw commented 5 years ago

Hey @C92! Looking at the logs, this line makes me think you have not properly configured an instance for the daemon to scrape:

dynaconf.validator.ValidationError: INSTANCES is required in env DEVELOPMENT

C92 commented 5 years ago

Oh Thanks :) can you possibly give me a little tip how i can fix it? ^^"

janw commented 5 years ago

Have you copied the user.toml.example to user.toml, uncommented one of the instances=… entries, and modified it to fit your setup?

C92 commented 5 years ago

Thanks for the Help, but the problem has been solved. I do not know what it was, but after a complete reinstall it works now.