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

Python Error after Upgrading to 12.0 or 12.1 #163

Open
shieldsit opened this issue Dec 1, 2024 · 8 comments
Open

Python Error after Upgrading to 12.0 or 12.1 #163

shieldsit opened this issue Dec 1, 2024 · 8 comments
Labels
fixed Bug fixed

Comments

@shieldsit
Copy link

shieldsit commented Dec 1, 2024

I'm not sure which update caused it, it currently says I have 12.1 installed but I don't know if 12.0 ever installed and ran or if it was skipped. Anyway, after updating all my servers the service refuses to start on all of them. I'm getting the following error.

  • 2024-12-01T15:35:56.470181-05:00 ispconfig systemd[1]: rpi-mqtt-monitor.service: Scheduled restart job, restart counter is at 258.
  • 2024-12-01T15:35:56.470546-05:00 ispconfig systemd[1]: Stopped rpi-mqtt-monitor.service - RPI MQTT Monitor.
  • 2024-12-01T15:35:56.498432-05:00 ispconfig systemd[1]: Started rpi-mqtt-monitor.service - RPI MQTT Monitor.
  • 2024-12-01T15:35:56.590265-05:00 ispconfig python3[1093362]: Traceback (most recent call last):
  • 2024-12-01T15:35:56.590449-05:00 ispconfig python3[1093362]: File "/opt/rpi-mqtt-monitor/src/rpi-cpu2mqtt.py", line 23, in
  • 2024-12-01T15:35:56.590528-05:00 ispconfig python3[1093362]: import requests
  • 2024-12-01T15:35:56.590559-05:00 ispconfig python3[1093362]: ModuleNotFoundError: No module named 'requests'
  • 2024-12-01T15:35:56.603988-05:00 ispconfig systemd[1]: rpi-mqtt-monitor.service: Main process exited, code=exited, status=1/FAILURE
  • 2024-12-01T15:35:56.604257-05:00 ispconfig systemd[1]: rpi-mqtt-monitor.service: Failed with result 'exit-code'.
@hjelev
Copy link
Owner

hjelev commented Dec 1, 2024

this is because now the script needs a new module
No module named 'requests'
if you reinstall the script this will be solved.
Else you can login in the virtual env. and install it with pip3 install requests

@shieldsit
Copy link
Author

shieldsit commented Dec 1, 2024

It's strange because requests is in the requirements.txt file. And when I try to install it it's telling me it's already installed. So I dunno what's going on.

I didn't install these, they have been installed and all I tried to do was update them from HA. I have it installed on 7 devices and VM's and 7 are broken.

Edit: you are correct, a reinstall fixes it, I just wish I didn't have to do it!

@hjelev
Copy link
Owner

hjelev commented Dec 1, 2024

you can also activate the virtual environment in which the app is installed by executing this from its folder
cd rpi-mqtt-monitor
source rpi_mon_env/bin/activate
and then do
pip3 install -r requirements.txt

@genestealer
Copy link

I also had this, but just reinstalled, before seeing this issue.

@hjelev
Copy link
Owner

hjelev commented Dec 4, 2024

In the last version 1.0.0 I have improved the updater so new python modules will be installed after version update.
So in versions after 1.0.0 new python modules won't be a breaking change.

@hjelev hjelev added the fixed Bug fixed label Dec 4, 2024
@pipip
Copy link

pipip commented Dec 6, 2024

/opt/rpi-mqtt-monitor$ sudo python3 src/update.py
Current version: 1.0.0
:: Updating git repository /opt/rpi-mqtt-monitor/src
Already up to date.

/bin/bash: line 1: /opt/rpi-mqtt-monitor/rpi_mon_env/bin/pip: cannot execute: required file not found
An error occurred while installing requirements: Command 'source /opt/rpi-mqtt-monitor/rpi_mon_env/bin/activate && pip install -q -r /opt/rpi-mqtt-monitor/requirements.txt' returned non-zero exit status 127.

@hjelev
Copy link
Owner

hjelev commented Dec 6, 2024

/opt/rpi-mqtt-monitor$ sudo python3 src/update.py
Current version: 1.0.0
:: Updating git repository /opt/rpi-mqtt-monitor/src
Already up to date.

/bin/bash: line 1: /opt/rpi-mqtt-monitor/rpi_mon_env/bin/pip: cannot execute: required file not found
An error occurred while installing requirements: Command 'source /opt/rpi-mqtt-monitor/rpi_mon_env/bin/activate && pip install -q -r /opt/rpi-mqtt-monitor/requirements.txt' returned non-zero exit status 127.

Why did you installed the script in /opt folder ?
Do you have a virtual environment?
Can you show me the content of the rpi-mqtt-monitor folder.

@pipip
Copy link

pipip commented Dec 7, 2024

I installed via
bash <(curl -s https://raw.githubusercontent.com/hjelev/rpi-mqtt-monitor/master/remote_install.sh)
It installs in the current directory. Updating did not work. Reinstalling with command above worked

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

No branches or pull requests

4 participants