406 Not Acceptable error
See original GitHub issueBug Report
Describe the Bug
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.
To Reproduce
Steps to reproduce the behavior:
- Start Homebridge
- See error in logs
Expected behavior
no error, plugin works as it was yesterday.
Screenshots/Logs
[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]
}
Additional context
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>
Homebridge Ring Config
Post homebridge-ring platform config without sensitive information
{
"refreshToken": "XXXX",
"platform": "Ring"
},
Environment
- OS: MacOS 10.15.4 (19E287)
- Node.js: v12.16.3
- NPM: 6.14.4
- homebridge-ring: homebridge-ring v8.2.0
- homebridge: Version 1.1.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (2 by maintainers)
Top GitHub Comments
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!