Out of the blue I started getting a 406 Not Acceptable error from homebridge-ring, similar to the issues described in #247 . Prior to receiving this error I had not changed any login information, but after I started seeing it I refreshed my token via the GUI in hombebridge-config-ui-x, and when that didn't resolve the error I refreshed my token via the process described here on issue #247. Neither refresh has resolved the error.
This appears to have put home bridge in a restart loop, so I've stopped home bridge altogether so that I don't overload the APIs used by the other plugins.
Steps to reproduce the behavior:
no error, plugin works as it was yesterday.
[5/27/2020, 12:19:08 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
<head><title>406 Not Acceptable</title></head>
<body bgcolor="white">
<center><h1>406 Not Acceptable</h1></center>
<hr><center>openresty</center>
</body>
</html>
[5/27/2020, 12:19:08 PM] [Ring] Error connecting to API
[5/27/2020, 12:19:08 PM] [Ring] Error: Request failed with status code 406
at createError (/usr/local/lib/node_modules/homebridge-ring/node_modules/axios/lib/core/createError.js:16:15)
at settle (/usr/local/lib/node_modules/homebridge-ring/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/homebridge-ring/node_modules/axios/lib/adapters/http.js:236:11)
at IncomingMessage.emit (events.js:322:22)
at endReadableNT (_stream_readable.js:1187:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
config: {
url: 'https://api.ring.com/clients_api/session',
method: 'post',
data: '{"device":{"hardware_id":"XXXX","metadata":{"api_version":11,"device_model":"homebridge-ring"},"os":"android"}}',
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
authorization: 'Bearer XXXX',
'User-Agent': 'axios/0.19.2',
'Content-Length': 143
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
},
request: ClientRequest {
_events: [Object: null prototype] {
socket: [Function],
abort: [Function],
aborted: [Function],
error: [Function],
timeout: [Function],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'api.ring.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'api.ring.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 558,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
connection: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'api.ring.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'api.ring.com',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 558,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(kSetNoDelay)]: false,
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
_header: 'POST /clients_api/session HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'authorization: Bearer XXXX\r\n' +
'User-Agent: axios/0.19.2\r\n' +
'Content-Length: 143\r\n' +
'Host: api.ring.com\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
insecureHTTPParser: undefined,
path: '/clients_api/session',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
connection: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 406,
statusMessage: 'Not Acceptable',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular],
responseUrl: 'https://api.ring.com/clients_api/session',
redirects: [],
[Symbol(kCapture)]: false
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
_redirectable: Writable {
_writableState: [WritableState],
writable: true,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 143,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'https://api.ring.com/clients_api/session',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'content-type': [Array],
authorization: [Array],
'user-agent': [Array],
'content-length': [Array],
host: [Array]
}
},
response: {
status: 406,
statusText: 'Not Acceptable',
headers: {
'content-type': 'text/html',
date: 'Wed, 27 May 2020 17:19:08 GMT',
server: 'api.ring.com',
'server-version': '1683b685f6ff14fb6aaf832702d8f767263f4287',
'x-content-type-options': 'nosniff',
'x-frame-options': 'SAMEORIGIN',
'x-request-id': 'b7dd29e300cfd4bd282d35126e654f45',
'x-xss-protection': '1; mode=block',
'content-length': '176',
connection: 'Close'
},
config: {
url: 'https://api.ring.com/clients_api/session',
method: 'post',
data: '{"device":{"hardware_id":"XXXX","metadata":{"api_version":11,"device_model":"homebridge-ring"},"os":"android"}}',
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus]
},
request: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
connection: [TLSSocket],
_header: 'POST /clients_api/session HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'authorization: Bearer XXXX\r\n' +
'User-Agent: axios/0.19.2\r\n' +
'Content-Length: 143\r\n' +
'Host: api.ring.com\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'POST',
insecureHTTPParser: undefined,
path: '/clients_api/session',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
data: '<html>\r\n' +
'<head><title>406 Not Acceptable</title></head>\r\n' +
'<body bgcolor="white">\r\n' +
'<center><h1>406 Not Acceptable</h1></center>\r\n' +
'<hr><center>openresty</center>\r\n' +
'</body>\r\n' +
'</html>\r\n'
},
isAxiosError: true,
toJSON: [Function]
}
around 10:36 CDT this morning - about 28 minutes prior to receiving the 406 Not Acceptable errors from homebridge-ring - homebridge began crashing due to an error I'm getting from homebridge-weather-plus - I described that error in issue 136 in their project so I suppose it's possible that the rapid restarts of the homebridge service and repeat rapid requests to the ring API may have caused me to hit some service limit - is that possible?
[5/27/2020, 11:04:44 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:04:56 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:05:08 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:05:21 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:05:33 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:05:45 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:35:48 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:36:01 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:36:13 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:36:26 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 11:36:38 AM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:12:29 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:12:42 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:12:54 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:13:06 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:13:19 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:13:31 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:13:46 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:13:58 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:18:56 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:19:08 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
[5/27/2020, 12:19:21 PM] [Ring] Request to https://app.ring.com/rhq/v1/devices/v1/locations failed with status 406. Response body: <html>
Post homebridge-ring platform config _without sensitive information_
{
"refreshToken": "XXXX",
"platform": "Ring"
},
after removing the config for homebridge-weather-plus I am able to get home bridge to stay running, but I am still getting the 406 Not Acceptable error from the ring API, and my cameras aren't showing up in HomeKit, even after refreshing my token again using homebridge-config-ui-x.
Just like in #247, I'm unable to recreate this issue. If you don't already have 2fa sending texts to your phone, try turning that on and then getting another new refresh token.
I have 2fa enabled, and it is sending texts to my phone - I've had this in place for a while now, it's not something I've added or changed recently.
Weird, probably some issue on Rings end. My only suggestion is to try creating a new token again. Beyond that, I don't have any ideas.
If I had to guess I'm getting rate limited by something on their end because of the amount of rapid restarts that were going on earlier today. I'm going to leave as-is and see if it goes away after a while.
when I try logging in to the ring website I get a "Invalid email or password." message after entering the 2fa code, but I am able to log in to the website just fine using my work laptop which is running a full-tunnel VPN, so that makes me even more convinced that it's an API rate limiting thing that's tied to the public internet address of my home internet.
I'm going to close this as the issue doesn't appear to be with homebridge-ring, but rather with rate-limiting on their end, tied to my home internet IP address.
I do wonder, however, whether it'd be possible to implement some sort of safety valve/backoff that prevents rapid reloads of homebridge from hammering the ring API. It'd have to store some sort of mostRecentCall value in the local filesystem and check that value before making its call to the ring api, and if the most recent call was too recent then it'd prevent homebridge-ring from calling the API until enough time had passed.
Same thing happened to me yesterday. Still locked out. Changed account, IP and still can't get a video feed.
it worked for me today, so it's only a temporary block.
Yep, me too. API works again today - think its a 24hour block. Interestingly they block the IP from authenticating either through the website or the API but allow the apps. If you switch to another IP you can authenticate but I still couldn't get the API to stream video. Either way its temporary. Would be good to know the limits properly to build in some safety valves to stop a dodgy script or badly written bit of code (which was the case for me) from smashing their servers.
@loudgazelle and @privatesam, I think I am having the same issue. You mentioned IP, do I need to do anything at all or just wait (24 hours?) and it should eventually work again?
I don't know how long the block is, but disabling the plugin then waiting about 24 hours was all I had to do to fix it. You can validate that it's working again by visiting the ring website from the computer where homebridge-ring is running and attempting to log in - if it works and you're able to see your cameras then the plugin should work too. I wouldn't reenable the plugin until you've validated by visiting the website.
Yup, that did the trick. Waited about 24 hours and checked a few times via the website. Once I was able to sign in to the website, I re-setup the plugin and it now works again. Thanks!
Most helpful comment
I don't know how long the block is, but disabling the plugin then waiting about 24 hours was all I had to do to fix it. You can validate that it's working again by visiting the ring website from the computer where homebridge-ring is running and attempting to log in - if it works and you're able to see your cameras then the plugin should work too. I wouldn't reenable the plugin until you've validated by visiting the website.