Community
OpenEnergyMonitor

Community

Problem after upgrading / installing newer version of emoncms

Tags: #<Tag:0x00007f6e0f55a198> #<Tag:0x00007f6e0f55a008> #<Tag:0x00007f6e0f559db0>

I tried to upgrade an install I had of emoncms installed locally, in particular I wanted to use emonhub. I went to the admin page and tried from there with no luck. I then looked at the pages on github.

I initially had an issue because I wanted emoncms in a different www directory but in part of the script it is hardcoded, so initially there were no web pages installed. I am now at a stranger point. I have the web up and I am receiving inputs from emonhub after some trial and error.

However the issue I now have is that when I click on feeds, I just get the spinning (sun?) icon. The previous inputs I have defined are still visible, and there were several feeds before. I’m guessing the system is failing because of those? There is nothing written to the log files for this. The last thing in the log file is for mosquitto because it was not installed.

I’ve been able to track down and resolve or work through several issues but this has me beat for now.

I notice that on my input, I tried to create a feed, and it shows this:
image
Still have nothing loading when I hit the feed button.
Is there a setting I can change for more debug information? I’m guessing there is a database schema discrepancy. Not sure if it can be resolved or if I will have to clean the existing feeds and data?

Sorry, I don’t know enough about installing or re-installing emonCMS to be able to help.

But the first things anyone who tries to help you will need to know what platform it’s on, and what version you were coming from.

Thanks. So, I still have the old emoncms web installation. Going to that page shows:
Emoncms

Emoncms

Version
10.2.2
Modules
Administration | App v2.1.0 | Dashboard v2.0.6 | Device v2.0.4 | EventProcesses | Feed | Graph v2.0.8 | Input | CoreProcess | Schedule | Time | User | Visualisation
Git

URL
    https://github.com/emoncms/emoncms.git
Branch
    * stable
Describe
    10.2.2

Server

OS
Linux 4.19.97-v7+
Running on raspbian lite buster

So, on this version it does show the feeds, including the new Vrms that I created. However, both versions show:

Services

emonhub Active Running
feedwriter Inactive DeadService is not running loading…
service-runner Active Running
redis-server Active Running
mosquitto Active Running
demandshaper Activating Auto-restart

On an RPi? How did you install it and when?

In what way did you have ‘no luck’?

Do you mean you ran the emonScript? over the top of the existing install?

Looks to me that emonhub is running and feedwriter has stopped (that is probably why you are not getting any feeds).

what does

sudo systemctl status {emonhub.service,feedwriter.service}

give?

I have a pi that is running apache, munin, traccar. I added emoncms with the intention of feeding data from my solar - I see that I have files and directories dating back to 2018. I’m sure at that point I followed the instructions I could find to install the application.
When I tried to update the app from the admin page, if I hit the button the page reloaded without anything obvious happening, including nothing showing in log files.
Yes, I ran the install scripts from github - I now realize there is also an update script that may have been a better choice.

● emonhub.service - emonHub service description
   Loaded: loaded (/opt/openenergymonitor/emonhub/service/emonhub.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-06-17 10:16:25 EDT; 5h 33min ago
  Process: 12198 ExecStartPre=/bin/mkdir -p /var/log/emonhub/ (code=exited, status=0/SUCCESS)
  Process: 12199 ExecStartPre=/bin/chgrp -R emonhub /var/log/emonhub/ (code=exited, status=0/SUCCESS)
  Process: 12200 ExecStartPre=/bin/chmod 775 /var/log/emonhub/ (code=exited, status=0/SUCCESS)
 Main PID: 12201 (python3)
Tasks: 3 (limit: 2179)
   Memory: 14.5M
   CGroup: /system.slice/emonhub.service
       └─12201 python3 /usr/local/bin/emonhub/emonhub.py --config-file=/etc/emonhub/emonhub.conf --logfile=/var

Jun 17 10:16:25 munitrac systemd[1]: Starting emonHub service description...
Jun 17 10:16:25 munitrac systemd[1]: Started emonHub service description.

● feedwriter.service - Emoncms feedwriter script
   Loaded: loaded (/var/www/html/emoncms/scripts/services/feedwriter/feedwriter.service; enabled; vendor preset: en
   Active: inactive (dead) since Tue 2020-06-16 21:35:23 EDT; 18h ago
 Docs: https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-feedwriter.md
 Main PID: 4911 (code=exited, status=0/SUCCESS)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

This helped, and now gives:
sudo systemctl enable feedwriter.service
[email protected]:~# systemctl restart feedwriter.service
[email protected]:~# systemctl status feedwriter.service
● feedwriter.service - Emoncms feedwriter script
Loaded: loaded (/var/www/html/emoncms/scripts/services/feedwriter/feedwriter.service; enabled; vendor preset: en
Active: activating (auto-restart) (Result: exit-code) since Wed 2020-06-17 15:53:05 EDT; 5s ago
Docs: https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-feedwriter.md
Process: 10813 ExecStartPre=/bin/mkdir -p ${LOG_PATH} (code=exited, status=0/SUCCESS)
Process: 10814 ExecStartPre=/bin/chown ${USER} ${LOG_PATH} (code=exited, status=0/SUCCESS)
Process: 10815 ExecStartPre=/bin/touch ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
Process: 10816 ExecStartPre=/bin/chmod 666 ${LOG_PATH}/emoncms.log (code=exited, status=0/SUCCESS)
Process: 10817 ExecStart=/usr/bin/php /var/www/emoncms/scripts/feedwriter.php (code=exited, status=1/FAILURE)
Main PID: 10817 (code=exited, status=1/FAILURE)

Jun 17 15:53:05 munitrac systemd[1]: feedwriter.service: Main process exited, code=exited, status=1/FAILURE
Jun 17 15:53:05 munitrac systemd[1]: feedwriter.service: Failed with result 'exit-code'.

I see here, that even having set the environment for emoncs_www, the feed service is still looking at the default location. I’ve changed the feedwriter.service file and the service starts and the admin page shows it green.
Demandshaper is still red and says activating. This really doesn’t apply to me so I’m not too concerned and would be ok removing it.

Unfortunately, feeds still hangs when I select the page.

Feed writer service is triggered by the symbolic link in this folder

[email protected]:/lib/systemd/system $ ls -la feed*
lrwxrwxrwx 1 root root 63 Oct 17  2019 feedwriter.service -> /var/www/emoncms/scripts/services/feedwriter/feedwriter.service

Restore the feedwriter service file to how it was and then change the symbolic link to point to the right place.

Then

sudo systemctl daemon-reload
sudo systemctl restart feedwriter.service

The newer emonscripts do cope with a different base location better.

Hi Brian,
Here’s what I have:

    ls -la fee*
    lrwxrwxrwx 1 root root 68 Jun 16 20:56 feedwriter.service -> /var/www/html/emoncms/scripts/services/feedwriter/feedwriter.service

So, the service file was correctly linked - it has yesterday’s date from my install.
What I changed was in the service file:

[Service]
Type=idle
ExecStart=/usr/bin/php /var/www /htmlemoncms/scripts/feedwriter.php

I guess in hindsight I could / should have just used the default /var/www/emoncms and then changed my apache configuration to map that to http://server/emoncms

I’m still not making any headway on resolving the feeds page or information unfortunately.

If feedwriter isn’t running you won’t.

I’m sorry, I don’t know what might be causing it and right now do not have time to debug a non-standard install.

Ok, I was getting ready to do a fresh install. As part of that I went to backup the existing installation.

I had previously seen in the error logs reference to not finding phpfina files and I had seen that the old installation I had was using /var/lib/phpfina but the new code was looking in /var/opt/emoncms/phpfina
Looking at the backup module and running a backup I realised that there was also a phptimeseries directory. Copying files to the new location, the new version is up and running!

1 Like