Just pulled the master off emoncms GitHub and now I am getting the “Database error, you may need to run database update” message.
The solution on the linked page does not work for me as this is a self hosted install and that php file is not in the main repository (as far as I can see).
The solution was to copy the ‘emoncmsdbupdate.php’ text into a file (in the home directory), make it executeable and run it.
Might be worth adding this to the useful scripts repository rather than exclusively in the emonpi repository. Even better would be to provide a link in the error message so you could just click it.
There’s not really an easy way around requiring a database update after certain emoncms updates unfortunately, especially after we moved to prepared mysql queries to improve security which require explicit statement of the query fields…
Just got home, downloaded and ran emoncmsdbupdate.php which updated the database, and got me access OK.
If all users of self-builds are expected to have to run this script to update their database, wouldn’t it make sense to include the script (as an executable file) in the emoncms repo, probably within emoncms/scripts ?
So users who are locked out, can simply run a single command to update their database, instead of searching for the file, downloading it, making it executable, etc.
Hi,
ran into the same error (after illegal shutdown) . Copied emoncmsdbupdate.php to a file in home/pi$
made it executable : sudo chmod +x emoncmsdbupdate.php
run with: ./emoncmsdbupdate.php
and getting al kinds off errors:
./emoncmsdbupdate.php
./emoncmsdbupdate.php: line 1: ?php: No such file or directory
./emoncmsdbupdate.php: line 2: //: Is a directory
./emoncmsdbupdate.php: line 3: =: command not found
./emoncmsdbupdate.php: line 4: syntax error near unexpected token 'EMONCMS_EXEC',' ./emoncmsdbupdate.php: line 4: define(‘EMONCMS_EXEC’, 1);’
what am i doing wrong?
many thanks for your advice
ps : the same happens if done in /var/www/emoncms/