After upgrade from Debian 10 to 11, emoncms_mqtt.service and service-runner broken

Hi all
I’ve just upgraded my Debian 10 to 11. After that, I had to fix a path for mosquitto.service.
But, emoncms_mqtt.service and service-runner are still broken.
Here some more details:

sudo systemctl status emoncms_mqtt.service
● emoncms_mqtt.service - Emoncms emoncms_mqtt script
     Loaded: loaded (/var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/emoncms_mqtt.service.d
             └─emoncms_mqtt.conf
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-12-14 06:38:54 CET; 38s ago
       Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
    Process: 1355 ExecStartPre=/bin/mkdir -p ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 1356 ExecStartPre=/bin/chown ${USER} ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 1357 ExecStartPre=/bin/touch ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
    Process: 1358 ExecStartPre=/bin/chmod 666 ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
    Process: 1359 ExecStart=/usr/bin/php /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php (code=exited, status=255/EXCEPTION)
   Main PID: 1359 (code=exited, status=255/EXCEPTION)
        CPU: 78ms

and

sudo systemctl status service-runner.service
● service-runner.service - Emoncms service-runner Input Script
     Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runner.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/service-runner.service.d
             └─service-runner.conf
     Active: activating (auto-restart) (Result: exit-code) since Tue 2021-12-14 06:44:18 CET; 17s ago
       Docs: https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-runner-update.md
    Process: 1714 ExecStart=/usr/bin/python3 /var/www/emoncms/scripts/services/service-runner/service-runner.py (code=exited, status=1/FAILURE)
   Main PID: 1714 (code=exited, status=1/FAILURE)
        CPU: 67ms

Any ideas?

Fred

What path was incorrect?

Have you checked the logs?

Try running the command from the promt and see what error is generated.;

/usr/bin/php /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php

I get:

PHP Fatal error:  Uncaught Error: Class 'Mosquitto\Client' not found in /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php:123
Stack trace:
#0 {main}
  thrown in /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php on line 123

Fatal error: Uncaught Error: Class 'Mosquitto\Client' not found in /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php:123
Stack trace:
#0 {main}
  thrown in /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php on line 123

I think you may need to reistall Moquitto as PHP may have updated.

See this which looks a similar situation.

[edit]
Although it didn’t seem to fix it. What PHP version is now installed?

PHP 7.4.25 (cli) (built: Oct 23 2021 21:53:50) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.25, Copyright (c), by Zend Technologies

If PHP was updated by the OS update, then the Mosquitto module needs to be reinstalled.

@TrystanLea I note this module has had no love for quite a while so relying on it may be a risk to future developments.

1 Like

Well, that looks like uninstall and then reinstall solved the problem:

pecl uninstall Mosquitto-alpha
pecl install Mosquitto-alpha

That’s it !!

1 Like