henry-spanka / freeathome-api

Busch-Jaeger free@home API to control actuators
MIT License
45 stars 4 forks source link

v1.1.0 runs fine on Raspberry Stretch for about a month in Docker, then seems to crash with JS heap memory error #27

Closed Thomas-Schubert closed 2 years ago

Thomas-Schubert commented 4 years ago

... 1/20/2020, 7:54:03 AM - INFO: Sent Subscription Confirmation

<--- Last few GCs --->

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory [1:0x30f2f70] 1707431791 ms: Mark-sweep 227.6 (231.9) -> 227.5 (231.9) MB, 1911.1 / 0.0 ms (average mu = 0.878, current mu = 0.087) last resort GC in old space requested [1:0x30f2f70] 1707434495 ms: Mark-sweep 227.5 (231.9) -> 227.5 (231.9) MB, 2703.7 / 0.0 ms (average mu = 0.757, current mu = 0.000) last resort GC in old space requested

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0x1425f80]
1: StubFrame [pc: 0x1496b50]

Security context: 0x490c0451 2: onStreamRead [0x377228fd] [internal/stream_base_commons.js:158] [bytecode=0x5bc3f9a1 offset=0](this=0x56a2c90d ,0x478b0339 ) 3: InternalFrame [pc: 0x1395d50] 4: EntryFrame [pc: 0x1395a54]

==== Details ================================================

[0]: ExitFrame [p...

henry-spanka commented 4 years ago

Is this reproducible or did it happen only once? We might have a memory leak somewhere. I will look into this if it happens again. You can setup systemd to automatically restart the process on failure.

Thomas-Schubert commented 4 years ago

The API just stops working after a couple of days. Auto-restart with docker doesn't seem to help, I have a forced restart cron-jobbed now.

Currently, the error looks as follows:

4/13/2020, 6:41:41 PM - INFO: Starting free@home API /usr/src/app/dist/appRunner.js:33 throw up; ^

Error: Could not connect to free@home API: connect EHOSTUNREACH at Application. (/usr/src/app/dist/lib/Application.js:34:23) at Generator.throw () at rejected (/usr/src/app/dist/lib/Application.js:6:65) at processTicksAndRejections (internal/process/task_queues.js:94:5)

henry-spanka commented 4 years ago

That means that either the IP is incorrect or your network is not configured properly. Check that the connection to the SysAp is stable.