# SDcard full of log files - (TCP error TP-Link)

**URL:** <https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155>\
**Category:** General\
**Created:** [25 October 2019 18:24 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155 "2019-10-25T18:24:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)\
**Post date:** [25 October 2019 18:24 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/1 "2019-10-25T18:24:58Z")

</div>

Today my 16GB sdcard totally filled up and crashed node red. Luckily I had my flows backup up from a few days back.

The culprits are:

var/log/daemon.log (3.5GB)  
var/log/syslog (0.5GB)  
various .gz log file totalling 3GB

I copied the logs to my computer and deleted them from the sdcard, now it's running fine.

The log files are full of this over and over (I could not even post 1 seconds worth it's too long!!!)  
It seems to be the TP-Link node - I think.

Any ideas?

**syslog**

```auto
Oct 25 06:25:28 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982205)
Oct 25 06:25:29 raspberrypi Node-RED[348]: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: at Timeout._onTimeout (/home/pi/.node-red/node_modules/tplink-smarthome-api/lib/client.js:249:20)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at ontimeout (timers.js:436:11)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at tryOnTimeout (timers.js:300:5)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at listOnTimeout (timers.js:263:5)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at Timer.processTimers (timers.js:223:10)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982206)
Oct 25 06:25:29 raspberrypi Node-RED[348]: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: TCP Timeout
Oct 25 06:25:29 raspberrypi Node-RED[348]: at Timeout._onTimeout (/home/pi/.node-red/node_modules/tplink-smarthome-api/lib/client.js:249:20)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at ontimeout (timers.js:436:11)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at tryOnTimeout (timers.js:300:5)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at listOnTimeout (timers.js:263:5)
Oct 25 06:25:29 raspberrypi Node-RED[348]: at Timer.processTimers (timers.js:223:10)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982207)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982208)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982209)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982210)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982211)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982212)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982213)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982214)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982215)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982216)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982217)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982218)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982219)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982220)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982221)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982222)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982223)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982224)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982225)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1982226)
Oct 25 06:25:29 raspberrypi Node-RED[348]: [undefined] device.send() Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: (node:348) UnhandledPromiseRejectionWarning: Error: connect EHOSTUNREACH 192.168.1.41:9999
Oct 25 06:25:29 raspberrypi Node-RED[348]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)

```

---

<div class="post-metadata">

**Author:** ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)\
**Post date:** [25 October 2019 18:32 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/2 "2019-10-25T18:32:36Z")

</div>

> [@877](#):
>
> 192.168.1.41

This is actually a TP-Link lightbulb I recently added to my system, and is unplugged - hence unreachable. Surely node red should not be logging this this extent?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 October 2019 18:34 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/3 "2019-10-25T18:34:16Z")

</div>

We’ll Node-RED will log what it is told to. So I would open an issue against that tplink node and ask the author to stop it retrying so often

---

<div class="post-metadata">

**Author:** ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)\
**Post date:** [25 October 2019 18:38 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/4 "2019-10-25T18:38:28Z")

</div>

Yes absolutely! I will raise an issue on github.

I know this is more of a Raspberry Pi question but is there anyway to limit the log file sizes in future?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 October 2019 18:42 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/5 "2019-10-25T18:42:49Z")

</div>

Yes. Read up on the logrotate function and its settings.

---

<div class="post-metadata">

**Author:** ![877](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/877/32/8207_2.png) [@877](https://discourse.nodered.org/u/877)\
**Post date:** [25 October 2019 18:43 UTC](https://discourse.nodered.org/t/sdcard-full-of-log-files-tcp-error-tp-link/17155/6 "2019-10-25T18:43:12Z")

</div>

Cool thanks!

Info here for anyone else who finds this:

> **[Setting up logrotate for your own log file (e.g. Backuppc rsync.log)](http://no-sheds.blogspot.com/2018/04/setting-up-logrotate-for-your-own-log.html)**
>
> Log files in Linux are files that give you information about processes and what they are doing.  They often contain lots of useful informati...
