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

EventEmitter memory leak (after adding 11th listener) #1721

Closed JimCSaratoga closed 2 years ago

JimCSaratoga commented 2 years ago

Description While running a HOOBS box (recently upgraded to Version 4.1.18, Node Version 16.13.1, Homebridge 1.3.8) with a single plugin: Platform InsteonLocal Bridge version 0.4.21 I've run into a Max Listeners Error after adding my 11th Insteon device. The node error is (node:13124) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [Insteon]. Use emitter.setMaxListeners() to increase limit Upon rebooting the HOOBS, the same error was encountered but this time with (node:660)

Version Please include the version of HOOBS you are using. Version 4.1.18

Did you upgrade Please let us know if you upgraded from a previous version.

Pervious version If you upgraded, please let us know your previous version. Sorry don't have this information

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1? Did you perform an upgrade from HOOBS 2.1.1? Some things are different.

What device are you using? Please let us know the device you are running HOOBS on.

If this is a custom install, what's your operating system? Please let us know what operating system and version you are using. Ex. Fedora 30 or macOS Catalina.

List your plugins Please include a list of the plugins you are using. We need to be able to find it on NPM. If the plugin is no published, please include a link to the repository. PLATFORM INSTEONLOCAL BRIDGE https://github.com/kuestess/homebridge-platform-insteonlocal

Post your config This can be found in the interface, Configuration -> Advanced or you can get it via SSH cat ~/.hoobs/etc/config.json

{
    "accessories": [],
    "platforms": [
        {
            "platform": "InsteonLocal",
            "name": "InsteonLocal",
            "user": "********",
            "pass": "******",
            "host": "192.168.*.*",
            "port": "25105",
            "model": "2245",
            "refresh": false,
            "server_port": "3000",
            "keepAlive": "3600",
            "devices": [
                {
                    "name": "First Bedroom Can Lights",
                    "deviceID": "******",
                    "deviceType": "dimmer",
                    "dimmable": "true",
                    "targetKeypadID": [
                        "******"
                    ],
                    "targetKeypadBtn": [
                        "B"
                    ],
                    "targetKeypadSixBtn": [
                        false
                    ]
                },
                {
                    "name": "Second Bedroom Can Lights",
                    "deviceID": "******",
                    "deviceType": "dimmer",
                    "dimmable": "true",
                    "targetKeypadID": [
                        "******"
                    ],
                    "targetKeypadBtn": [
                        "C"
                    ],
                    "targetKeypadSixBtn": [
                        false
                    ]
                },
                {
                    "name": "Third Bedroom Can Lights",
                    "deviceID": "******",
                    "deviceType": "dimmer",
                    "dimmable": "true",
                    "targetKeypadID": [
                        "******"
                    ],
                    "targetKeypadBtn": [
                        "D"
                    ],
                    "targetKeypadSixBtn": [
                        false
                    ]
                },
                {
                    "name": "Kitchen Table Lights 1",
                    "deviceID": "******",
                    "deviceType": "dimmer",
                    "dimmable": "true"
                },
                {
                    "name": "Kitchen Table Lights 2",
                    "deviceID": "******",
                    "deviceType": "dimmer",
                    "dimmable": "true"
                },
                {
                    "name": "Front Entrance Lanterns",
                    "deviceID": "******",
                    "deviceType": "switch",
                    "dimmable": "false"
                },
                {
                    "name": "Driveway Lanterns 1",
                    "deviceID": "******",
                    "deviceType": "switch",
                    "dimmable": "false",
                    "targetKeypadID": [
                        "******"
                    ],
                    "targetKeypadBtn": [
                        "B"
                    ],
                    "targetKeypadSixBtn": [
                        true
                    ]
                },
                {
                    "name": "Driveway Lanterns 2",
                    "deviceID": "******",
                    "deviceType": "switch",
                    "dimmable": "false",
                    "targetKeypadID": [
                        "******"
                    ],
                    "targetKeypadBtn": [
                        "B"
                    ],
                    "targetKeypadSixBtn": [
                        true
                    ]
                },
                {
                    "name": "Floor Lamp",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Family Room Outlets",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Family Room Christmas Tree",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Entrance Christmas Tree 2",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Dining Room Christmas Lights",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Living Room Christmas Lights",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Stairwell Christmas Lights",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                },
                {
                    "name": "Outdoor Christmas Lights",
                    "deviceID": "******",
                    "dimmable": "false",
                    "deviceType": "switch"
                }
            ]
        }
    ]
}

Post your log You can get the log from the interface. This is in the Log section.

12/20/2021, 12:21:14 PMPlatform Insteonlocal Bridge starting
12/20/2021, 12:21:24 PMPlatform Insteonlocal BridgeLoaded plugin 'homebridge-platform-insteonlocal'
12/20/2021, 12:21:24 PMPlatform Insteonlocal BridgeLoading 1 platforms...
12/20/2021, 12:21:24 PMPlatform Insteonlocal BridgeInsteonLocalStarted connection watcher...
12/20/2021, 12:21:24 PMPlatform Insteonlocal BridgeInsteonLocalFound 16 devices in config
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeERROR(node:13124) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [Insteon]. Use emitter.setMaxListeners() to increase limit
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeERROR(Use `node --trace-warnings ...` to show where the warning was created)
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeBridge is running on port 51826.
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalConnected to Insteon Model 2245 Hub...
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for First Bedroom Can Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Second Bedroom Can Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Third Bedroom Can Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Kitchen Table Lights 1
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Kitchen Table Lights 2
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Front Entrance Lanterns
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Driveway Lanterns 1
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Driveway Lanterns 2
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Floor Lamp
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Family Room Outlets
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Family Room Christmas Tree
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Entrance Christmas Tree 2
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Dining Room Christmas Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Living Room Christmas Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Stairwell Christmas Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalGetting status for Outdoor Christmas Lights
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalInsteon event listener started...
12/20/2021, 12:21:25 PMPlatform Insteonlocal BridgeInsteonLocalStarted Insteon Express server...
12/20/2021, 12:21:31 PMPlatform Insteonlocal BridgeInsteonLocalGot updated status for Kitchen Table Lights 2
12/20/2021, 12:31:36 PMPlatform Insteonlocal BridgeInsteonLocalSetting power state of Stairwell Christmas Lights to on
12/20/2021, 12:31:37 PMPlatform Insteonlocal BridgeInsteonLocalSetting power state of Stairwell Christmas Lights to off
12/20/2021, 12:32:39 PMPlatform Insteonlocal BridgeInsteonLocalSetting power state of Living Room Christmas Lights to on
12/20/2021, 12:32:46 PMPlatform Insteonlocal BridgeInsteonLocalSetting power state of Living Room Christmas Lights to off

Additional context The error first appeared after adding the 11th device. Not sure where I can go on HOOBS to increase the # of listeners but also am not sure if that is an actual proper step.

BobbySlope commented 2 years ago

You can safely ignore this warning See issue closed by developer:

https://github.com/kuestess/homebridge-platform-insteonlocal/issues/170