Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Broken menus / graphs after EmonCMS update & "Uncaught referenceError: menu is not defined" error?

After a bit of a problem with inputs via MQTT (I added 60 new input and FeedWriter went weird) I ended up rebooting my EmonPi, which hasn’t happened in years. I think from the Admin/Update Log there has been an update during the restart (or it’s possible I clicked Full Update by accident?), either way my install had been brought up to date, which is probably about time!

HOWEVER, I now have issues with the menus. Firstly Apps/Dashboards/DemandShaper have disappeared from the horizontal menu. And Graphs/Emonhub/Post Process/Sync/Backup/Wifi from the vertical menu have gone.

The dashboards are still there if I use a bookmark, but the Graphs bookmarks and clicking a feed to get to its graph give an error -
image

I’ve googled and cleared the browser cache - no change, and run the updates again - no more updates needed. So now I’m a bit stuck. Any ideas?

Lee

Hello @Vster if you navigate to Admin > Components are there any components/modules that look like they have not updated? Might be due to local changes or they might not all be on a consistent branch e.g stable vs master?

Hi @TrystanLea

I’ve not made any local changes to EmonCMS, it’s all stock.

Not sure what I’m expecting to see -



But I don’t see any obvious errors above, or in the update log.

Hello @Vster do you see this page:


If you could share a screenshot from that page it would be really useful

Maybe try some of these commands.
cd /var/www/emoncms && git pull

cd /var/www/emoncms
git pull
cd /var/www/emoncms/Modules/app
git pull

Worth a try from a different browser or machine just to completely eliminate the client end as a possible cause?

(Apologies if you’ve tried this already.)

James

Hi Chaps,

@TrystanLea I don’t have the Component menu. What’s the URL to it?
@JasF Yep, tried that first. Cleared browser cache, then different browser and different laptop. No change.
@dlmpryor Ah, now you’re onto something.

[email protected]:~ $ cd /var/www/emoncms
[email protected]:/var/www/emoncms $ git pull
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 17 (delta 8), reused 13 (delta 6), pack-reused 0
Unpacking objects: 100% (17/17), done.
From GitHub - emoncms/emoncms: Web-app for processing, logging and visualising energy, temperature and other environmental data
f5597e48…a50e1fb9 master → origin/master
Updating 1a5aee34…d240d513
error: Your local changes to the following files would be overwritten by merge:
Modules/input/input_methods.php
Please commit your changes or stash them before you merge.
Aborting
[email protected]:/var/www/emoncms $ cd /var/www/emoncms/Modules/app/
[email protected]:/var/www/emoncms/Modules/app $ git pull
Already up to date.

Ah, I’ve found the “git diff” command -

[email protected]:/var/www/emoncms/Modules/app $ cd /var/www/emoncms
[email protected]:/var/www/emoncms $ git diff
diff --git a/Modules/input/input_methods.php b/Modules/input/input_methods.php
index 32ec902b..68accd8c 100644
--- a/Modules/input/input_methods.php
+++ b/Modules/input/input_methods.php
@@ -57,7 +57,7 @@ class InputMethods
         if ($param->exists('time')) {
             $inputtime = $param->val('time');
             // Remove from array so no used as an input
-            unset($jsondataLC['time']);
+            // unset($jsondataLC['time']);

             // validate time
             if (is_numeric($inputtime)){
[email protected]:/var/www/emoncms $

Well, that’s embarrassing! I had made a change to input_method.php, on the advice of @borpin as a fix to issues I was having imported data from WeeWX/WeatherStation.
Glad to see the change is in the new version of input_method.php.
WIth change removed git dragged down a whole pile of files and and the menus are fixed and then new Components menu is there and everything is updated!

Many thanks chaps!