# No Inputs and /var/log full within 1h of boot

**URL:** <https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198>\
**Category:** emonPi\
**Tags:** emonhub\
**Created:** [25 September 2017 10:47 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198 "2017-09-25T10:47:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [25 September 2017 10:47 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/1 "2017-09-25T10:47:17Z")

</div>

If I got to `/emoncms/input/view` I just get a loading icon in front of a blank page.  
Feeds haven’t updated in 20 hours.

I noticed logs were really out of date yesterday, and a `df -h` showed why, `/var/logs/` is 100% full with `syslog` and `daemon.log` both taking up around 22MB.

If I do a `sudo reboot` the Pi doesn’t always reboot all that well, and I need to pull the power, wait a bit then plug it back in again. From the start `/var/log` sits at 10%, but within the hour it’s at 100%.

MQTT is running, and I’ve restarted `mqtt_input` but I notice when doing status it shows:

```auto
Sep 25 12:04:44 emonpi systemd[1]: Started Emoncms MQTT Input Script.
Sep 25 12:04:45 emonpi mqtt_input[14725]: PHP Fatal error: Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/input/input_model.php on line 377
Sep 25 12:04:45 emonpi mqtt_input[14725]: Fatal error: Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/input/input_model.php on line 377

```

I did run an emonPi and emonBase Update yesterday, when I go to update dabatase I get the following:  
`Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 41`

Along with the following updates, which never apply:

```auto
Database schema
ALTER TABLE `input` ADD `id` int(11) NOT NULL;
ALTER TABLE `input` ADD `userid` int(11) NOT NULL;
ALTER TABLE `input` ADD `name` text NOT NULL;
ALTER TABLE `input` ADD `description` text NOT NULL DEFAULT '';
ALTER TABLE `input` ADD `nodeid` text NOT NULL;
ALTER TABLE `input` ADD `processList` text NOT NULL;
ALTER TABLE `input` ADD `time` int(10) NOT NULL;
ALTER TABLE `input` ADD `value` float NOT NULL;

```

I did notice in the emonhub logs it had difficulty connecting to MQTT at first, then it was fine but after publishing values, RFM2PI talks of unreliable content:

```auto
2017-09-25 07:24:53,145 DEBUG MQTT Publishing: emon/emonth6/temperature 18.1
2017-09-25 07:24:53,147 DEBUG MQTT Publishing: emon/emonth6/external temperature 0
2017-09-25 07:24:53,148 DEBUG MQTT Publishing: emon/emonth6/humidity 77.3
2017-09-25 07:24:53,150 DEBUG MQTT Publishing: emon/emonth6/battery 2.4
2017-09-25 07:24:53,151 DEBUG MQTT Publishing: emon/emonth6/pulsecount 1
2017-09-25 07:24:53,152 INFO MQTT Publishing: emon/emonth6/rssi -65
2017-09-25 07:24:53,154 INFO MQTT Publishing: emonhub/rx/24/values 18.1,0,77.3,2.4,1
2017-09-25 07:24:53,156 INFO MQTT Publishing: emonhub/rx/24/rssi -65
2017-09-25 07:24:54,294 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 2 219 97 245 76 219 132 105 195 181 129 60 197 184 217 61 7 171 79 98 159 (-96)
2017-09-25 07:24:54,502 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 0 174 23 155 220 196 161 203 36 185 199 55 208 89 200 132 131 14 122 56 230 (-87)
2017-09-25 07:24:54,911 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 26 68 251 129 189 4 140 96 189 39 149 185 218 134 114 118 184 245 214 255 81 (-97)
2017-09-25 07:24:55,425 DEBUG RFM2Pi Discarding RX frame 'unreliable content'? 19 71 67 121 153 22 140 3 12 212 91 250 240 200 191 68 27 227 150 241 24 (-96)
2017-09-25 07:24:56,246 DEBUG RFM2Pi 11 NEW FRAME : OK 8 0 0 0 0 0 0 0 0 49 103 184 11 184 11 184 11 184 11 184 11 184 11 205 229 1 0 (-66)
2017-09-25 07:24:56,249 DEBUG RFM2Pi 11 Timestamp : 1506317096.25
2017-09-25 07:24:56,250 DEBUG RFM2Pi 11 From Node : 8
2017-09-25 07:24:56,253 DEBUG RFM2Pi 11 Values : [0, 0, 0, 0, 264.17, 300, 300, 300, 300, 300, 300, 124365]
2017-09-25 07:24:56,257 DEBUG RFM2Pi 11 RSSI : -66
2017-09-25 07:24:56,258 DEBUG RFM2Pi 11 Sent to channel(start)' : ToEmonCMS
2017-09-25 07:24:56,259 DEBUG RFM2Pi 11 Sent to channel(end)' : ToEmonCMS

```

I’m at a complete loss on how to move forward, or what the underlying issue(s) might be, any help would be gratefully appreciated!

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [25 September 2017 14:37 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/3 "2017-09-25T14:37:05Z")

</div>

> [@Bill.Thomson](#):
>
> Your log is filling up because the emonhub log level is set to DEBUG.

Actually Bill that ~~isn’t~~ _shouldn’t be_ possible since emonhub caps it’s own logfile size to 5Mb and rotates a max of 2 files so emonhub can only take up a maximum of 10Mb. (Or at least that’s how it should be working, there’s been a lot changed in the emonpi variant)

@waako - Can you try using

```
sudo du -h /var/log

```

to see what is hogging the diskspace?

---

<div class="post-metadata">

**Author:** ![Bill.Thomson](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/bill.thomson/32/1834_2.png) [@Bill.Thomson](https://community.openenergymonitor.org/u/Bill.Thomson)\
**Post date:** [25 September 2017 14:39 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/4 "2017-09-25T14:39:14Z")

</div>

OK, thanks for the heads-up. Post deleted.

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [25 September 2017 15:13 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/5 "2017-09-25T15:13:42Z")

</div>

Thanks Paul,  
I did notice that emonhub logs were 10Mb, it was `syslog` and `daemon.log` that appeared largest around 22Mb.

I didn’t know about `du -h` however, I’ve done a power cycle, so not full “yet”.  
Gives me:

```auto
4.0K	/var/log/supervisor
8.0K	/var/log/mosquitto
0	/var/log/logrotate
0	/var/log/openhab
4.0K	/var/log/mysql
156K	/var/log/apache2
8.0K	/var/log/redis
44K	/var/log/emonhub
4.0K	/var/log/emonpilcd
17M	/var/log

```

/var/log is now at 20M in the few minutes it’s taken me to write this.  
Doing `sudo du -h /var/log/*` gives me:

```auto
196K	/var/log/apache2
16K	/var/log/auth.log
28K	/var/log/boot.log
0	/var/log/btmp
9.8M	/var/log/daemon.log
4.0K	/var/log/dataplicity.log
4.0K	/var/log/emoncms.log
56K	/var/log/emonhub
4.0K	/var/log/emonpilcd
240K	/var/log/kern.log
0	/var/log/logrotate
240K	/var/log/messages
8.0K	/var/log/mosquitto
0	/var/log/mqtt_input.log
4.0K	/var/log/mysql
0	/var/log/mysql.log
0	/var/log/ntp_update.log
0	/var/log/openhab
8.0K	/var/log/redis
4.0K	/var/log/service-runner.log
4.0K	/var/log/supervisor
10M	/var/log/syslog
4.0K	/var/log/ufw.log
4.0K	/var/log/wtmp

```

emonHub has only been running 10-15 minutes at most.

Inputs view still empty with spinning loader

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [25 September 2017 15:15 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/6 "2017-09-25T15:15:07Z")

</div>

Thanks for pointing that out though Bill, have changed level anyway, can’t do any harm. WIll try to remember when I need to debug.

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [25 September 2017 15:19 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/7 "2017-09-25T15:19:47Z")

</div>

> [@waako](#):
>
> Inputs view still empty with spinning loader

You’re not the first to report this, but I’m afraid I’m not sure what the answer is. but now you know where the log entries are piling up, syslog and daemon.log, is there any clues when you check those log files?

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [25 September 2017 15:23 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/8 "2017-09-25T15:23:59Z")

</div>

Actually, something I hadn’t noticed earlier is the tail on both logs is all node-red.  
I’ve stopped node-red and that seems to have stopped them filling up so rapidly.

Trying to run node-red upgrade script, see if that helps, then best see what settings are for logs there if I can work it out.

Should probably update system too, one step at a time!

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2017 13:35 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/9 "2017-09-26T13:35:25Z")

</div>

@waako trying to trace the error line numbers you posted above, the first in input\_model.php corresponds to the input clean method, which seems strange to have been triggered from a mqtt\_input reset as there are no calls to this method from the script. Are you running the emoncms stable branch on a standard emonSD setup?

For the inputs spinning issue: can you post the result of emoncms/input/list.json?

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 14:40 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/10 "2017-09-26T14:40:30Z")

</div>

Thanks @TrystanLea ,

Yes, I am running stable branch with emonSD setup, and emoncms/input/list.json gives me:  
`Fatal error: Call to a member function fetch_object() on boolean in /var/www/emoncms/Modules/input/input_model.php on line 377`

I notice this error came up in [Emoncms Apps: Call to a member function fetch\_object() on a non-object?](https://community.openenergymonitor.org/t/emoncms-apps-call-to-a-member-function-fetch-object-on-a-non-object/4615) But I’ve tried running database updates, but they don’t stick and have this issue on the page:  
`Notice: Trying to get property of non-object in /var/www/emoncms/Lib/dbschemasetup.php on line 41`

The logs were indeed being filled by Node Red’s telegram node, removed it and logs issue fixed, I’d already moved to using chatbot anyway.  
I’m guessing it had something to do with node-red-contrib-telegrambot wanting NodeJS version 5.x and I’m on 4.8. Although unsure why it suddenly became a problem.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2017 15:06 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/11 "2017-09-26T15:06:41Z")

</div>

Thanks @waako, sorry line 377 does make sense, its the line where emoncms loads the inputs from mysql into redis: [https://github.com/emoncms/emoncms/blob/stable/Modules/input/input\_model.php#L377](https://github.com/emoncms/emoncms/blob/stable/Modules/input/input_model.php#L377)

It sounds like something has gone a bit amiss in the inputs table in the emoncms mysql database, perhaps the table has crashed somehow, as it appears that emoncms is trying to recreate all fields!

Would you be able to login to mysql on the pi locally and check the inputs table? try:

```
mysql -u emoncms -p emoncms

```

password: _emonpiemoncmsmysql2016_

```
SELECT * FROM inputs;

```

Then you could try (I’ve only ever had to do this once 5+ years ago so not sure if it will sort it):

```
REPAIR TABLE inputs;
```

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 16:49 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/12 "2017-09-26T16:49:41Z")

</div>

So, this would explain the issue of inputs not loading 😕

```auto
mysql> SELECT * FROM inputs;
ERROR 1146 (42S02): Table 'emoncms.inputs' doesn't exist

```

---

<div class="post-metadata">

**Author:** ![pb66](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/pb66/32/27_2.png) [@pb66](https://community.openenergymonitor.org/u/pb66)\
**Post date:** [26 September 2017 17:01 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/13 "2017-09-26T17:01:35Z")

</div>

Try “input” rather than “input **s** ”

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 17:01 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/14 "2017-09-26T17:01:46Z")

</div>

Actually there’s an input table however (sorry trying to respond and cook dinner is probably not the most sensible for either tasks):

```auto
mysql> show tables;
+-------------------+
| Tables_in_emoncms |
+-------------------+
| app_config |
| dashboard |
| feeds |
| graph |
| input |
| multigraph |
| rememberme |
| schedule |
| setup |
| users |
+-------------------+
10 rows in set (0.00 sec)

```

However, that gives me:

```auto
mysql> SELECT * FROM input;
ERROR 130 (HY000): Incorrect file format 'input'

```

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 17:03 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/15 "2017-09-26T17:03:09Z")

</div>

Tried to repair anyway:

```auto
mysql> REPAIR TABLE input;
+---------------+--------+----------+-------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------+--------+----------+-------------------------------+
| emoncms.input | repair | Error | Incorrect file format 'input' |
| emoncms.input | repair | error | Corrupt |
+---------------+--------+----------+-------------------------------+
2 rows in set (0.00 sec)

```

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 18:05 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/16 "2017-09-26T18:05:49Z")

</div>

I ran mysqlcheck and it seems to only be the input table which has problems.

using `use_frm` repaired the table

```auto
mysql> REPAIR TABLE input use_frm;
+---------------+--------+----------+--------------------------------------+
| Table | Op | Msg_type | Msg_text |
+---------------+--------+----------+--------------------------------------+
| emoncms.input | repair | warning | Number of rows changed from 0 to 114 |
| emoncms.input | repair | status | OK |
+---------------+--------+----------+--------------------------------------+
2 rows in set (0.02 sec)

```

I now have inputs listed on /emoncms/input/view, although they all have `n/a` value.  
Thanks for all the guidance and help finding the issues so far @TrystanLea and @pb66

May be worth me restarting everything

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [26 September 2017 19:11 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/17 "2017-09-26T19:11:06Z")

</div>

Great reboot has fixed the input list view.

That leaves with nodered that won’t start: `/usr/bin/env: node-red-pi: No such file or directory`  
I know that’s a minefield of fun with how best to (re)install nodejs or nodejs-legacy and which versions to run etc.

Also have some unmet dependencies, `g++ : Depends: g++-4.9` and `libgcc-4.9-dev : Depends: libatomic1` but these last days whenever I try to run `sudo apt-get -f install` everything just crashes, so ignoring that for now and hope doesn’t cause other issues.

Thank you all for your help, I’m slowly getting there.

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [26 September 2017 21:23 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/18 "2017-09-26T21:23:51Z")

</div>

Good to hear its partially working again.  
Did you have an extensive node-red setup? or was it just stock emonSD examples?

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [27 September 2017 04:44 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/19 "2017-09-27T04:44:15Z")

</div>

I have a lot of stuff in nodered, boiler power/state, burner state, oil tank levels and heating.  
But that shouldn’t be a problem, I’ve backed up `node-red` folder just in case.

It seems I’m blocked on that anyway due to the system unmet dependencies, `sudo apt-get -f install` seems to die at 75% and crash the pi, or at least ssh and all the services.  
So that’s the main challenge now…

---

<div class="post-metadata">

**Author:** ![waako](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/waako/32/1979_2.png) [@waako](https://community.openenergymonitor.org/u/waako)\
**Post date:** [27 September 2017 09:06 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/20 "2017-09-27T09:06:44Z")

</div>

I ran the node red upgrade script and that seems to have fixed node red for now.

I’ll leave it running with nodeJS 4.8.

I’m all sorted for now thanks!

---

<div class="post-metadata">

**Author:** ![TrystanLea](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/trystanlea/32/31_2.png) [@TrystanLea](https://community.openenergymonitor.org/u/TrystanLea)\
**Post date:** [27 September 2017 10:05 UTC](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198/21 "2017-09-27T10:05:05Z")

</div>

Great good to hear!

[Next page](https://community.openenergymonitor.org/t/no-inputs-and-var-log-full-within-1h-of-boot/5198.md?page=2)
