I have used emoncms years already to log different kind data in my home.
When there was version 8.7 (if i remember right) i last time added new input in emoncms and after that i have updated new version in somepoint. Today i try to update in to 9.9.8 and it’s worked ok like previous versions but then i try to add new input on it…
Any example what is in input API help page not do anything. Those returning ok or success but nothing coming up in inputs list.
Direct curl commands:
This work (updating values) as there is already input named “Return temperature heat pump”
but following gives return code “ok” but nothing coming up in input list.
And this i got from log: 2019-04-25 11:56:48.496|INFO|index.php|admin/getlog 2019-04-25 11:56:48.984|INFO|index.php|input/post 2019-04-25 11:56:48.996|INFO|index.php|Valid JSON found 2019-04-25 11:56:48.996|INFO|index.php|No time element found in JSON - System time used 2019-04-25 11:56:49.487|INFO|index.php|admin/getlog
Yes, I assume that in last 2 year i have only updated emoncms when stable version has released. But i haven’t added any new input on it so i cannot say when that “adding new input” feature stops working.
Container running X86_64 linux server (fedora) host server. Container is build “FROM php:7.0-apache” with needed dependencies to run emoncms & some other services.
Emoncms part (as well whole ./html directory) is mounted out from docker to “./emoncms-docker/apache_php/html/emoncms” and in this directory i have given that “git checkout tags/9.9.7” command.
An seems that i have right tag.
[root@prelude emoncms]# cat version.txt
9.9.7
We are not currently as precise as that in terms of the tags and version numbers The stable branch is the one to checkout before doing anything.
There is a script in the usefulscripts repo to update emoncms by git (update_emoncms.sh). This does assume you are on the right branch (stable).
Try that as often you need to update some of the other installed non-core Modules as well. It works off the stable branch which is the latest version. Hopefully you will be able to login, if you can, go to admin and do a database update. If not you will need to do a manual database update using this script emoncmsdbupdate.php. I’m not exactly sure how you will run that under a docker though.
I run this a second time as i forget to change in to master branch in first time.
root@6cafd902eee6:/var/www/html/emoncms/usefulscripts# ./update_emoncms.sh
Update emoncms....
Already up-to-date.
Update emoncms/app....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.2.1-11-g4dd7450
Update emoncms/dashboard....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.3.3-14-g554eb38
Update emoncms/graph....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.2.3-16-gce6dd74
Restarting docker: [root@prelude emoncms-docker]# docker-compose restart web
Version shoving on bottom of page 9.9.9-beta
And database update:
and then first example in input api page: Running it → getting succeed message but still nothing on inputs page.
And the i read that you said that i need to use stable branch. so let’s jump to beginning…
[root@prelude emoncms-docker]# docker exec -it emoncms-docker_web_1 /bin/bash
root@6cafd902eee6:/var/www/html# cd emoncms/
root@6cafd902eee6:/var/www/html/emoncms# git checkout stable
Branch stable set up to track remote branch stable from origin.
Switched to a new branch 'stable'
root@6cafd902eee6:/var/www/html/emoncms# git branch
master
show
* stable
root@6cafd902eee6:/var/www/html/emoncms# ./usefulscripts/update_emoncms.sh
Update emoncms....
Already up-to-date.
Update emoncms/app....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.2.1-11-g4dd7450
Update emoncms/dashboard....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.3.3-14-g554eb38
Update emoncms/graph....
Already up-to-date.
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
1.2.3-16-gce6dd74
Restarting…and version in bottom of page is: 9.9.8 …doing db update … testing example and still same results. Input page do not show new inputs.
Just one comment. I can add and delete tables in mysql with using remote connection and emoncms3 account.
And when i drop emoncms3 database and restart everything then examples and my own inputs works fine. So DB is corrupted someway.
Now i need to figure out how i can save my data what i have gathered over years… any hint?
Is the data in the sql database or in the data files? As this was an old install, it could be the former. What are these set to in your settings.php file
You could try the export script emoncms-export.sh which should export everything and see how that works. Possible that exporting and reimporting will clear the corruption.
Sadly in this case but i hace all data in mysql tables.
I read emoncms-export.sh and emoncms-import.sh scripts thru and seems that those just make dump/restore from whole database so it could not help in this case as i have checked that mariadb tables are not corrupted. (+ if i read emoncms logs right then it not even try to send anything in to db)
And nothing in mysql logs (i haven’t tried debug logging)
I hope that there is some other way than just put system up and running again with all inputs and then “just” copy data in db from old feeds to new installation. It could be a but painful operation as i have 108 active feeds there.
Anyway, it’s time to do something else and look this again tomorrow with a fresh eyes and brains. Thank you from your help borpin.