Closed NainRouge closed 1 year ago
EHOSTUNREACH is a network level issue. Router problem, Wi-Fi problem, ISP issue, network stack setup issue on whatever device you’re running on. Not a problem with this plug-in, or with Homebridge.
Nothing is blocked in my network logs, though. Guess I’m buying Ecobee because this plug-in working consistently was the only thing keeping me with Nest.
A consistent failure every other homebridge restart, and it's "my network." What a joke.
The error message even says it's trying to connect to https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt which is a 404 page from Google.
"404. That’s an error.
The requested URL /v1/issue_jwt was not found on this server. That’s all we know."
But hey, it's my fault.
Line 195 in nest-connection.js is the start of the call to https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt, a literal dead link.
req = { method: 'POST', timeout: API_TIMEOUT_SECONDS * 1000, url: 'https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt', data: { embed_google_oauth_access_token: true, expire_after: '3600s', google_oauth_access_token: googleAccessToken, policy_id: 'authproxy-oauth-policy' }, headers: { 'Authorization': 'Bearer ' + googleAccessToken, 'User-Agent': NestEndpoints.USER_AGENT_STRING, // 'x-goog-api-key': this.config.googleAuth.apiKey, 'Referer': 'https://' + NestEndpoints.NEST_API_HOSTNAME } };
But please, tell me more about how my network is the cause of your failure.
If you think you know better than me what the error produced by my plug-in means, why are you asking me for help? My statement that this is due to a network-side issue is correct. You are free not to believe that, but understand that you will then waste a lot of time troubleshooting in the wrong places. I suggest you think of things like: work out if this only happens just after a system restart. If so then maybe your IPv6 stack (or connection to the router) is not coming online soon enough. Consider adding a delay. Since it's resolving to an IPv6 address, consider disabling IPv6 on your machine and see if the issue goes away.
https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt
is not a literal dead link. If you go to that page in your browser, it is making a GET request and that indeed returns 404 because that endpoint does not support GET requests.
As you will see from the line of code you posted, the plug-in is making a POST request which you can easily prove to yourself is not a dead link, e.g.
curl -X POST https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt
does not return 404.
Honestly, you come across as a jerk. I hope someday you realize that.
That said, I'll concede that I did a GET instead of a POST.
If a restart of the homebridge app, not the device, causes the IPv6 stack to mess up every other restart it’s a problem with either your plugin or homebridge.
For any other users who get the EHOSTUNREACH error, confirming that @adriancable is correct and when I received the error (first time after using plugin for years) it was a hiccup with an IPV6 address and my router. I was actually not aware of the issue until the plugin essentially "revealed" it. A simple restart of my router and container where Homebridge resides (and a new IPV6 connection with the router ) resolved the issue immediately. All is once again working perfectly. Adding comment as per the original recommendation on this thread, reconfirming the local network is resolving properly is a much more efficient use of time than focusing on the plugin. Appreciative of the plugin and your efforts to maintain it. Thank you.
Sometimes on restart of my Homebridge, the plugin will fail to connect with an EHOSTUNREACH error.
To Reproduce Steps to reproduce the behavior:
Expected behavior It to not fail almost every other restart.
Include with your bug report this version info: Node v18.15.0 Homebridge 1.6.0
Config { "name": "Nest", "googleAuth": { "issueToken": "https://accounts.google.com/o/oauth2/iframerpc?action=issueToken&response_type=token%20id_token&login_hint=REMOVED.apps.googleusercontent.com&origin=https://home.nest.com&scope=openid profile email https://www.googleapis.com/auth/nest-account&ss_domain=https://home.nest.com&include_granted_scopes=true", "cookies": "REMOVED" }, "platform": "Nest" },
Error Error: connect EHOSTUNREACH 2607:f8b0:4009:808::200a:443 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -113, code: 'EHOSTUNREACH', syscall: 'connect', address: '2607:f8b0:4009:808::200a', port: 443, config: { url: 'https://nestauthproxyservice-pa.googleapis.com/v1/issue_jwt', method: 'post', data: '{"embed_google_oauth_access_token":true,"expire_after":"3600s","google_oauth_access_token":"REMOVED","policy_id":"authproxy-oauth-policy"}', headers: { Accept: 'application/json, text/plain, /', 'Content-Type': 'application/json', Authorization: 'Bearer REMOVED', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', Referer: 'https://home.nest.com', 'Content-Length': 341 }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 40000, adapter: [Function: httpAdapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, validateStatus: [Function: validateStatus], transitional: { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false } }, request: <ref *1> Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, buffered: [], bufferedIndex: 0, allBuffers: true, allNoop: true, pendingcb: 0, constructed: true, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: true, errored: null, closed: false, closeEmitted: false,
}, response: undefined, isAxiosError: true, toJSON: [Function: toJSON], status: undefined }