homebridge-broadlink-rm icon indicating copy to clipboard operation
homebridge-broadlink-rm copied to clipboard

Random Crash with error message- TypeError: log is not a function

Open mwkchan opened this issue 4 years ago • 9 comments

I experienced 3 random cashes within 5 mins tonight. Here's the log:

[2/28/2020, 3:07:02 AM] TypeError: log is not a function at Characteristic.Name.getName (/usr/local/lib/node_modules/homebridge-broadlink-rm/node_modules/homebridge-platform-helper/dist/serviceManager.js:69:9) at Characteristic.Name.emit (events.js:311:20) at Characteristic.Name.Characteristic.getValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:164:10) at Bridge. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:771:20) at Array.forEach (:null:null) at Bridge.Accessory._handleGetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:735:8) at HAPServer.emit (events.js:311:20) at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:928:10) at HAPServer. (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at IncomingMessage.emit (events.js:311:20) at endReadableNT (_stream_readable.js:1204:12) at processTicksAndRejections (internal/process/task_queues.js:84:21)

[2/28/2020, 3:07:02 AM] Got SIGTERM, shutting down Homebridge... [2/28/2020, 3:07:02 AM] [Master Room Hub] INFO - shutdown [2/28/2020, 3:07:08 AM] Loaded config.json with 7 accessories and 11 platforms.

mwkchan avatar Feb 27 '20 19:02 mwkchan

Hello @lprhodes haven't heard from you in a while, I hope you're okay?

I have the same problem as above since I added this switch in the config:

{ "name":"Ambilight Wohnzimmer", "type":"switch", "persistState": true, "host":"192.168.178.XX", "enableAutoOff": false, "onDuration": 2.5, "data": [ { "data": "26005000591c101c100e0f0e2d2b0f0e100e0f0e100d100e0f0e100d1f1c100d100e1e0e0f0e100e0f000ad5581d101c100d100e2d2b0f0e100d100e0f0e100e0f0e0f0e1e1d0f0e100e1e0e0f0e100d10000d050000000000000000)", "sendCount": 5, "interval": 0.1 } ] },

Bildschirmfoto 2020-03-02 um 19 24 46

Would be cool if you could fix it?

Greetings Nastras

Nastras avatar Mar 02 '20 18:03 Nastras

The error can be reproduced by updating the devices in a HomeKit app.

Nastras avatar Mar 02 '20 18:03 Nastras

There is already a pull, unfortunately it does not work for me. Has anyone else tested it?

Nastras avatar Mar 03 '20 07:03 Nastras

After the pull proved to be useless I have unfortunately not yet found a solution. What I noticed is that the plugin crashes every time I call a device that is connected via the plugin. @lprhodes would be great if you could take a look at it. I hope that the next support will not be until christmas time 😉

Thank you very much!

Nastras avatar Mar 05 '20 18:03 Nastras

Just found the error and fixed it.

And here's the solution if you ever have that problem:

In the folder /var/homebridge-broadlink-rm/plugin-persist/homebridge-broadlink-rm are the files where the plugin stores the state of the devices there were duplicate files from some devices and so the error occurred from above. Why the files have been duplicated no idea.

After I deleted all persist files in the folder, the plugin works fine again.

Nastras avatar Mar 08 '20 15:03 Nastras

Got any idea where are those files in a MacOS environment?

mwkchan avatar Mar 08 '20 15:03 mwkchan

Forget it, now after several hours the error has occurred again -.- It seems to be another problem in the code.

I'm using up to fix the problem version 3.6.18 now, there it seems to work.

@lprhodes Got any advice?

Nastras avatar Mar 08 '20 17:03 Nastras

@mwkchan

Please change the name of the issue to Random Crash with error message- TypeError: log is not a function

So that it can be better found by others who are also affected. Thanks!

Nastras avatar Mar 10 '20 10:03 Nastras

@Nastras thanks for the heads-up. Has this version been running fine for you?

faaarmer avatar Oct 16 '20 07:10 faaarmer