Cannot delete inputs. Where are they stored?

Hi

Running a local pi server version 8.4.0. This has been running for months without trouble. About a week ago I looked at inputs and noticed that I had some inactive inputs from an emontx that I had disconnected some time ago. I tried to delete the inputs and they did indeed disappear only to spring back after about a minute. I did not think any more about it as it did not appear to effect performance. I also noticed I had a few separate input entries for rt_fail which I did delete. 

Yesterday I noticed nothing was updating on my dashboards so I looked at inputs again. The first thing I noticed was that it took minutes to access the server and further minutes to access the input page. Every thing was very unresponsive. When I finally got the input page up I found a huge number of rt_fail entries. I shut off my 2 nanodeRF base stations and started to try and delete the rt_fail entries but the system in so slow it would take hours to delete them. I can ssh into the PI.  Can I access the database holding the inputs and delete them there?

I don't know if they are the cause of the problem but clearly something is not right and deleting all the inactive inputs seems the best place to start.

I have all the data backed up and it has also occurred to me that a fresh start with a clean emoncms might the quickest way to get running again. What would be the best way to achieve this?

Regards

Ian

pb66's picture

Re: Cannot delete inputs. Where are they stored?

Hi Ian,

Is it definitely rt_fail? or could it be rf_fail? There are quite a few discussions about rf_fail on the forum, (coincidentally they seem to predominantly be when using a NanodeRF).

How is the file system for space on the Pi? a common cause for running excruciatingly slow is when the disk is full, what "percentage full" do you see with df -h?

Usually when a input reappears after deletion it is because of redis try running sudo redis-cli FLUSHALL after deleting,

Paul

Edit - There is also an api function to remove unused inputs but I haven't tried it myself see http://openenergymonitor.org/emon/node/6315#comment-26070

Ian Eagland's picture

Re: Cannot delete inputs. Where are they stored?

Hi Paul

Many thanks as ever for your response. Your dead right, I misread the name, it is rf_fail, That's why I could not find any references on the forum!

I am on a hard drive so I don't think space is a problem.

pi@EmoncmsMaster ~ $ df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          172G  7.7G  156G   5% /
/dev/root       172G  7.7G  156G   5% /
devtmpfs        239M     0  239M   0% /dev
tmpfs            49M  1.3M   48M   3% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            97M     0   97M   0% /run/shm
/dev/mmcblk0p1   59M  9.7M   50M  17% /boot
pi@EmoncmsMaster ~ $

sudo redis-cli FLUSHALL had an interesting effect. It removed most of the inactive input entries I had deleted some weeks ago that kept reappearing. Unfortunately there are a great many rf_fail entries and it takes minutes for the web page to update (I even get chrome timeouts) so it will take hours to delete them individually unless the server starts to respond more quickly. Something is slowing it down. I just remembered a short while ago I installed Apache_log4php

​Would looking at that give any clues? Or could the log be causing the problem. I only installed it because the server admin reported it not installed so I thought it might be useful at some time.

Regards

Ian

 

 

pb66's picture

Re: Cannot delete inputs. Where are they stored?

You seem to have plenty space (only using 5%) sometimes if you don't use resize2fs you can't use the hdd space outside the partition, but thats not the case here.

What about if you were to stop the server (apache service) and use mySQL to cleanse the inputs and use redis-cli FLUSHALL before restarting? or maybe use phpmyadmin or does that run slow too?

I'm not really sure about log4php but it's definitely worth looking in any logfiles you can eg apache. does the Pi run slow using commands over ssh or is it just via the web based server?

Paul

Ian Eagland's picture

Re: Cannot delete inputs. Where are they stored?

Hi Paul

The Pi runs slow via the web based server so phpmyadmin is very slow but it does appear to stack delete commands so I have initiated a batch and will leave it an hour or so to see what happens. Over ssh I don't think it is any slower than it was before this trouble started. I will probably have to stop the server and learn the mysql delete command to clear the unwanted inputs.

I am beginning to wonder if the multiple rf_fail inputs are a result of the problem rather than the cause. I reinstated one of the NanodeRF base stations last night and the inputs are updating. However these are now appearing as multiple inputs. Screenshot attached.

Interestingly I have no new rf_fail inputs only the large number of inactive ones.

Edit

One thing that has changed recently is that I am running a new Pi with RFM12pi and emonhub posting to emoncms.org. It is the same frequency but a different networking group. Could this cause intereference?

 

Ian

pb66's picture

Re: Cannot delete inputs. Where are they stored?

Interesting, I have seen this on emoncms.org but not a local install. See http://openenergymonitor.org/emon/node/6185

I would of thought you are experiencing a server side issue as if the issue was interference from another network or any other unwanted source of data it would only create a new unique node/input if there wasn't a pre-existing node/input for it to post to, the fact that the input numbers are duplicated suggests a server issue.

Whereabouts are you seeing the rf_fail errors reported?

Paul

Ian Eagland's picture

Re: Cannot delete inputs. Where are they stored?

Hi Paul

The rf_fail errors all show in the inputs page on the server.

I am beginning to think it would be quicker to do a rebuild from scratch. I am 99% certain it is a server problem. I have checked the 2 NanodeRFs and they both seem to be working correctly. I have all my historic data on a backup PC. There would only be a benefit to continue looking for the cause if others had reported the problem but that does not seem to be the case.

EDIT

I just found out how to display the inputs in mysql with this result-

| 8190 |      1 | rf_fail |             |        | NULL                         | NULL |  NULL |      0 |
+------+--------+---------+-------------+--------+------------------------------+------+-------+--------+
7927 rows in set (0.02 sec)

 

 

Ian

 

pb66's picture

Re: Cannot delete inputs. Where are they stored?

Wow! 8000 inputs, I can see how some of them might be surplus to requirement :-)

Personally, I'm a big fan of rebuilding, although that's probably as I usually end up trying so many things determined to get to the root of the issue, I feel it's safer to rebuild a fresh install using what I've learnt rather than continue with a fixed but heavily "played with" install. In this instance since the throttled speed is preventing any progress, I think I would of run out of patience and rebuilt already.

Paul

Ian Eagland's picture

Re: Cannot delete inputs. Where are they stored?

Hi Paul

Just to complete this thread I have started a full install to an external hard disk from scratch. Every thing seems to have gone OK. I had no error messages on install. I had a little trouble finding the apache config file but got over it.

Now I can't register as in this thread:-

http://openenergymonitor.org/emon/node/3440

Ian

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.