Emonhub stopped and can't restart

Dear,

I couldn’t connect tot emoncms.
After a restart admin shows that emonhub failed to start.

The attached photo shows the result of the “systemctl emonhub service”.
But it doesn’t say much about the cause.

And during reboot it shows an under-voltage error although I bought the orginal power supply of 1.2 Amp.

The SD card is running emonSD-17Oct19.

What can I do?

1 Like

Has anything changed? Did you run an update?

If you enable SSH and connect using puTTY (or just the cmd program on Windows), you will be able to copy and paste between the forum and the emonPi.

Yes, I changed some T sensor names.
And I checked the update: this was already the latest.

And I can connect via putty / SSH.

As in you tried to run the update and it told you that?

Please run the update and post the update log.

I just run the update.
Hereby the log after the update.
The log stops at “restarting service-runner”, no lines more than up to there.

Starting update via service-runner-update.sh (v3.0) >
- emonSD version: emonSD-17Oct19
emonSD base image check passed...continue update
git pull /opt/openenergymonitor/EmonScripts
  master
* stable
On branch stable
Your branch is up to date with 'origin/stable'.

nothing to commit, working tree clean
Already up to date.
-------------------------------------------------------------
Main Update Script
-------------------------------------------------------------
Date: Mon 29 Jun 07:04:39 BST 2020
EUID: 1000
openenergymonitor_dir: /opt/openenergymonitor
type: all
firmware: none
Hardware detected: rfm2pi
git pull /opt/openenergymonitor/emonpi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
Already up to date.
git pull /opt/openenergymonitor/RFM2Pi
* master
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
Fetching origin
Already up to date.
Start emonhub update script:
-------------------------------------------------------------
emonHub update
-------------------------------------------------------------
git pull /opt/openenergymonitor/emonhub
git fetch --all --prune -v
Fetching origin
From https://github.com/openenergymonitor/emonhub
 = [up to date]      stable                 -> origin/stable
 = [up to date]      MQTTSubscriberInterfacer -> origin/MQTTSubscriberInterfacer
 = [up to date]      SDS011                 -> origin/SDS011
 = [up to date]      emon-pi                -> origin/emon-pi
 = [up to date]      env_example            -> origin/env_example
 = [up to date]      lanip-status           -> origin/lanip-status
 = [up to date]      master                 -> origin/master
 = [up to date]      redis_config_interface -> origin/redis_config_interface
 = [up to date]      unitless_decoder       -> origin/unitless_decoder
git status
On branch stable
Your branch is up to date with 'origin/stable'.

nothing to commit, working tree clean
git pull origin stable
From https://github.com/openenergymonitor/emonhub
 * branch            stable     -> FETCH_HEAD
Already up to date.
sudo: pip3: command not found
- Service ActiveState=active
Running emonhub automatic node addition script
[[5]]
Node 5 already present
[[6]]
Node 6 already present
[[7]]
Node 7 already present
[[8]]
Node 8 already present
[[9]]
Node 9 already present
[[10]]
Node 10 already present
[[11]]
Node 11 already present
[[12]]
Node 12 already present
[[13]]
Node 13 already present
[[14]]
Node 14 already present
[[15]]
Node 15 already present
[[16]]
Node 16 already present
[[19]]
Node 19 already present
[[20]]
Node 20 already present
[[21]]
Node 21 already present
[[22]]
Node 22 already present
[[23]]
Node 23 already present
[[24]]
Node 24 already present
[[25]]
Node 25 already present
[[26]]
Node 26 already present

Start emoncms update:
-------------------------------------------------------------
Update Emoncms Core
-------------------------------------------------------------


Checking status of /var/www/emoncms git repository
- git branch: stable
- no local changes
- running: git pull origin stable

Fetching origin
From https://github.com/emoncms/emoncms
 * branch              stable     -> FETCH_HEAD
Already up to date.

Update Emoncms database
[]

-------------------------------------------------------------
Update Emoncms Services
-------------------------------------------------------------
emoncms_mqtt.service already installed
feedwriter.service already installed
service-runner.service already installed

Reloading systemctl deamon
Restarting Services...
- sudo systemctl restart feedwriter.service
--- ActiveState=active ---
- sudo systemctl restart emoncms_mqtt.service
--- ActiveState=active ---
- sudo systemctl restart emonhub.service
--- ActiveState=active ---
/opt/openenergymonitor/EmonScripts/sudoers.d/emoncms-rebootbutton: parsed OK
emonPi emoncms admin reboot button sudoers updated

-------------------------------------------------------------
Update Emoncms Modules
-------------------------------------------------------------
------------------------------------------
Updating /var/www/emoncms/Modules/app module
------------------------------------------
- git branch: stable
- git tags: 2.1.1-42-ge5d51a4
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/config module
------------------------------------------
- git branch: stable
- git tags: 2.0.5
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/dashboard module
------------------------------------------
- git branch: stable
- git tags: 2.0.7
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/device module
------------------------------------------
- git branch: stable
- git tags: 2.0.5
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/graph module
------------------------------------------
- git branch: stable
- git tags: 2.0.9
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/setup module
------------------------------------------
- git branch: stable
fatal: No names found, cannot describe anything.
- git tags: 
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

------------------------------------------
Updating /var/www/emoncms/Modules/wifi module
------------------------------------------
- git branch: stable
- git tags: 2.0.0-29-g274bcd5
- no local changes
- running: git pull origin stable

Fetching origin
Already on 'stable'
Your branch is up to date with 'origin/stable'.
Already up to date.

/opt/openenergymonitor/EmonScripts/sudoers.d/wifi-sudoers: parsed OK
wifi sudoers entry updated
------------------------------------------
Updating /opt/emoncms/modules/backup module
------------------------------------------
- git branch: stable
- git tags: 2.2.2-6-g70894e1
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/demandshaper module
------------------------------------------
- git branch: stable
- git tags: 1.2.4-5-gd689aae
- no local changes
- running: git pull origin stable

error: cannot lock ref 'refs/remotes/origin/modular_forecasts': unable to resolve reference 'refs/remotes/origin/modular_forecasts': reference broken
From https://github.com/emoncms/demandshaper
 ! [new branch]      modular_forecasts -> origin/modular_forecasts  (unable to update local ref)
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/postprocess module
------------------------------------------
- git branch: stable
- git tags: 2.1.3-4-g5c50627
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/sync module
------------------------------------------
- git branch: stable
- git tags: 2.0.5
- no local changes
- running: git pull origin stable

Already up to date.
Already on 'stable'
Your branch is up to date with 'origin/stable'.

------------------------------------------
Updating /opt/emoncms/modules/usefulscripts module
------------------------------------------
- git branch: stable
fatal: No names found, cannot describe anything.
- git tags: 
- git status:

On branch stable
Your branch is up to date with 'origin/stable'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   integritycheck/integritycheck.php

no changes added to commit (use "git add" and/or "git commit -a")


--------------------------------------------
Backup module installation and update script
--------------------------------------------
- Loading EmonScripts config.ini
- Copying default.config.cfg to config.cfg
- Setting config.cfg settings
- Backup module symlink already exists
- PHP Version: 7.3
- Creating /etc/php/7.3/mods-available/emoncmsbackup.ini
post_max_size = 3G
upload_max_filesize = 3G
upload_tmp_dir = /var/opt/emoncms/backup/uploads
- phpenmod emoncmsbackup
- /var/opt/emoncms/backup already exists
- /var/opt/emoncms/backup/uploads already exists
- restarting apache

Update Emoncms database
[]


-------------------------------------------------------------
emonPi update done: Mon 29 Jun 07:05:18 BST 2020
-------------------------------------------------------------
restarting service-runner

This line is the problem. @TrystanLea. pip3 and python3 not installed by borpin · Pull Request #100 · openenergymonitor/EmonScripts · GitHub

SSH into the emonPi.

No need to change directory

run these commands one at a time

sudo apt update
sudo apt-get install -y python3-serial python3-configobj python3-pip
sudo pip3 install paho-mqtt requests

Then run the update again.

@glyn.hudson @TrystanLea - error here on update.

@emontxv3 - did you make this change? If so it is blocking the update for this module.

Thx, but I got an error with the install line:

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun 29 08:17:59 2020 from 192.168.0.38
pi@emonpi:~ $
pi@emonpi:~ $ sudo apt update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
pi@emonpi:~ $ sudo apt-get install -y python3-serial python3-configobj python3-p                ip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-serial is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-serial' has no installation candidate
E: Unable to locate package python3-configobj

Can you try the sudo apt update again. You should get more ‘hits’ than that.

Herrby the second result but still the same error:

pi@emonpi:~ $  sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
pi@emonpi:~ $ sudo apt-get install -y python3-serial python3-configobj python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-serial is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-serial' has no installation candidate
E: Unable to locate package python3-configobj
pi@emonpi:~ $

First if you paste terminal output or code please put 3 backticks (top left of keyboard) on a line before and 3 on a line after so it formats correctly (you can edit the post above).

Second - something isn’t right with apt. Have you changed anything?

ok, I will do about the backtics.

But second I do not know what I could have changed so that the apt doesn’t work. This is all very strange for me too.

Ok just checking to see if you had.

Please try

grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/

and post the output (with backticks :slight_smile:)

looks like something strange is going on:

pi@emonpi:~ $ grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
/etc/apt/sources.list:deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
/etc/apt/sources.list.d/raspi.list:deb http://archive.raspberrypi.org/debian/ buster main
pi@emonpi:~ $ sudo grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
/etc/apt/sources.list:deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
/etc/apt/sources.list.d/raspi.list:deb http://archive.raspberrypi.org/debian/ buster main
pi@emonpi:~ $

That looks correct. Wonder why it is not pulling them all in If I do an update I get;

sudo apt update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian buster/contrib armhf Packages [58.7 kB]
Get:6 http://raspbian.raspberrypi.org/raspbian buster/non-free armhf Packages [104 kB]
Fetched 13.5 MB in 2min 50s (79.9 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
55 packages can be upgraded. Run 'apt list --upgradable' to see them.

could it be that the sd card is damaged?

Possibly, but I sort of doubt it.

Try this

sudo dpkg --configure -a

then the update again.

the result off "apt list --upgradable

Listing... Done
raspi-config/testing 20200601 all [upgradable from: 20191008]
N: There is 1 additional version. Please use the '-a' switch to see it

No don’t do that.

the result on this:

pi@emonpi:~ $ sudo apt update
Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Get:3 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Fetched 363 kB in 2s (173 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
pi@emonpi:~ $ sudo apt-get install -y python3-serial python3-configobj python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3-serial is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-serial' has no installation candidate
E: Unable to locate package python3-configobj
pi@emonpi:~ $