naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
313 stars 63 forks source link

stuck in crash loop #136

Closed loudgazelle closed 4 years ago

loudgazelle commented 4 years ago

I'm experiencing an issue that seems similar to #121 in that it's crashing all of HomeBridge - it appears to be due to homebridge-weather-plus not handling the TypeError correctly. This has put HomeBridge in a restart loop.

[5/27/2020, 11:05:45 AM] TypeError: Cannot read property 'pressure' of undefined
    at OpenWeatherMapAPI.parseWeather (/usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:156:40)
    at OpenWeatherMapAPI.parseReport (/usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:111:8)
    at /usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:95:11
    at Request._callback (/usr/local/lib/node_modules/homebridge-weather-plus/apis/openweathermap.js:250:5)
    at Request.self.callback (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:185:22)
    at Request.emit (events.js:310:20)
    at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:310:20)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/homebridge-weather-plus/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:416:28)
    at IncomingMessage.emit (events.js:322:22)
    at endReadableNT (_stream_readable.js:1187:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
[5/27/2020, 11:05:45 AM] Got SIGTERM, shutting down Homebridge...

the error has occurred 110 times in the span of 29 minutes:

cat homebridge.log|egrep "TypeError: Cannot read property 'pressure' of undefined" |wc -l
     111

full details showing timing

[5/26/2020, 3:02:08 PM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:36:14 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:36:26 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:36:38 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:36:50 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:37:02 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:37:15 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:37:27 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:37:39 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:37:51 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:38:03 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:38:16 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:38:32 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:38:44 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:38:57 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:39:10 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:39:22 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:39:35 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:39:48 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:40:01 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:40:13 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:40:25 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:40:38 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:40:52 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:41:04 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:41:18 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:41:34 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:41:47 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:42:00 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:42:13 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:42:27 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:42:40 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:42:52 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:43:04 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:43:17 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:43:29 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:43:42 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:43:55 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:44:09 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:44:22 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:44:34 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:44:46 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:44:58 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:45:11 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:45:23 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:45:35 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:45:47 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:45:59 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:46:11 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:46:24 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:46:37 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:46:49 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:47:01 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:47:13 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:47:26 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:47:38 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:47:51 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:48:05 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:48:17 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:48:29 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:48:41 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:48:54 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:49:06 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:49:18 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:49:31 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:49:40 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:49:52 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:50:04 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:50:16 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:50:29 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:50:41 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:50:53 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:51:06 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:51:18 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:51:31 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:51:43 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:51:55 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:52:07 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:59:13 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:59:25 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:59:37 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 10:59:50 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:00:02 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:00:14 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:00:27 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:00:39 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:00:51 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:01:03 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:01:15 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:01:28 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:01:40 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:01:52 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:02:06 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:02:18 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:02:30 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:02:42 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:02:54 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:03:06 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:03:19 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:03:31 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:03:43 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:03:55 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:04:07 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:04:20 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:04:32 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:04:44 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:04:56 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:05:08 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:05:21 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:05:33 AM] TypeError: Cannot read property 'pressure' of undefined
[5/27/2020, 11:05:45 AM] TypeError: Cannot read property 'pressure' of undefined

This is probably further exacerbating issue #135, which I just logged, but I suppose it may also be caused by issue #135 if I'm getting rate limited by their API, but the "block logs" section of their site doesn't show that I've been blocked.

loudgazelle commented 4 years ago

after removing the homebridge-weather-plus config from config.json homebridge is stable and not stuck in a restart loop.

prior to removing homebridge-weather-plus from config.json I updated my config to the following in an attempt to resolve the error, but the error persisted and homebridge continued to be stuck in a restart loop.

           "units": "us",
            "interval": 10,
            "stations": [
                {
                    "service": "openweathermap",
                    "key": "XXXX",
                    "locationId": 4393217,
                    "locationGeo": [
                        XXXX,
                        XXXX
                    ],
                    "locationCity": "Kansas City, US",
                    "language": "en",
                    "compatibility": "both",
                    "units": "us",
                    "forecast": [
                        0
                    ],
                    "conditionCategory": "simple",
                    "now": true,
                    "extraHumidity": false,
                    "tresholdCloudCover": 80
                }
            ],
            "platform": "WeatherPlus"
kfalkiewicz commented 4 years ago

Got exactly same issue. Is started doing this few days ago. Maybe API has changed.

loudgazelle commented 4 years ago

@kfalkiewicz are you also getting emails from OpenWeather stating you're making a large number of API calls as I describe in issue #135?

kfalkiewicz commented 4 years ago

No, only this error message.

naofireblade commented 4 years ago

Thanks for reporting! The OWM API seems a bit unstable. I will release a fix in the next few minutes.

naofireblade commented 4 years ago

Fixed in v3.2.2 (hopefully 😃)

@loudgazelle I'm still invastigating your api limit exceeding issue.

loudgazelle commented 4 years ago

yes, i can confirm 3.2.2 fixed it, and I'm able to run w/o issue.