Inputs Forever Loading - nothing in log

Noob here, looking for some sanity checking assistance. Its another ‘Inputs loading forever’ issue but cant see similar issues with my set up. New install NOT and upgrade on Ubuntu 24.04, the issue occurred the moment I tried to forward home assistance sensors into inputs, I created input number 1 etc from then on it was loading. I’ve stopped HA sending but Inputs is still loading. tried to delete input 1 using mysql query but I don’t think there is any inputs written to the database yet.

mysql -u emoncms -p emoncms (password: emonpiemoncmsmysql2016)
DELETE FROM device WHERE userid = 1;
exit

There is nothing obvious to me in the log about it, I’m missing something very obvious but I don’t know much about this stuff to be honest.

Can anyone assist?

many thanks

right so looks like mqtt_input is failing to start…

Systemctl says:

● mqtt_input.service - Emoncms MQTT Input Script
     Loaded: loaded (/etc/systemd/system/mqtt_input.service; enabled; preset: enabled)
     Active: activating (auto-restart) since Thu 2024-10-31 12:08:06 GMT; 36s ago
       Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
    Process: 3184 ExecStart=/usr/bin/php /var/www/emoncms/scripts/phpmqtt_input.php (code=exited, status=0/SUCCESS)
   Main PID: 3184 (code=exited, status=0/SUCCESS)
        CPU: 33ms

Emoncms-Virtual-Machine:/var/log/emoncms$ tail -f emoncms.log - reveals SFA

2024-10-31 12:02:59.-218|INFO|feedwriter.php|Buffered feed writer daemon started with sleep 300s...
2024-10-31 12:02:59.-214|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2024-10-31 12:04:18.366|INFO|phpmqtt_input.php|Disconnected cleanly
2024-10-31 12:04:34.-472|WARN|emoncms_mqtt.php|Starting MQTT Input script
2024-10-31 12:04:34.-451|WARN|emoncms_mqtt.php|Not connected, retrying connection
2024-10-31 12:04:34.-440|WARN|emoncms_mqtt.php|Connecting to MQTT server: Connection Accepted.: code: 0
2024-10-31 12:04:34.-440|INFO|emoncms_mqtt.php|Subscribed to: emon/# ID - 1
2024-10-31 12:04:34.-430|INFO|emoncms_mqtt.php|Callback subscribed to topic:
2024-10-31 12:06:21.-288|INFO|admin_model.php|runService() service-runner trigger sent for '/var/www/emoncms/Modules/admin/../../scripts/service-action.sh mqtt_input.service start'
2024-10-31 12:09:35.-418|INFO|emoncms_mqtt.php|0 Messages processed in last 5 minutes

How did you install the instance?

Did you create a ‘pi’ user?

There are a couple of other threads re installs on 24.04

I installed using the scrips page:
https://docs.openenergymonitor.org/emonsd/install.html

No I didnt create a user called ‘pi’ I used my own. Is that where I went wrong?

I’m sure it was part of the instructions previously - seems to have gone.

Did you edit the script before running it and add in a user?

Yes sir I did

can you check if this file exists and what are the contents

/lib/systemd/system/emoncms_mqtt.service.d/emoncms_mqtt.conf

BTW, please use Ctl-E to format console output :slight_smile:

Yes the file exists:

cat /lib/systemd/system/emoncms_mqtt.service.d/emoncms_mqtt.conf

[Service]
Environment="USER=myusername"

open 2xSSH consoles, in one try to restart the service in the other

journalctl -f -u emoncms_mqtt

What output do you get.

please format this with Ctl-E (adds 3 backticks to the edit window).

Actually, I’m not sure why this service is being loaded. It has been superseded by the emoncms_mqtt service.

Did you do anything other than run the scripts?

Looks like redis is interfering:

Nov 04 12:25:44 Emoncms-Virtual-Machine systemd[1]: emoncms_mqtt.service: Deactivated successfully.
Nov 04 12:26:55 Emoncms-Virtual-Machine systemd[1]: Started emoncms_mqtt.service - Emoncms emoncms_mqtt script.
Nov 04 12:26:55 Emoncms-Virtual-Machine emoncms_mqtt[284028]: PHP Warning:  Module "redis" is already loaded in Unknown on line 0
Nov 04 12:26:55 Emoncms-Virtual-Machine emoncms_mqtt[284028]: Already running
Nov 04 12:26:55 Emoncms-Virtual-Machine systemd[1]: emoncms_mqtt.service: Deactivated successfully.

Status: (still dead)

○ emoncms_mqtt.service - Emoncms emoncms_mqtt script
     Loaded: loaded (/etc/systemd/system/emoncms_mqtt.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/emoncms_mqtt.service.d
             └─emoncms_mqtt.conf
     Active: inactive (dead) since Mon 2024-11-04 12:25:44 GMT; 1min 8s ago
   Duration: 80ms
       Docs: https://github.com/emoncms/emoncms/blob/master/docs/RaspberryPi/MQTT.md
    Process: 283935 ExecStartPre=/bin/mkdir -p ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 283937 ExecStartPre=/bin/chown ${USER} ${LOG_PATH} (code=exited, status=0/SUCCESS)
    Process: 283939 ExecStartPre=/bin/touch ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
    Process: 283941 ExecStartPre=/bin/chmod 666 ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
    Process: 283943 ExecStart=/usr/bin/php /var/www/emoncms/scripts/services/emoncms_mqtt/emoncms_mqtt.php (code=exited, status=0/SUCCESS)
   Main PID: 283943 (code=exited, status=0/SUCCESS)
        CPU: 60ms

Before you ask, redis-server doesn’t want to stop lol, I was curious

I’m at a bit of a loss.

I suggest you go back and start again from scratch as something isn’t right.

This is the second time I’ve started it over, I get the same problem each time