Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service failed to start #15

Open
Mr0Cake opened this issue Jan 26, 2022 · 2 comments
Open

Service failed to start #15

Mr0Cake opened this issue Jan 26, 2022 · 2 comments

Comments

@Mr0Cake
Copy link

Mr0Cake commented Jan 26, 2022

On reboot I get the message that the logger failed to start and exceeded the maximum retry count.
I think it is because the pms is not yet ready.
I made the following changes to the startup script:

[Unit]
Description=Enviro+ MQTT Logger
After=network.target
StartLimitIntervalSec=60
StartLimitBurst=10

[Service]
ExecStart=/usr/bin/python3 /usr/src/enviroplus-mqtt/src/main.py <arguments>
WorkingDirectory=/usr/src/enviroplus-mqtt
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target
@rgoulet13
Copy link

Hey, I had this issue as well, then when I looked at your config saw the user. Double checked mine since I changed the user on my pi from the default. Once I made that change the service worked.

@allseeingey3
Copy link

I'm having a fail to start/retry count issue as well. It looks like the computer isn't seeing paho. Paho is in there, you can see it in the directory. I'm not sure what to do from here...

Here's a chunk from the journalctl output.

Jul 16 21:07:27 enviro systemd[1]: envlogger.service: Scheduled restart job, restart counter is at 5.
Jul 16 21:07:27 enviro systemd[1]: Stopped envlogger.service - Enviro+ MQTT Logger.
Jul 16 21:07:27 enviro systemd[1]: envlogger.service: Start request repeated too quickly.
Jul 16 21:07:27 enviro systemd[1]: envlogger.service: Failed with result 'exit-code'.
Jul 16 21:07:27 enviro systemd[1]: Failed to start envlogger.service - Enviro+ MQTT Logger.
root@enviro:/etc/systemd/system# journalctl -u envlogger.service -b
Jul 16 20:37:42 enviro systemd[1]: Started envlogger.service - Enviro+ MQTT Logger.
Jul 16 20:37:44 enviro python3[626]: Traceback (most recent call last):
Jul 16 20:37:44 enviro python3[626]: File "/usr/src/enviroplus-mqtt/src/main.py", line 3, in
Jul 16 20:37:44 enviro python3[626]: from logger import EnvLogger
Jul 16 20:37:44 enviro python3[626]: File "/usr/src/enviroplus-mqtt/src/logger.py", line 3, in
Jul 16 20:37:44 enviro python3[626]: import paho.mqtt.client as mqtt
Jul 16 20:37:44 enviro python3[626]: ModuleNotFoundError: No module named 'paho'
Jul 16 20:37:44 enviro systemd[1]: envlogger.service: Main process exited, code=exited, status=1/FAILURE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants