hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
553 stars 51 forks source link

SmartThings doesn't start - heap memory exhausted #1770

Closed philhagen closed 2 years ago

philhagen commented 2 years ago

Description Upon installing the plugin to its own new bridge, the bridge never starts.

Expected behavoir The bridge should start and allow configuration

Plugin name https://github.com/tonesto7/homebridge-smartthings

Please report the issue to the plugin developer The source repository is not maintained, but the 2.3.8 version is reported to work in HOOBS and I've been using it successfully on a vanilla HomeBridge instance.

Version 4.1.21

Did you upgrade

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1?

What device are you using?

Post your config This problem manifests before any configuration is applied, but I did test with the configuration from my existing, working SmartThings plugin on the vanilla HomeBridge installation:

{
    "name": "SmartThings-v2",
    "app_url": "https://graph-na04-useast2.api.smartthings.com/api/smartapps/installations/",
    "app_id": "redacted",
    "access_token": "redacted",
    "direct_port": 8000,
    "temperature_unit": "F",
    "validateTokenId": true,
    "logConfig": {
        "debug": false,
        "showChanges": true,
        "hideTimestamp": true,
        "hideNamePrefix": true,
        "file": {
            "enabled": true,
            "level": "good"
        }
    },
    "platform": "SmartThings-v2"
}

I have also tried the following:

{
    "name": "SmartThings-v2",
    "app_url": "https://graph-na04-useast2.api.smartthings.com/api/smartapps/installations/",
    "app_id": "redacted",
    "access_token": "redacted",
    "direct_port": 8000,
    "temperature_unit": "F",
    "validateTokenId": true,
    "logConfig": {
        "debug": false,
        "showChanges": false,
        "hideTimestamp": true,
        "hideNamePrefix": true,
        "file": {
            "enabled": false,
            "level": "good"
        }
    },
    "platform": "SmartThings-v2"
}

Post your log

1/9/2022, 4:36:41 PMSmartThings Bridge starting
1/9/2022, 4:37:23 PMSmartThings BridgeERROR<--- Last few GCs --->
1/9/2022, 4:37:23 PMSmartThings BridgeERROR[17355:0x5363d98]    38471 ms: Scavenge (reduce) 252.3 (261.5) -> 252.1 (261.8) MB, 11.5 / 0.0 ms  (average mu = 0.691, current mu = 0.667) allocation failure
1/9/2022, 4:37:23 PMSmartThings BridgeERROR[17355:0x5363d98]    42231 ms: Mark-sweep (reduce) 252.4 (261.8) -> 252.2 (262.0) MB, 3726.1 / 0.1 ms  (+ 1017.2 ms in 219 steps since start of marking, biggest step 5.4 ms, walltime since start of marking 5651 ms) (average mu = 0.512, current mu = 0.291)
1/9/2022, 4:37:23 PMSmartThings BridgeERROR<--- JS stacktrace --->
1/9/2022, 4:37:23 PMSmartThings BridgeERRORFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

These log messages then repeat endlessly.

Additional context I realize this is not a certified plugin and if that's the culprit, I can live with that. My only reason for reporting was that others have reported this plugin version working fine and that it's working on another HomeBridge instance here.

philhagen commented 2 years ago

I consolidated several bridges into one, and this plugin is now working fine. I saw a note on another issue about multiple bridges creating much higher demands on RAM and figured it was worth a shot. Closing the issue but wanted to add an explanation for anyone else with similar issues.

(Or for me, when, in 5 years, I have the same problem, can't remember the fix, Google the error, and find the issue I previously reported.)