Feeds are missing after reboot

You pasted a section of your emoncms log a few days ago, was that the complete log after a reboot? Or just the section available from the admin web page “Logger” interface?

If it was from the admin web page, can you upload a copy of /var/log/emoncms.log straight after a reboot to this thread. Maybe there’s something in there that will help us.

It still feels like a problem with mariaDB (mySQL) database access to me…

Have you moved any files around since you started using EmonCMS?

No files changed after installation. Just added feeds. Fact is that Feeds 1 - 13 are always coming back after reboot and thinking about it, I may have created those before I installed the low-write following emoncms/Low-write-mode.md at master · emoncms/emoncms · GitHub

It is also worth mentioning that dashboard that have created during the last few weeks are still there after reboot. I just created another one and still there after reboot.

pi@raspberrypi:~ $ more /var/log/emoncms.log
2018-08-13 07:18:07.128|INFO|index.php|input/post.json
2018-08-13 07:18:07.316|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534144687 feedtime=1534144687 value=221.45 arg=
2018-08-13 07:18:07.321|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:18:07.322|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534144687 feedtime=1534144687 value=109.67 arg=
2018-08-13 07:18:07.322|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534144687 feedtime=1534144687 value=1.1 arg=
2018-08-13 07:18:07.323|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534144687 feedtime=1534144687 value=0 arg=
2018-08-13 07:18:07.324|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534144687 feedtime=1534144687 value=45.38 arg=
2018-08-13 07:18:07.324|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534144687 feedtime=1534144687 value=0 arg=
2018-08-13 07:18:07.325|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534144687 feedtime=1534144687 value=63.77 arg=
2018-08-13 07:18:07.326|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534144687 feedtime=1534144687 value=0 arg=
2018-08-13 07:18:07.326|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534144687 feedtime=1534144687 value=-0.58 arg=
2018-08-13 07:18:07.327|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534144687 feedtime=1534144687 value=0 arg=
2018-08-13 07:18:07.327|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534144687 feedtime=1534144687 value=419363.59 arg=
2018-08-13 07:18:07.328|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144687 feedtime=1534144687 value=301 arg=
2018-08-13 07:18:07.329|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144687 feedtime=1534144687 value=301 arg=join
2018-08-13 07:18:07.330|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534144687 feedtime=1534144687 value=3.7103497 arg=
2018-08-13 07:18:09.855|INFO|feedwriter.php|Starting feedwriter script
2018-08-13 07:18:09.883|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:18:09.886|INFO|RedisBuffer.php|process_buffer() engine=5 feed=1 len=1
2018-08-13 07:18:09.896|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'PHPFina'.
2018-08-13 07:18:09.897|INFO|PHPFina.php|post_bulk_prepare() feedid=1 timestamp=1534144687 value=1.1
2018-08-13 07:18:09.898|INFO|PHPFina.php|post_bulk_prepare() pos=264089 last_pos=264150 timestampinterval=1534144680
2018-08-13 07:18:09.899|INFO|RedisBuffer.php|process_buffer() engine=5 feed=2 len=1
2018-08-13 07:18:09.899|INFO|PHPFina.php|post_bulk_prepare() feedid=2 timestamp=1534144687 value=0
2018-08-13 07:18:09.900|INFO|PHPFina.php|post_bulk_prepare() pos=264086 last_pos=264147 timestampinterval=1534144680
2018-08-13 07:18:09.901|INFO|RedisBuffer.php|process_buffer() engine=5 feed=3 len=1
2018-08-13 07:18:09.902|INFO|PHPFina.php|post_bulk_prepare() feedid=3 timestamp=1534144687 value=45.38
2018-08-13 07:18:09.903|INFO|PHPFina.php|post_bulk_prepare() pos=264080 last_pos=264141 timestampinterval=1534144680
2018-08-13 07:18:09.904|INFO|RedisBuffer.php|process_buffer() engine=5 feed=4 len=1
2018-08-13 07:18:09.904|INFO|PHPFina.php|post_bulk_prepare() feedid=4 timestamp=1534144687 value=0
2018-08-13 07:18:09.905|INFO|PHPFina.php|post_bulk_prepare() pos=264079 last_pos=264140 timestampinterval=1534144680
2018-08-13 07:18:09.906|INFO|RedisBuffer.php|process_buffer() engine=5 feed=5 len=1
2018-08-13 07:18:09.906|INFO|PHPFina.php|post_bulk_prepare() feedid=5 timestamp=1534144687 value=419363.59
2018-08-13 07:18:09.907|INFO|PHPFina.php|post_bulk_prepare() pos=264077 last_pos=264138 timestampinterval=1534144680
2018-08-13 07:18:09.908|INFO|RedisBuffer.php|process_buffer() engine=5 feed=6 len=2
2018-08-13 07:18:09.908|INFO|PHPFina.php|post_bulk_prepare() feedid=6 timestamp=1534144687 value=301
2018-08-13 07:18:09.909|INFO|PHPFina.php|post_bulk_prepare() pos=264075 last_pos=264136 timestampinterval=1534144680
2018-08-13 07:18:09.910|INFO|PHPFina.php|post() id=6 timestamp=1534144687 value=301 padding=
2018-08-13 07:18:09.912|INFO|RedisBuffer.php|process_buffer() engine=5 feed=7 len=1
2018-08-13 07:18:09.912|INFO|PHPFina.php|post_bulk_prepare() feedid=7 timestamp=1534144687 value=63.77
2018-08-13 07:18:09.914|INFO|PHPFina.php|post_bulk_prepare() pos=263110 last_pos=263171 timestampinterval=1534144680
2018-08-13 07:18:09.915|INFO|RedisBuffer.php|process_buffer() engine=5 feed=8 len=1
2018-08-13 07:18:09.915|INFO|PHPFina.php|post_bulk_prepare() feedid=8 timestamp=1534144687 value=0
2018-08-13 07:18:09.916|INFO|PHPFina.php|post_bulk_prepare() pos=263109 last_pos=263170 timestampinterval=1534144680
2018-08-13 07:18:09.917|INFO|RedisBuffer.php|process_buffer() engine=5 feed=9 len=1
2018-08-13 07:18:09.917|INFO|PHPFina.php|post_bulk_prepare() feedid=9 timestamp=1534144687 value=-0.58
2018-08-13 07:18:09.918|INFO|PHPFina.php|post_bulk_prepare() pos=263108 last_pos=263169 timestampinterval=1534144680
2018-08-13 07:18:09.919|INFO|RedisBuffer.php|process_buffer() engine=5 feed=10 len=1
2018-08-13 07:18:09.919|INFO|PHPFina.php|post_bulk_prepare() feedid=10 timestamp=1534144687 value=0
2018-08-13 07:18:09.921|INFO|PHPFina.php|post_bulk_prepare() pos=263107 last_pos=263168 timestampinterval=1534144680
2018-08-13 07:18:09.921|INFO|RedisBuffer.php|process_buffer() engine=5 feed=11 len=1
2018-08-13 07:18:09.922|INFO|PHPFina.php|post_bulk_prepare() feedid=11 timestamp=1534144687 value=3.7103497
2018-08-13 07:18:09.923|INFO|PHPFina.php|post_bulk_prepare() pos=263090 last_pos=263151 timestampinterval=1534144680
2018-08-13 07:18:09.924|INFO|RedisBuffer.php|process_buffer() engine=5 feed=12 len=1
2018-08-13 07:18:09.924|INFO|PHPFina.php|post_bulk_prepare() feedid=12 timestamp=1534144687 value=221.45
2018-08-13 07:18:09.925|INFO|PHPFina.php|post_bulk_prepare() pos=263088 last_pos=263149 timestampinterval=1534144680
2018-08-13 07:18:09.926|INFO|RedisBuffer.php|process_buffer() engine=5 feed=13 len=1
2018-08-13 07:18:09.926|INFO|PHPFina.php|post_bulk_prepare() feedid=13 timestamp=1534144687 value=109.67
2018-08-13 07:18:09.927|INFO|PHPFina.php|post_bulk_prepare() pos=263087 last_pos=263148 timestampinterval=1534144680
2018-08-13 07:18:17.103|INFO|index.php|input/post.json
2018-08-13 07:18:17.145|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534144697 feedtime=1534144697 value=223.23 arg=
2018-08-13 07:18:17.147|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:18:17.148|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534144697 feedtime=1534144697 value=110.56 arg=
2018-08-13 07:18:17.149|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534144697 feedtime=1534144697 value=0.96 arg=
2018-08-13 07:18:17.151|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534144697 feedtime=1534144697 value=0 arg=
2018-08-13 07:18:17.152|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534144697 feedtime=1534144697 value=45.32 arg=
2018-08-13 07:18:17.153|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534144697 feedtime=1534144697 value=0 arg=
2018-08-13 07:18:17.155|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534144697 feedtime=1534144697 value=64.29 arg=
2018-08-13 07:18:17.156|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534144697 feedtime=1534144697 value=0 arg=
2018-08-13 07:18:17.157|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534144697 feedtime=1534144697 value=0 arg=
2018-08-13 07:18:17.159|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534144697 feedtime=1534144697 value=0 arg=
2018-08-13 07:18:17.160|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534144697 feedtime=1534144697 value=419363.59 arg=
2018-08-13 07:18:17.161|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144697 feedtime=1534144697 value=301 arg=
2018-08-13 07:18:17.163|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144697 feedtime=1534144697 value=301 arg=join
2018-08-13 07:18:17.165|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534144697 feedtime=1534144697 value=3.7131267 arg=
2018-08-13 07:18:27.104|INFO|index.php|input/post.json
2018-08-13 07:18:27.147|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534144707 feedtime=1534144707 value=221.37 arg=
2018-08-13 07:18:27.149|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:18:27.150|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534144707 feedtime=1534144707 value=111.01 arg=
2018-08-13 07:18:27.151|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534144707 feedtime=1534144707 value=1.06 arg=
2018-08-13 07:18:27.153|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534144707 feedtime=1534144707 value=0 arg=
2018-08-13 07:18:27.154|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534144707 feedtime=1534144707 value=45.71 arg=
2018-08-13 07:18:27.156|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534144707 feedtime=1534144707 value=0 arg=
2018-08-13 07:18:27.157|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534144707 feedtime=1534144707 value=64.24 arg=
2018-08-13 07:18:27.158|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534144707 feedtime=1534144707 value=0 arg=
2018-08-13 07:18:27.160|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534144707 feedtime=1534144707 value=0 arg=
2018-08-13 07:18:27.161|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534144707 feedtime=1534144707 value=0 arg=
2018-08-13 07:18:27.163|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534144707 feedtime=1534144707 value=419363.59 arg=
2018-08-13 07:18:27.164|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144707 feedtime=1534144707 value=301 arg=
2018-08-13 07:18:27.166|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534144707 feedtime=1534144707 value=301 arg=join
2018-08-13 07:18:27.167|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534144707 feedtime=1534144707 value=3.7159037 arg=
2018-08-13 07:43:13.658|INFO|index.php|input/post.json
2018-08-13 07:43:13.702|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146193 feedtime=1534146193 value=221.27 arg=
2018-08-13 07:43:13.703|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:43:13.704|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146193 feedtime=1534146193 value=111.83 arg=
2018-08-13 07:43:13.706|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146193 feedtime=1534146193 value=0.83 arg=
2018-08-13 07:43:13.707|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146193 feedtime=1534146193 value=0 arg=
2018-08-13 07:43:13.709|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146193 feedtime=1534146193 value=44.69 arg=
2018-08-13 07:43:13.710|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146193 feedtime=1534146193 value=0 arg=
2018-08-13 07:43:13.711|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146193 feedtime=1534146193 value=66.31 arg=
2018-08-13 07:43:13.713|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146193 feedtime=1534146193 value=0 arg=
2018-08-13 07:43:13.714|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146193 feedtime=1534146193 value=0 arg=
2018-08-13 07:43:13.716|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146193 feedtime=1534146193 value=0 arg=
2018-08-13 07:43:13.717|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146193 feedtime=1534146193 value=419363.59 arg=
2018-08-13 07:43:13.719|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146193 feedtime=1534146193 value=301 arg=
2018-08-13 07:43:13.721|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146193 feedtime=1534146193 value=301 arg=join
2018-08-13 07:43:13.722|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146193 feedtime=1534146193 value=3.7186807 arg=
2018-08-13 07:43:23.699|INFO|index.php|input/post.json
2018-08-13 07:43:23.740|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146203 feedtime=1534146203 value=221.43 arg=
2018-08-13 07:43:23.741|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:43:23.743|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146203 feedtime=1534146203 value=122.63 arg=
2018-08-13 07:43:23.744|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146203 feedtime=1534146203 value=0.83 arg=
2018-08-13 07:43:23.745|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146203 feedtime=1534146203 value=0 arg=
2018-08-13 07:43:23.747|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146203 feedtime=1534146203 value=55.77 arg=
2018-08-13 07:43:23.748|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146203 feedtime=1534146203 value=0 arg=
2018-08-13 07:43:23.750|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146203 feedtime=1534146203 value=66.02 arg=
2018-08-13 07:43:23.751|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146203 feedtime=1534146203 value=0 arg=
2018-08-13 07:43:23.752|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146203 feedtime=1534146203 value=0 arg=
2018-08-13 07:43:23.754|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146203 feedtime=1534146203 value=0 arg=
2018-08-13 07:43:23.755|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146203 feedtime=1534146203 value=419363.59 arg=
2018-08-13 07:43:23.756|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146203 feedtime=1534146203 value=301 arg=
2018-08-13 07:43:23.758|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146203 feedtime=1534146203 value=301 arg=join
2018-08-13 07:43:23.759|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146203 feedtime=1534146203 value=3.7214577 arg=
2018-08-13 07:43:33.713|INFO|index.php|input/post.json
2018-08-13 07:43:33.756|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146213 feedtime=1534146213 value=220.84 arg=
2018-08-13 07:43:33.757|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:43:33.758|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146213 feedtime=1534146213 value=110.77 arg=
2018-08-13 07:43:33.760|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146213 feedtime=1534146213 value=0.84 arg=
2018-08-13 07:43:33.761|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146213 feedtime=1534146213 value=0 arg=
2018-08-13 07:43:33.763|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146213 feedtime=1534146213 value=46.44 arg=
2018-08-13 07:43:33.764|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146213 feedtime=1534146213 value=0 arg=
2018-08-13 07:43:33.765|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146213 feedtime=1534146213 value=64.13 arg=
2018-08-13 07:43:33.767|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146213 feedtime=1534146213 value=0 arg=
2018-08-13 07:43:33.768|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146213 feedtime=1534146213 value=-0.64 arg=
2018-08-13 07:43:33.770|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146213 feedtime=1534146213 value=0 arg=
2018-08-13 07:43:33.771|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146213 feedtime=1534146213 value=419363.59 arg=
2018-08-13 07:43:33.773|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146213 feedtime=1534146213 value=301 arg=
2018-08-13 07:43:33.775|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146213 feedtime=1534146213 value=301 arg=join
2018-08-13 07:43:33.776|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146213 feedtime=1534146213 value=3.7242347 arg=
2018-08-13 07:43:43.738|INFO|index.php|input/post.json
2018-08-13 07:43:43.757|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146223 feedtime=1534146223 value=223.42 arg=
2018-08-13 07:43:43.758|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:43:43.760|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146223 feedtime=1534146223 value=111.12 arg=
2018-08-13 07:43:43.761|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146223 feedtime=1534146223 value=0.72 arg=
2018-08-13 07:43:43.763|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146223 feedtime=1534146223 value=0 arg=
2018-08-13 07:43:43.764|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146223 feedtime=1534146223 value=43.87 arg=
2018-08-13 07:43:43.765|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146223 feedtime=1534146223 value=0 arg=
2018-08-13 07:43:43.767|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146223 feedtime=1534146223 value=66.53 arg=
2018-08-13 07:43:43.768|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146223 feedtime=1534146223 value=0 arg=
2018-08-13 07:43:43.769|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146223 feedtime=1534146223 value=0 arg=
2018-08-13 07:43:43.771|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146223 feedtime=1534146223 value=0 arg=
2018-08-13 07:43:43.772|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146223 feedtime=1534146223 value=419363.59 arg=
2018-08-13 07:43:43.774|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146223 feedtime=1534146223 value=301 arg=
2018-08-13 07:43:43.775|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146223 feedtime=1534146223 value=301 arg=join
2018-08-13 07:43:43.776|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146223 feedtime=1534146223 value=3.7270117 arg=
2018-08-13 07:43:53.737|INFO|index.php|input/post.json
2018-08-13 07:43:53.756|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146233 feedtime=1534146233 value=221.52 arg=
2018-08-13 07:43:53.757|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:43:53.758|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146233 feedtime=1534146233 value=105.88 arg=
2018-08-13 07:43:53.759|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146233 feedtime=1534146233 value=0.92 arg=
2018-08-13 07:43:53.761|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146233 feedtime=1534146233 value=0 arg=
2018-08-13 07:43:53.762|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146233 feedtime=1534146233 value=41.11 arg=
2018-08-13 07:43:53.763|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146233 feedtime=1534146233 value=0 arg=
2018-08-13 07:43:53.765|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146233 feedtime=1534146233 value=63.85 arg=
2018-08-13 07:43:53.766|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146233 feedtime=1534146233 value=0 arg=
2018-08-13 07:43:53.767|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146233 feedtime=1534146233 value=0 arg=
2018-08-13 07:43:53.769|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146233 feedtime=1534146233 value=0 arg=
2018-08-13 07:43:53.770|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146233 feedtime=1534146233 value=419363.59 arg=
2018-08-13 07:43:53.771|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146233 feedtime=1534146233 value=301 arg=
2018-08-13 07:43:53.773|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146233 feedtime=1534146233 value=301 arg=join
2018-08-13 07:43:53.774|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146233 feedtime=1534146233 value=3.7297887 arg=
2018-08-13 07:44:03.744|INFO|index.php|input/post.json
2018-08-13 07:44:03.763|INFO|feed_model.php|insert_data() feedid=12 updatetime=1534146243 feedtime=1534146243 value=220.89 arg=
2018-08-13 07:44:03.764|INFO|feed_model.php|EngineClass() Autoloaded new instance of 'RedisBuffer'.
2018-08-13 07:44:03.765|INFO|feed_model.php|insert_data() feedid=13 updatetime=1534146243 feedtime=1534146243 value=107.53 arg=
2018-08-13 07:44:03.767|INFO|feed_model.php|insert_data() feedid=1 updatetime=1534146243 feedtime=1534146243 value=1.12 arg=
2018-08-13 07:44:03.768|INFO|feed_model.php|insert_data() feedid=2 updatetime=1534146243 feedtime=1534146243 value=0 arg=
2018-08-13 07:44:03.770|INFO|feed_model.php|insert_data() feedid=3 updatetime=1534146243 feedtime=1534146243 value=42.41 arg=
2018-08-13 07:44:03.771|INFO|feed_model.php|insert_data() feedid=4 updatetime=1534146243 feedtime=1534146243 value=0 arg=
2018-08-13 07:44:03.773|INFO|feed_model.php|insert_data() feedid=7 updatetime=1534146243 feedtime=1534146243 value=64 arg=
2018-08-13 07:44:03.774|INFO|feed_model.php|insert_data() feedid=8 updatetime=1534146243 feedtime=1534146243 value=0 arg=
2018-08-13 07:44:03.775|INFO|feed_model.php|insert_data() feedid=9 updatetime=1534146243 feedtime=1534146243 value=0 arg=
2018-08-13 07:44:03.777|INFO|feed_model.php|insert_data() feedid=10 updatetime=1534146243 feedtime=1534146243 value=0 arg=
2018-08-13 07:44:03.778|INFO|feed_model.php|insert_data() feedid=5 updatetime=1534146243 feedtime=1534146243 value=419363.59 arg=
2018-08-13 07:44:03.780|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146243 feedtime=1534146243 value=301 arg=
2018-08-13 07:44:03.782|INFO|feed_model.php|insert_data() feedid=6 updatetime=1534146243 feedtime=1534146243 value=301 arg=join
2018-08-13 07:44:03.783|INFO|feed_model.php|insert_data() feedid=11 updatetime=1534146243 feedtime=1534146243 value=3.7325657 arg=
2018-08-13 07:44:13.765|INFO|index.php|input/post.json
201

Have you tried an update-database?

Yes tried to update the database under Settup/Administration several times but always comes with Database is up to date - Nothing to do

If that is actually the case, maybe its worth starting from the end of that guide and undoing things one by one until it stops being broken, starting with:

That will at least provide a better idea of where the problem is.

BINGO. Just set both values to false and I got my feeds and inputs back, i.e. all that is in the database. And all stays after reboot. Attached is log file… emoncms.log.txt (26.4 KB)

Great! So Redis is causing the problem… I don’t know what impact there would be of re-enabling Redis but leaving low-write mode disabled? May be worth a shot.

So only do the first step:

  • Redis , change $redis_enabled from false to true

Then see what happens when you make changes to feeds and reboot.

Let me suggest that after enabling redis, if the problem persist, try to do a flush from the administration page.

Setting `$redis_enabled = true and Low-write mode works now. After reboot inputs and feeds disappear, HOWEVER after Redis FLUSH all is back.

I can live with that, but should flush not be part of the boot?

That $redis_enabled flag is supposed to be set one time at installation and never go back.
Redis besides being a cache, some processes also depend on it.
What happened there is that the cache got desynchronized from the database.
In normal circumstances it should never happen.
But if you can easy reproduce it without changing the config file, let us know the steps.
Flushing redis is basically saying to start caching everything again, not an efficient thing to do at startup on large loaded server.

I can reproduce: $redis_enabled = true and Low-write mode enabled is true now. When I reboot I just got the input list and 13 feeds that I always and which where created ever before I activated low write by following emoncms/Low-write-mode.md at master · emoncms/emoncms · GitHub
After I flush, I get the correct inputs and feeds, i.e. according to my changes before the boot.
My server is a Raspberry Pi3 B+ and is not that loaded. :grinning:

It isn’t normally a requirement to flush Redis at every boot, it sounds like you have some persisted files from your previous configuration. Are you showing any Redis data files?

ls -la /var/lib/redis

I noticed a typo in the guide you followed that might just cause a similar sort of issue if not picked up.

After altering the redis.conf file to no longer save it’s files to disk it says to sudo service redis-server reboot to pick up those new changes (ie stop persisting to disk) and then to delete the already existing persisted files with rm -rf /var/lib/redis/*.

2 potential issues, it should be sudo service redis-server restart not reboot, so Redis is not being restarted and therefore potentially still saving to disk until the next reboot (unless settings are picked up in runtime) and only an elevated (root) user will successfully delete the existing files, it should therefore be sudo rm -rf /var/lib/redis/*.

If there is a dump.rdb file lingering around and not being overwritten due to the new redis.conf settings, that would reset you to the same state at each reboot when it gets loaded, until you flush or temporarily overwrite the RAM copy with new data/settings.

I have to point out this is entirely theoretical based on your findings and what might result from those 2 typo’s, if you already spotted them and made changes then I guess it rules out this theory.

Something else to try might be to add/change the redis prefix in the redis section of the settings.php file, effectively that should give you a totally clean slate as far as Redis is concerned.

I have done a PR for the typo’s

1 Like

Hi Paul.

There was a dump.rdb with date of installation.
I could not delete that file, not even with sudo:

pi@raspberrypi:~ $ sudo ls -la /var/lib/redis
total 16
drwxr-x---  2 redis redis 4096 Jul 14 07:50 .
drwxr-xr-x 52 root  root  4096 Jul 13 13:00 ..
-rw-rw----  1 redis redis 6129 Jul 14 07:50 dump.rdb
pi@raspberrypi:~ $ sudo rm -rf /var/lib/redis/*
pi@raspberrypi:~ $ sudo ls -la /var/lib/redis
total 16
drwxr-x---  2 redis redis 4096 Jul 14 07:50 .
drwxr-xr-x 52 root  root  4096 Jul 13 13:00 ..
-rw-rw----  1 redis redis 6129 Jul 14 07:50 dump.rdb
pi@raspberrypi:~ $

So I became root with sudo su and then I could delete
After reboot, I got al my feeds immediately.
So I think problem SOLVED

2 Likes

Good to hear :slight_smile:

Sounds like we need to amend the amendments to use sudo su

sudo su -c 'rm -rf /var/lib/redis/*'

might do it, I’m unable to test, can you (or anyone) confirm that would work ok?

1 Like

Here’s one way to do it…

Since it’s actually two separate commands,

sudo su && rm -rf /var/lib/redis/*

would execute the sudo command, then execute the remove command.
The double ampersands ensure the remove command doesn’t run unless
the sudo command runs sucessfully.

Thanks Bill but I don’t think that will work, it’s not actually 2 separate commands, it’s one command to open an elevated shell and then the second command needs to be run within that shell (command) rather than after it is successfully completed in full, ie exited back to user pi.

See below using the whoami command, the latter part of the command isn’t run until you exit the root shell.

pi@raspberrypi:~ $ sudo su && whoami
root@raspberrypi:/home/pi# exit
exit
pi
pi@raspberrypi:~ $ sudo su -c 'whoami'
root
pi@raspberrypi:~ $

[edit] I’ve done another PR as @TrystanLea has already merged the last change

Just to say, I had the same issue as the original poster having installed Emoncms on an Orange Pi one running Armbian. got it working, then adding low-write as an afterthought and subsequently adding further feeds. For my build Apache is also running a few other systems and Emoncms is therefore installed in a non-standard location.

So, same issue, completely different build/hardware. As the OP reported, after a re-start a ‘flush redis’ command from the GUI (or from the cli) restored the missing feeds, but the problem reoccurred on reboot.

I followed the advice elsewhere on the community forum to remove ‘/var/lib/redis/dump.rdb’ and this seemed to cure the problem.

I was just reading some interesting posts elsewhere about why sudo rm -rf /var/lib/redis/* wouldn’t work and it has to do with when * is expanded.

I just reproduced it myself on my emonBase Pi:

pi@emonpi(rw):~$ sudo ls -la test
total 12
drwxr-x---  2 root root 4096 Aug 16 11:02 .
drwxr-xr-x 20 pi   pi   4096 Aug 16 11:02 ..
-rw-rw----  1 root root    1 Aug 16 11:02 testfile

Notice how only root has read access to that directory.
Now lets try and remove *:

pi@emonpi(rw):~$ sudo rm -rf test/*
pi@emonpi(rw):~$ sudo ls -la test
total 12
drwxr-x---  2 root root 4096 Aug 16 11:02 .
drwxr-xr-x 20 pi   pi   4096 Aug 16 11:02 ..
-rw-rw----  1 root root    1 Aug 16 11:02 testfile

This is why: test/* expansion is attempted as the non-root user and the results passed to sudo. You can see what that will be by doing this:

pi@emonpi(rw):~$ ls -la test/*
ls: cannot access test/*: Permission denied

so what sudo actually gets is the equivalent of rm -rf test/\*, which is going to try and remove a file literally called *, not the wildcard you were expecting!

So if the actual file that needs to be removed is just dump.rdb, the command needs to be:

sudo rm -rf /var/lib/redis/dump.rdb

If you really do need to remove all files in there you have to use @pb66’s method, or this (essentially the same):

pi@emonpi(rw):~$ sudo bash -c 'rm -rf test/*'
pi@emonpi(rw):~$ sudo ls -la test
total 8
drwxr-x---  2 root root 4096 Aug 16 11:13 .
drwxr-xr-x 20 pi   pi   4096 Aug 16 11:02 ..
3 Likes

i think the dump.rdb file can get rotated and there can also be temp files. I quick search turned up this post (Is it safe to delete redis dump and temp files from /var/lib/redis/ - Server Fault) which has a multitude of files with numeric ids so a wildcard would be needed.

@glyn.hudson has merged my suggestion already, hopefully that will work.

The unfortunate thing about disabling the redis save and the dump file for the low-write configuration is that the values held in Redis are lost on a reboot, so the first value for some key processes eg whaccumulator are always lost following a reboot. Since there is no previous value in the redis tables, the first value is used to populate the redis table and only the second value gets processed.

IMO it would make more sense to move the file location to the writable data partition and continue to use redis as usual, the save interval is so low (much, much lower than the buffered-write) it would not damage the SD card, and more important than regular (infrequent) saves, it would save the current values on a controlled shutdown/reboot so that counting could continue from were it left off rather than dropping the first values.

1 Like

That gets my vote. Is it as simple as a symlink of /var/lib/redis to somewhere writable?