Community
OpenEnergyMonitor

Community

Help: "Fatal error: . . . " after emonPi update


(Carlos AG) #21

Hi, sorry for not replying.

Pepe, caballero, no need to loose the data, specially if you configured the feeds to be PHPFINA (fixed interval) as they get stored in different files and not in the mysql database. But we’ll look into recovering data if no other option works.

I am wondering (and hoping) that it may only be the Dashboard table that got broken. So if we delete the Dashboard module we will skip its table when updating the database. Hopefully the rest of database update will carry on updating without a problem. If it doesn’t work we can reinstall the module again.

So please delete the Dashoboard module with:
rm - R /var/www/emoncms/Modules/dashboard/

And then run the database updater script again and tell us what happens.

¡Buena suerte Pepe!


(Paul) #22

It would be a good idea to make a copy of the emoncms sql database before attempting this so that if it doesn’t work out you can restore back to this position. Plus there is no way to recover any data from a deleted table and it hasn’t been confirmed as beyond repair yet.


(Carlos AG) #23

Deleting the module will not delete the table in the database.

But you are totally right it make sense to do a database backup at this stage just in case.

The command to do it should be something like
mysqldump -u emoncms -p emoncms > file_name_for_your_backup.sql

Then it should ask you for the password, it should be emonpiemoncmsmysql2016


(Paul) #24

My bad, it was a flying visit and I initially read it as deleting the table, not the module and just blurted out a suggestion to back up, hopefully before any deleting was done.

I’d be interested to know if/how replacing the module, not the table would correct a corrupt table, but fingers crossed. . .

Perhaps the table needs reading manually from the commandline to see if it’s any one field/column that’s causing an issue, maybe it can be corrected manually if there is something obvious?


(Jose) #25
[email protected](ro):~$ rpi-rw
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
[email protected](rw):~$ mysqldump -u emoncms -p emoncms > copiaseguridad.sql
Enter password:
mysqldump: Got error: 1017: Can't find file: 'dashboard' (errno: 2) when using LOCK TABLES
[email protected](rw):~$ cd /var/www/emoncms/Modules/dashboard/
[email protected](rw):dashboard$ ls -l
total 552
drwxr-xr-x  4 pi pi   4096 Jan  6 19:01 AntiXSS
lrwxrwxrwx  1 pi pi      9 Jan  6 19:01 dashboard -> dashboard
-rw-r--r--  1 pi pi 133840 Mar 28  2016 Dashboard2.JPG
-rw-r--r--  1 pi pi   3657 Jan  6 19:01 dashboard_controller.php
-rw-r--r--  1 pi pi   1279 Jan  6 19:01 dashboard.js
-rw-r--r--  1 pi pi  43081 Jan  6 19:02 dashboard_langjs.php
-rw-r--r--  1 pi pi   1673 Oct 30  2016 dashboard_menu.php
-rw-r--r--  1 pi pi  10240 Jan  6 19:01 dashboard_model.php
-rw-r--r--  1 pi pi 297664 Mar 28  2016 dashboard.png
-rw-r--r--  1 pi pi    970 Jan  6 19:01 dashboard_schema.php
-rw-r--r--  1 pi pi  32386 Jan  6 19:01 LICENSE.txt
drwxr-xr-x 11 pi pi   4096 Jan  6 19:01 locale
-rw-r--r--  1 pi pi     67 Jan  6 19:01 module.json
-rw-r--r--  1 pi pi    863 Jan  6 19:02 Readme.md
drwxr-xr-x  4 pi pi   4096 Jan  6 19:02 Views
drwxr-xr-x 23 pi pi   4096 Jan  6 19:01 widget
[email protected](rw):dashboard$ cd..
-bash: cd..: command not found
[email protected](rw):dashboard$ cd ..
[email protected](rw):Modules$ mv dashboard dashboard.old
[email protected](rw):Modules$ ls
admin  app  backup  config  dashboard.old  device  eventp  feed  graph  input  postprocess  process  schedule  setup  sync  time  user  vis  wifi
[email protected](rw):Modules$ cd \
>
[email protected](rw):~$ php /home/pi/emonpi/emoncmsdbupdate.php
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
PHP Notice:  Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226

Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 226
{"0":"ALTER TABLE `device` ADD `id` int(11) NOT NULL auto_increment PRIMARY KEY","1":"ALTER TABLE `device` ADD `userid` int(11)","2":"ALTER TABLE `device` ADD `nodeid` text","3":"ALTER TABLE `device` ADD `name` text","4":"ALTER TABLE `device` ADD `description` text","5":"ALTER TABLE `device` ADD `type` varchar(32)","6":"ALTER TABLE `device` ADD `devicekey` varchar(64)","7":"ALTER TABLE `device` ADD `time` int(10)","8":"ALTER TABLE `feeds` ADD `id` int(11) NOT NULL auto_increment PRIMARY KEY","9":"ALTER TABLE `feeds` ADD `name` text","10":"ALTER TABLE `feeds` ADD `userid` int(11)","11":"ALTER TABLE `feeds` ADD `tag` text","12":"ALTER TABLE `feeds` ADD `time` int(10)","13":"ALTER TABLE `feeds` ADD `value` double","14":"ALTER TABLE `feeds` ADD `datatype` int(11) NOT NULL","15":"ALTER TABLE `feeds` ADD `public` tinyint(1) DEFAULT '0'","16":"ALTER TABLE `feeds` ADD `size` int(11)","17":"ALTER TABLE `feeds` ADD `engine` int(11) DEFAULT '0' NOT NULL","18":"ALTER TABLE `feeds` ADD `server` int(11) DEFAULT '0' NOT NULL","19":"ALTER TABLE `feeds` ADD `processList` text","20":"ALTER TABLE `feeds` ADD `unit` varchar(10) DEFAULT ''","21":"ALTER TABLE `graph` ADD `id` int(11) NOT NULL auto_increment PRIMARY KEY","22":"ALTER TABLE `graph` ADD `userid` int(11)","23":"ALTER TABLE `graph` ADD `groupid` int(11) DEFAULT '0'","24":"ALTER TABLE `graph` ADD `data` text","25":"ALTER TABLE `postprocess` ADD `userid` int(11)","26":"ALTER TABLE `postprocess` ADD `data` text","27":"ALTER TABLE `setup` ADD `state` varchar(32) DEFAULT 'unconfigured'","28":"ALTER TABLE `setup` ADD `wifi` varchar(32) DEFAULT 'unconfigured'","29":"ALTER TABLE `sync` ADD `userid` int(11)","30":"ALTER TABLE `sync` ADD `host` varchar(64)","31":"ALTER TABLE `sync` ADD `username` varchar(30)","32":"ALTER TABLE `sync` ADD `apikey_read` varchar(64)","33":"ALTER TABLE `sync` ADD `apikey_write` varchar(64)","34":"ALTER TABLE `users` ADD `id` int(11) NOT NULL auto_increment PRIMARY KEY","35":"ALTER TABLE `users` ADD `username` varchar(30)","36":"ALTER TABLE `users` ADD `email` varchar(64)","37":"ALTER TABLE `users` ADD `password` varchar(64)","38":"ALTER TABLE `users` ADD `salt` varchar(32)","39":"ALTER TABLE `users` ADD `apikey_write` varchar(64)","40":"ALTER TABLE `users` ADD `apikey_read` varchar(64)","41":"ALTER TABLE `users` ADD `lastlogin` datetime","42":"ALTER TABLE `users` ADD `admin` int(11) NOT NULL","43":"ALTER TABLE `users` ADD `gravatar` varchar(30) DEFAULT ''","44":"ALTER TABLE `users` ADD `name` varchar(30) DEFAULT ''","45":"ALTER TABLE `users` ADD `location` varchar(30) DEFAULT ''","46":"ALTER TABLE `users` ADD `timezone` varchar(64) DEFAULT 'UTC'","47":"ALTER TABLE `users` ADD `language` varchar(5) DEFAULT 'en_EN'","48":"ALTER TABLE `users` ADD `bio` text","49":"ALTER TABLE `users` ADD `tags` text","50":"ALTER TABLE `users` ADD `startingpage` varchar(64) DEFAULT 'feed\/list'","51":"ALTER TABLE `users` ADD `email_verified` int(11) DEFAULT '0'","52":"ALTER TABLE `users` ADD `verification_key` varchar(64) DEFAULT ''","53":"ALTER TABLE `users` ADD `preferences` varchar(255)","54":"ALTER TABLE `rememberme` ADD `persistentToken` varchar(40)","error":"Can't find file: 'device' (errno: 2)"}
[email protected](rw):~$


(Carlos AG) #26

Oh Pepe,

Of course you cannot do the backup of the whole database when one of the tables in the schema is broken, I should have realised about it

Another table that seem to be missing :frowning:

Let’s do the backup manually and copy the whole directory of the database:
cp /var/lib/mysql/emoncms your_prefered_destination

And then show us what there is in there:
ls -als /var/lib/mysql/emoncms


(Jose) #27

Thanks for your help!

[email protected](ro):~$ rpi-rw
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
[email protected](rw):~$ cp /var/lib/mysql/emoncms /copiaseguridad
cp: cannot stat â/var/lib/mysql/emoncmsâ: Permission denied
[email protected](rw):~$ sudo cp /var/lib/mysql/emoncms /copiaseguridad
cp: cannot stat â/var/lib/mysql/emoncmsâ: No such file or directory
[email protected](rw):~$ ls
avrdude-rpi  backup_php.ini      data     emonpi      huawei-hilink-status  oem_openHab  phpredis     RFM2Pi  usefulscripts
backup       copiaseguridad.sql  emonhub  emonupload  oem_node-red          php.ini      postprocess  sync
[email protected](rw):~$ ls /var/lib/mysql/
ls: cannot open directory /var/lib/mysql/: Permission denied
[email protected](rw):~$ sudo -i
[email protected](rw):~# cp /var/lib/mysql/emoncms /copiaseguridad2
cp: cannot stat â/var/lib/mysql/emoncmsâ: No such file or directory

(Paul) #28

I think the sql database files were relocated to the data partition without any symlinks on the emonpi image, I don’t have one to hand to check right now.

[edit - can you show us the output from ls -la ~/data ?]


(Jose) #29

Sure!
Here is:

[email protected](ro):~$ ls -la ~/data
total 1313
drwxrwxrwx  8 pi       pi          1024 Jan  6 19:07 .
drwxr-xr-x 20 pi       pi          4096 Jan 11 11:52 ..
-rw-r--r--  1 pi       pi       1203096 Apr 19  2017 emoncms-backup-2017-04-19.tar.gz
-rw-rw-r--  1 pi       www-data       0 Nov  7  2016 emoncms.conf
-rw-r--r--  1 pi       pi           596 Apr 19  2017 emoncms-export.log
-rw-r--r--  1 pi       pi         12063 Apr 19  2017 emoncms.sql
-rw-r--r--  1 pi       pi           129 Jan  6 19:54 emoncms-wifiscan.log
-rw-rw-rw-  1 pi       www-data    7370 Jan  6 19:00 emonhub.conf
-rw-rw-rw-  1 pi       pi         84786 Jan  6 19:03 emonpiupdate.log
drwx-w--w-  2 pi       pi         12288 Jan 21  2016 lost+found
drwx------  5 mysql    mysql       1024 Jan  6 23:16 mysql
drwxr-xr-x  4 pi       pi          1024 Nov  4  2016 node-red
drwxr-xr-x  2 www-data root        1024 Apr  3  2017 phpfina
drwxr-xr-x  2 www-data root        1024 Nov  7  2016 phptimeseries
-rw-r--r--  1 pi       pi           370 Mar 19  2016 readmeta.php
-rw-r--r--  1 root     root         107 Jan  6 23:16 resolv.conf
-rwxrwxrwx  1 pi       pi             0 Jan 22  2016 resolv.conf.dhclient-new
drwxrwxrwx  2 www-data pi          1024 Nov  4  2016 uploads
-rw-r--r--  1 root     root         187 Jan 12 09:10 wificheck.log
-rw-r--r--  1 root     root         202 Jan  6 19:54 wpa_supplicant.conf

A doubt:
Are my electric consumption currently being recorded?
Because if that is not the case, I prefer to lose the old records but register the current ones, making a new and clean installation, and if they can later be recycled or incorporate the historical ones, better, and if not … this is what is !


(Paul) #30

Ok so retry @cagabi’s advice using these paths

cp /home/pi/data/mysql/emoncms your_prefered_destination

and

ls -als /home/pi/data/mysql/emoncms

You should be able to tell from within emoncms if data is being saved, or you can double check the file times in the feed folders e.g.

ls-la /home/pi/data/php{fina,timeseries}

A new image is an option I guess, knowing if your data is in tact and/or can be backed up at this point would help weigh up your options.

Can you also show us the emonpiupdate.log? There may be a clue as to what went wrong in there.


(Jose) #31

It seems that I have a problem with the permissions to access the mysql folder. As my knowledge in Linux is scarce I do not dare to change the owner chmod or things so I see over the internet, lest I break it even more.

[email protected](ro):/$ cp /home/pi/data/mysql/emoncms /home/copia
cp: cannot stat â/home/pi/data/mysql/emoncmsâ: Permission denied
[email protected](ro):/$ ls -als /home/pi/data/mysql/emoncms
ls: cannot access /home/pi/data/mysql/emoncms: Permission denied

It seems that since January 6 there are no news, right?

[email protected](ro):data$ ls -la /home/pi/data/php{fina,timeseries}
/home/pi/data/phpfina:
total 130760
drwxr-xr-x 2 www-data root         1024 Apr  3  2017 .
drwxrwxrwx 8 pi       pi           1024 Jan  6 19:07 ..
-rw-r--r-- 1 www-data www-data 22226176 Jan  6 19:03 2.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 2.meta
-rw-r--r-- 1 www-data www-data 22226176 Jan  6 19:03 3.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 3.meta
-rw-r--r-- 1 www-data www-data 22226176 Jan  6 19:03 4.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 4.meta
-rw-r--r-- 1 www-data www-data 22226176 Jan  6 19:03 5.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 5.meta
-rw-r--r-- 1 www-data www-data 22226172 Jan  6 19:03 6.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 6.meta
-rw-r--r-- 1 www-data www-data 22226172 Jan  6 19:03 7.dat
-rw-r--r-- 1 www-data www-data       16 Apr  3  2017 7.meta

/home/pi/data/phptimeseries:
total 2
drwxr-xr-x 2 www-data root 1024 Nov  7  2016 .
drwxrwxrwx 8 pi       pi   1024 Jan  6 19:07 ..

(Paul) #36

emonpiupdate.log.txt (84.0 KB)

I have rebuilt your logfile and deleted the multiple posts, in future there is a button on the emoncms admin page for downloading the log for attaching to a forum post.

[edit - Actually, it looks like there may be some log missing or jumbled up in the divide and rebuild as the update doesn’t appear to finish. could you post again, from the admin page?]


(Paul) #37

There should be no need to change the permissions of the files, just use sude to elevate your user level eg

sudo cp /home/pi/data/mysql/emoncms /home/copia

(Paul) #38

It seems to look that way. On the admin page of emoncms, what does it say for the buffered write status?

what response do you get for

sudo systemctl status feedwriter

if it’s not running you may be able to restart it with

sudo systemctl restart feedwriter

and save any data that is still held in the buffer but not written to disc yet.
It’s important that you do not reboot if there is any chance to save unwritten data or any data held in ram will be lost.

If you have rebooted recently, there may not be much data to save.


(Jose) #39

emonpiupdate.log.txt (85.2 KB)

I had already tried sudo, but it’s good that you have indicated it to me.

[email protected](ro):~$ sudo cp /home/pi/data/mysql/emoncms /home/copia
cp: omitting directory â/home/pi/data/mysql/emoncmsâ
[email protected](ro):~$

… there is a button on the emoncms admin page
… On the admin page of emoncms, what does it say for the buffered write status?

The problem is that I do not have access to the emoncms administrator page. The error appears before login :wink:

[email protected](ro):~$ sudo systemctl status feedwriter
â feedwriter.service - LSB: feedwriter script daemon
   Loaded: loaded (/etc/init.d/feedwriter)
   Active: active (running) since Sun 2019-01-06 23:16:20 UTC; 5 days ago
  Process: 3242 ExecStart=/etc/init.d/feedwriter start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/feedwriter.service
           ââ3291 /usr/bin/php -f /var/www/emoncms/scripts/feedwriter.php

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[email protected](ro):~$

Good!!! Here it seems that I get something right! Or not?


(Paul) #40

I don’t recall this being so tricky and I have copied the mysql tables using cp before now.

Try changing to the root user with

sudo su

run the commands without “sudo” then

exit

to return to the user pi

Ahh ok! I didn’t realize you couldn’t log in.

Looking at your update log again, the end still seems odd. the updater used to sign off with

...................
emonPi update done
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock

as seen in the 1st half of your file from your update back in April. That is not seen at the end of the file, but it does return to the command prompt, so I’m not sure if the updater has changed? or if your update bailed out before completion.

Maybe someone with more emonpi experience can assist?


(Jose) #41

Using “sudo su” I get the same result.
I believe that you have spent a lot of time with my problem. One of my goals was to find if there is an error in the update script that could affect more users, but at this point I think that tomorrow I will load a new SD with the current version and start again.


(Greebo) #42

Just going back a step… can you check what is actually in the mysql folder?
It’s protected, so you have to use sudo to look at it (let alone copy it)…
Try this (and post the output here):

sudo ls -l /home/pi/data/mysql/emoncms
total 153
-rw-rw---- 1 mysql mysql 8594 Nov  7  2016 app_config.frm
-rw-rw---- 1 mysql mysql  360 Dec 29 07:10 app_config.MYD
-rw-rw---- 1 mysql mysql 1024 Dec 29 07:10 app_config.MYI
-rw-rw---- 1 mysql mysql 9050 Nov 13 10:07 dashboard.frm
-rw-rw---- 1 mysql mysql 1348 Nov 13 10:07 dashboard.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 13 10:07 dashboard.MYI
-rw-rw---- 1 mysql mysql   65 Nov  7  2016 db.opt
-rw-rw---- 1 mysql mysql 8798 Nov 13 10:07 device.frm
-rw-rw---- 1 mysql mysql   24 Nov 16 00:32 device.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 16 00:32 device.MYI
-rw-rw---- 1 mysql mysql 8954 Nov 13 10:07 feeds.frm
-rw-rw---- 1 mysql mysql  660 Dec 22 11:12 feeds.MYD
-rw-rw---- 1 mysql mysql 2048 Dec 22 11:12 feeds.MYI
-rw-rw---- 1 mysql mysql 8656 Nov 13 10:07 graph.frm
-rw-rw---- 1 mysql mysql 1892 Nov 13 10:07 graph.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 13 10:07 graph.MYI
-rw-rw---- 1 mysql mysql 8804 Nov  7  2016 input.frm
-rw-rw---- 1 mysql mysql 2040 Nov 29 10:14 input.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 29 10:14 input.MYI
-rw-rw---- 1 mysql mysql 8658 Nov  7  2016 multigraph.frm
-rw-rw---- 1 mysql mysql    0 Nov  7  2016 multigraph.MYD
-rw-rw---- 1 mysql mysql 1024 Nov  7  2016 multigraph.MYI
-rw-rw---- 1 mysql mysql 8594 Nov 13 10:07 postprocess.frm
-rw-rw---- 1 mysql mysql   20 Dec 22 10:43 postprocess.MYD
-rw-rw---- 1 mysql mysql 1024 Dec 22 10:43 postprocess.MYI
-rw-rw---- 1 mysql mysql 8682 Nov 13 10:07 rememberme.frm
-rw-rw---- 1 mysql mysql  120 Nov 13 10:07 rememberme.MYD
-rw-rw---- 1 mysql mysql 1024 Nov 13 10:07 rememberme.MYI
-rw-rw---- 1 mysql mysql 8734 Nov  7  2016 schedule.frm
-rw-rw---- 1 mysql mysql  212 Jul 15  2017 schedule.MYD
-rw-rw---- 1 mysql mysql 2048 Jul 16  2017 schedule.MYI
-rw-rw---- 1 mysql mysql 8592 Jun 22  2017 setup.frm
-rw-rw---- 1 mysql mysql   28 Jun 22  2017 setup.MYD
-rw-rw---- 1 mysql mysql 1024 Jun 22  2017 setup.MYI
-rw-rw---- 1 mysql mysql 8722 Jul  1  2018 sync.frm
-rw-rw---- 1 mysql mysql    0 Jul  1  2018 sync.MYD
-rw-rw---- 1 mysql mysql 1024 Jul  1  2018 sync.MYI
-rw-rw---- 1 mysql mysql 9338 Nov 13 10:07 users.frm
-rw-rw---- 1 mysql mysql  232 Nov 13 10:07 users.MYD
-rw-rw---- 1 mysql mysql 2048 Nov 13 10:07 users.MYI

Do you get a similar listing? If not, please paste the output of:
sudo ls -l /home/pi/data/mysql

If the first one gave similar output, we might be able to tell from the dates of the files (along with the dates in the updatelog) if it was the update that caused the problem.


(Jose) #43

Well, I think that’s similar:

[email protected](ro):~$ sudo ls -l /home/pi/data/mysql/emoncms
total 149
-rw-rw---- 1 mysql mysql 8594 Nov  7  2016 app_config.frm
-rw-rw---- 1 mysql mysql   68 May 14  2017 app_config.MYD
-rw-rw---- 1 mysql mysql 1024 May 27  2017 app_config.MYI
-rw-rw---- 1 mysql mysql 9050 Jan  6 19:04 dashboard.frm
-rw-rw---- 1 mysql mysql   65 Nov  7  2016 db.opt
-rw-rw---- 1 mysql mysql 8798 Jan  6 19:04 device.frm
-rw-rw---- 1 mysql mysql 8954 Jan  6 19:04 feeds.frm
-rw-rw---- 1 mysql mysql  508 Jan  6 19:04 feeds.MYD
-rw-rw---- 1 mysql mysql 8656 Jan  6 19:04 graph.frm
-rw-rw---- 1 mysql mysql 1352 Jan  6 19:04 graph.MYD
-rw-rw---- 1 mysql mysql 2048 Jan  6 19:04 graph.MYI
-rw-rw---- 1 mysql mysql 8804 Nov  7  2016 input.frm
-rw-rw---- 1 mysql mysql  524 Apr  3  2017 input.MYD
-rw-rw---- 1 mysql mysql 2048 Apr 30  2017 input.MYI
-rw-rw---- 1 mysql mysql 8658 Nov  7  2016 multigraph.frm
-rw-rw---- 1 mysql mysql    0 Nov  7  2016 multigraph.MYD
-rw-rw---- 1 mysql mysql 1024 Nov  7  2016 multigraph.MYI
-rw-rw---- 1 mysql mysql 8594 Jan  6 19:04 postprocess.frm
-rw-rw---- 1 mysql mysql 1352 Apr 19  2017 postprocess.MYD
-rw-rw---- 1 mysql mysql 2048 Apr 30  2017 postprocess.MYI
-rw-rw---- 1 mysql mysql 8630 Nov  7  2016 rememberme.frm
-rw-rw---- 1 mysql mysql  360 Jan  6 18:48 rememberme.MYD
-rw-rw---- 1 mysql mysql 1024 Jan  6 19:05 rememberme.MYI
-rw-rw---- 1 mysql mysql 8734 Nov  7  2016 schedule.frm
-rw-rw---- 1 mysql mysql   40 Jan  6 18:54 schedule.MYD
-rw-rw---- 1 mysql mysql 2048 Jan  6 19:05 schedule.MYI
-rw-rw---- 1 mysql mysql 8592 Jan  6 19:04 setup.frm
-rw-rw---- 1 mysql mysql    0 Jan  6 19:04 setup.MYD
-rw-rw---- 1 mysql mysql 8682 Jan  6 19:04 #sql-63c_3da.frm
-rw-rw---- 1 mysql mysql 8722 Jan  6 19:04 sync.frm
-rw-rw---- 1 mysql mysql    0 Jan  6 19:04 sync.MYD
-rw-rw---- 1 mysql mysql 1024 Jan  6 19:04 sync.MYI
-rw-rw---- 1 mysql mysql 9338 Jan  6 19:04 users.frm
[email protected](ro):~$ sudo ls -l /home/pi/data/mysql
total 28795
-rw-r--r-- 1 root  root         0 Jan 26  2016 debian-5.5.flag
drwx------ 2 mysql mysql     3072 Jan  6 19:04 emoncms
-rw-rw---- 1 mysql mysql 18874368 Jan  6 23:15 ibdata1
-rw-rw---- 1 mysql mysql  5242880 Jan 13 12:59 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 Jan 26  2016 ib_logfile1
drwx------ 2 mysql root      3072 Oct 30  2016 mysql
-rw------- 1 root  root         6 Oct 30  2016 mysql_upgrade_info
drwx------ 2 mysql mysql     1024 Oct 30  2016 performance_schema
[email protected](ro):~$

(Paul) #44

Not quite. All the files in @Greebo’s example are in groups of 3, each db table has 3 files (.frm, .MYD and .MYI). Only some of yours do, specifically, the device, dashboard and apparently the feeds table too are incomplete.