naofireblade/homebridge-weather-plus

"Cannot read properties of undefined error

mariomaz87 opened this issue · 4 comments

Hi,
In the last few days I get an error in HomeBridge that cause my whole instance to restart. In the log I see:

^[[37m[08/01/2023, 02:40:12] ^[[39m^[[31mTypeError: Cannot read properties of undefined (reading 'includes')^[[39m
^[[31m at /usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:118:32^[[39m
^[[31m at Request._callback (/usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:406:5)^[[39m
^[[31m at self.callback (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:185:22)^[[39m
^[[31m at Request.emit (node:events:526:28)^[[39m
^[[31m at Request.onRequestError (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:877:8)^[[39m
^[[31m at ClientRequest.emit (node:events:526:28)^[[39m
^[[31m at TLSSocket.socketErrorListener (node:_http_client:442:9)^[[39m
^[[31m at TLSSocket.emit (node:events:526:28)^[[39m
^[[31m at emitErrorNT (node:internal/streams/destroy:157:8)^[[39m
^[[31m at emitErrorCloseNT (node:internal/streams/destroy:122:3)^[[39m
^[[37m[08/01/2023, 02:40:12] ^[[39mGot SIGTERM, shutting down Homebridge...
^[[37m[08/01/2023, 02:40:12] ^[[39m^[[36m[DeebotEcovacs]^[[39m INFO - shutdown
^[[37m[08/01/2023, 02:40:17]^[[0m ^[[36m[HB Supervisor]^[[0m Homebridge Process Ended. Code: 143, Signal: null
^[[37m[08/01/2023, 02:40:22]^[[0m ^[[36m[HB Supervisor]^[[0m Restarting Homebridge...

Is something related to the plugin or something on my side? Thanks!

Also see this.

I fixed the issue moving my HB to a Pi4 (was on a Pi 2 W). Probably something related to memory issue!

I am also experiencing this issue as of the last 2 days. The error can occur multiple times an hour. As noted by @mariomaz87 logs this causes a SIGTERM forcing Homebridge to reboot.

I am running homebridge-weather-plus v3.2.10 on a Mac mini server with Homebridge v1.6.0.

Example log message:

TypeError: Cannot read properties of undefined (reading 'includes')
    at /usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:118:32
    at Request._callback (/usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:406:5)
    at self.callback (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:185:22)
    at Request.emit (node:events:513:28)
    at Request.onRequestError (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:877:8)
    at ClientRequest.emit (node:events:513:28)
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)

Fixed in v3.2.11. Sorry for the inconveniences.