luisiam / homebridge-liftmaster2

LiftMaster Plugin for HomeBridge (API 2.0): https://github.com/nfarina/homebridge
61 stars 15 forks source link

UnhandledPromiseRejectionWarning #55

Open danhausman opened 5 years ago

danhausman commented 5 years ago

This was working perfect for me until today.... Anyone else seeing this issue? Is the myq server down?

(node:78542) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://myqexternal.myqdevice.com/api/v4/User/Validate reason: Unexpected token < in JSON at position 0 at /usr/local/lib/node_modules/homebridge-liftmaster2/node_modules/node-fetch/lib/body.js:48:31 at process.internalTickCallback (internal/process/next_tick.js:77:7) (node:78542) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:78542) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

danhausman commented 5 years ago

Did some more playing, looks like the myq app is not working from my phone on wifi, but works from cellular. Wondering if my home IP got blacklisted from the api.

danhausman commented 5 years ago

Definitely blacklisted. I changed the mac on my router and rebooted my modem. Got a new IP and I am back up and running? Any reason to be concerned about getting blacklisted? Is the myq stuff an open API or is that a private API?

dpyy commented 5 years ago

Same problem, any work around?

danhausman commented 5 years ago

Same problem, any work around?

yep, went into my router, changed the mac address of the router connected to my cable modem. Rebooted my cable modem, and my ISP gave me a new ip address. So in a way.. changing my ip address solved it for me for now.

fabriziorizzo commented 4 years ago

In my case, homebridge isn't able to connect with the error below, but my phone's myQ app is working just fine from the same network. doesn't seem like my router's public IP's been blacklisted.

looks like a bad catch block or not handling the EAI_AGAIN error which is a temporary DNS resolution error that should be retried or otherwise handled correctly.

Error Message in homebridge log:

(node:364) UnhandledPromiseRejectionWarning: FetchError: request to https://myqexternal.myqdevice.com/api/v4/User/Validate failed, reason: getaddrinfo EAI_AGAIN myqexternal.myqdevice.com myqexternal.myqdevice.com:443
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/homebridge-liftmaster2/node_modules/node-fetch/index.js:133:11)
    at ClientRequest.emit (events.js:182:13)
    at TLSSocket.socketErrorListener (_http_client.js:391:9)
    at TLSSocket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:364) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (
rejection id: 1)
(node:364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The homebridge server an definitely resolve the IP address correctly...

Testing connection via curl on command-line:

/homebridge # curl -k -vv https://myqexternal.myqdevice.com/api/v4/User/Validate
*   Trying 40.71.236.219...
* TCP_NODELAY set
* Connected to myqexternal.myqdevice.com (40.71.236.219) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; postalCode=60523; ST=IL; L=Oakbrook; street=300 Windsor Drive; O=The Chamberlain Group Inc; OU=IT; OU=Secure Link SSL Wildcard; CN=*.myqdevice.com
*  start date: Jul 31 00:00:00 2017 GMT
*  expire date: Aug 25 23:59:59 2020 GMT
*  issuer: C=US; ST=VA; L=Herndon; O=Network Solutions L.L.C.; CN=Network Solutions OV Server CA 2
*  SSL certificate verify ok.
> GET /api/v4/User/Validate HTTP/1.1
> Host: myqexternal.myqdevice.com
> User-Agent: curl/7.61.1
> Accept: */*
> 
< HTTP/1.1 405 Method Not Allowed
< Cache-Control: no-cache
< Pragma: no-cache
< Allow: POST
< Content-Type: application/json; charset=utf-8
< Expires: -1
< Request-Context: appId=cid-v1:f8af374d-e45c-46bf-9bb3-6bea6964769d
< Date: Wed, 11 Dec 2019 23:24:32 GMT
< Content-Length: 72
< Set-Cookie: TS019ab44f=01474093dc7c441af16ab529b205407899f092ad46f1c4d2849ecbf398a0d1ab4c110e490e31b17a0ecadfb920d2555753ae3e4341; Path=/; Domain=.myqexternal.myqdevice.com
< 
* Connection #0 to host myqexternal.myqdevice.com left intact
{"Message":"The requested resource does not support http method 'GET'."}