Giter Club home page Giter Club logo

Comments (49)

tsightler avatar tsightler commented on July 20, 2024 44

Please don't post a lot of "me too" post here, that does nothing but fill the maintainers inbox with lots of messages while providing no additional value. If you are having the same issue and feel the need to express yourself, a "thumbs up" on the initial post is enough. Of course if you have details to add beyond what has already been posted, feel free to do so.

It's quite clear that this is a change in behavior of the Ring server side, what is not clear is if it is a permanent change, or a temporary issue. The ring-client-api code is using app.ring.com to request tickets for opening a websocket connection. Historically this URL load balanced requests to a pool of servers but as of some point today it is returning the error "No available app brokers".

The official Ring app appears to use prd-api-us.prd.rings.solutions and the Ring web console uses account.ring.com/api which is also used for requesting the ticket for the WebRTC control channel websocket as well. These both seem to be working, so it's possible Ring is simply disabling this functionality on the old app pool and we'll need to update ring-client-api to use the new URL.

We're likely in for a bumpy ride with the Ring API for the next few weeks as, due the the deprecation and imminent disabling of the legacy FCM APIs (not directly related to Ring, but used for push notifications), we're also in the middle of migrating to FCM v1 to be able to continue to receive push notifications. Unfortunately, this work has been challenging as it depends on upstream packages which had several limitations in the implementation that made it unsuitable for use with ring-client-api. I finally managed to get this working last night, but upgrading will require upstream to accept a small PR I've submitted, a complete re-authentication cycle will have to be completed, and perhaps more. This work is ongoing, but it's a race against the clock since the official disable data for the legacy FCM API is June 20th.

I've also noticed there are other changes happening, lots of backend APIs failing even in the official Ring app, my guess is they are doing some backend optimization and consolidation. We'll do our best to keep up with the changes, at least so far I've not seen any intentional attempt to block 3rd-party access, something I have long feared could happen, but providing 100% reliability for a reverse engineered API is simply not possible.

from ring.

tsightler avatar tsightler commented on July 20, 2024 24

I have confirmed that replacing app.ring.com with prd-api-us.prd.rings.solutions seems to work around the issue. As far as I can tell this is used only for ticket requests and for changing modes, so I need to investigate if mode changes work with this new URL as well, if so, it should be a simple change.

If any of you know what you are doing and are interested in manually working around the issue, you can edit node_modules/ring-client-api/lib/rest-client.js and replace appApiBaseUrl = 'https://app.ring.com/api/v1/' with appApiBaseUrl = 'https://prd-api-us.prd.rings.solutions/api/v1/' on line 22.

from ring.

tsightler avatar tsightler commented on July 20, 2024 10

12.1.1 has been released with a fix for this issue.

from ring.

tsightler avatar tsightler commented on July 20, 2024 8

As I stated earlier, it was quite likely the problem was temporary on the Ring side, the service errored with a message indicating a backend problem, not that it didn't exist or anything like that, it seemed likely to be temporary. That being said, it doesn't mean we shouldn't update the URL at some point to use the same one the Ring app leverages, otherwise it creates issues like this where the Ring app works while the projects depending on ring-client-api do not and people go crazy like they did here.

from ring.

neilmartin83 avatar neilmartin83 commented on July 20, 2024 5

Home Assistant: Confirmed working in the UK, using a Ring account that is not the "master" either. On HAOS, I made the edits and restarted the docker container.

  1. Install the Advanced SSH & Terminal add-on and configure it correctly (with a password)
  2. Disable Protected mode on the add-on config
  3. Launch the add-on and run: docker exec -it $(docker ps | grep ring-mqtt | awk '{print $1}') /bin/sh
  4. Edit this file: vi /app/ring-mqtt/node_modules/ring-client-api/lib/rest-client.js

If you're new to vi, use the cursor arrow keys to navigate towards the end of line 22, type a then replace appApiBaseUrl = 'https://app.ring.com/api/v1/' with appApiBaseUrl = 'https://prd-api-us.prd.rings.solutions/api/v1/' then press esc followed by entering :wq and press enter to save.

  1. Log out of the container with ctrl + d
  2. Restart the container, preserving your changes with: docker restart $(docker ps | grep ring-mqtt | awk '{print $1}')

If you screw it up, just restart the ring-mqtt add-on from the Home Assistant GUI and it will revert the damage and go back to its original state.

from ring.

TepidAssassin avatar TepidAssassin commented on July 20, 2024 3

I am also experiencing the same issue after updating Homebridge today;

[18/06/2024, 19:08:04] [homebridge-ring] Request to https://app.ring.com/api/v1/clap/tickets?locationID=cc415c7-30c8-497f-b2c0-5bb94de8103d failed with status 500. Response body: {"error":860004,"msg":"No available app brokers"}
[18/06/2024, 19:08:04] [homebridge-ring] Error connecting to API
[18/06/2024, 19:08:04] [homebridge-ring] HTTPError: Response code 500 (Server Error)
at Request. (/var/lib/homebridge/node_modules/homebridge-ring/node_modules/got/dist/source/as-promise/index.js:118:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_NON_2XX_3XX_RESPONSE',
timings: {
start: 1718734084301,
socket: 1718734084303,
lookup: 1718734084316,
connect: 1718734084399,
secureConnect: 1718734084570,
upload: 1718734084571,
response: 1718734084713,
end: 1718734084713,
error: undefined,
abort: undefined,
phases: {
wait: 2,
dns: 13,
tcp: 83,
tls: 171,
request: 1,
firstByte: 142,
download: 0,
total: 412
}
}
}

from ring.

MystK avatar MystK commented on July 20, 2024 3

Based on the http error code, it seems to be a Ring server-side issue. I researched and saw that this endpoint helps establish a socket connection. Maybe it'll fix itself over time. This probably isn't an issue with homebridge-ring, especially since @Bro-Rocket12 mentioned his other location works.

from ring.

tsightler avatar tsightler commented on July 20, 2024 3

Folks, if you don't know how to edit files, then the manual solution is not for you, newbies will have to wait for an official fix, having everybody post here about how to edit files will just add confusion. I will be deleting messages asking for help editing files, Google can help you, or you can go and talk about it in the discussions groups, but this is not the place for that, this issue is about researching and solving the problem.

from ring.

t-flow-sash avatar t-flow-sash commented on July 20, 2024 2

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

from ring.

jamesonuk avatar jamesonuk commented on July 20, 2024 2

Just going to add that I did worry about the US in that domain name and wondered if this was US specific but just checking DNS logs I can see that app in UK is still connecting to prd-api-us.prd.rings.solutions so would appear to be a global thing

from ring.

rorygallagher2024 avatar rorygallagher2024 commented on July 20, 2024 2

Just in case it helps anyone, I am using the ring-mqtt docker image and was able to modify the URL as follow.

First I had to access the container's shell on my home assistant server:
docker exec -it ring-mqtt /bin/sh

Then I searched for the rest-client.js file and found it at this location
/app/ring-mqtt/node_modules/ring-client-api/lib/rest-client.js

So I used vi to modify the file
vi /app/ring-mqtt/node_modules/ring-client-api/lib/rest-client.js

and then proceeded to modify the appApiBaseUrl value to https://prd-api-us.prd.rings.solutions/api/v1/

from ring.

alessandroarosio1977 avatar alessandroarosio1977 commented on July 20, 2024 2

Is it possible to have a new version of component with URL fixed? I’m not confident to make manually this edit with Advanced SSH in my HAOS

from ring.

jimloki avatar jimloki commented on July 20, 2024 2

Everything is working again, with no modifications. I just restarted the addon in Home Assistant

from ring.

tsightler avatar tsightler commented on July 20, 2024 2

Yes, that is probably the easiest and has no negative side effects, setting a DNS alias for app.ring.com to resolve to prd-api-us.prd.rings.solutions is probably the easiest, using either /etc/hosts or perhaps DNS on your local router, etc.

from ring.

ElCastillo1353 avatar ElCastillo1353 commented on July 20, 2024 1

Same....

[6/18/2024, 1:33:17 PM] [Ring] Request to https://app.ring.com/api/v1/clap/tickets?locationID=baa71e2c-7986-44fa-744e-720cff98e320 failed with status 500. Response body: {"error":860004,"msg":"No available app brokers"}
[6/18/2024, 1:33:17 PM] [Ring] Error connecting to API
[6/18/2024, 1:33:17 PM] [Ring] HTTPError: Response code 500 (Server Error)
at Request. (/var/lib/homebridge/node_modules/homebridge-ring/node_modules/got/dist/source/as-promise/index.js:118:42)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_NON_2XX_3XX_RESPONSE',

from ring.

willliamchan avatar willliamchan commented on July 20, 2024 1

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Please, can you explain me how to do it? ( i don't know how to edit the node modules)

I am using ring-mqtt with docker and this is what I did.

  1. sudo docker exec -it ring-mqtt bash (this enter the console of the container
  2. cd ./app/ring-mqtt/node_modules/ring-client-api/lib
  3. vi rest-client.js

from ring.

t-flow-sash avatar t-flow-sash commented on July 20, 2024 1

Is it possible to have a new version of component with URL fixed? I’m not confident to make manually this edit with Advanced SSH in my HAOS

I am pretty sure that this will come soon once confirmed that this change really has no negative side effects. It is clearly just a workaround to do this manually as a re-pull of the container image will undo this change anyway every time.

from ring.

r1si avatar r1si commented on July 20, 2024 1

vi /app/ring-mqtt/mode_modules/ring-client-api/lib/rest-client.js

node_modules not mode_modules.
vi /app/ring-mqtt/node_modules/ring-client-api/lib/rest-client.js

from ring.

neildsb avatar neildsb commented on July 20, 2024 1

this worked - tsightler/ring-mqtt#861 (comment)

changing the volume only on the base station

from ring.

Tofusito avatar Tofusito commented on July 20, 2024 1

I made another workaround without changing the source code, I changed the /etc/hosts and added this line:

app.ring.com prd-api-us.prd.rings.solutions

Restarted the complement and all is working fine for me. Alarm, sensor, etc..

from ring.

tomiy1 avatar tomiy1 commented on July 20, 2024 1

which workaround is the "goto" atm? thank ya @tsightler !

this is an easy one:
I made another workaround without changing the source code, I changed the /etc/hosts and added this line:
app.ring.com prd-api-us.prd.rings.solutions

from ring.

MystK avatar MystK commented on July 20, 2024

started happening to me today or recently also. Didn't do any updates in the last few weeks.

Node.js Version | v20.14.0
homebridge-ring | v12.1.0

from ring.

SlasherKG avatar SlasherKG commented on July 20, 2024

Same error here.
No updates done recently.

Hopefully this can be fixed or is just temporary.

from ring.

Bro-Rocket12 avatar Bro-Rocket12 commented on July 20, 2024

Yeah it's definitely something sever side. Rolling back to previous version does not fix it unfortunately. Nor does setting it up as a child bridge. It is weird that my other location id works though, not sure why one works and the other does not. Hopefully whatever the issue is gets fixed soon.

from ring.

tsightler avatar tsightler commented on July 20, 2024

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Thanks for the confirmation, if someone out there happens to have a setup that uses modes, and can verify that the change doesn't break that, it would go a long way as I don't have an easy way to test this at the moment as I have an alarm at my location and I don't have any spare camera to setup a second site with no alarm.

from ring.

rorygallagher2024 avatar rorygallagher2024 commented on July 20, 2024

Hi, I made the change to update 'appApiBaseUrl' and it also worked for me. @tsightler - By modes, do you mean just switching my alarm to Home/Away modes, using the buttons as shown in the screenshot?

If so, that is working for me
Screenshot 2024-06-18 at 21 34 13

from ring.

t-flow-sash avatar t-flow-sash commented on July 20, 2024

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Please, can you explain me how to do it? ( i don't know how to edit the node modules)

I am using ring-mqtt in a docker container. Just jumped into the interactive shell of that container and followed the path given by @tsightler and did the change in line 22

from ring.

jacobhopkins117 avatar jacobhopkins117 commented on July 20, 2024

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Confirmed the change to appApiBaseUrl is working for me. Changing modes works as well.

from ring.

MystK avatar MystK commented on July 20, 2024

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Please, can you explain me how to do it? ( i don't know how to edit the node modules)

  1. Go to homebridge UI terminal: something like http://192.168.1.11:8581/platform-tools/terminal
  2. look for Plugin Path in the terminal. Mine is /var/lib/homebridge/node_modules
  3. type in nano {PLUGIN_PATH}/homebridge-ring/node_modules/ring-client-api/lib/rest-client.js. Mine looks like nano /var/lib/homebridge/node_modules/homebridge-ring/node_modules/ring-client-api/lib/rest-client.js
  4. Use your arrow keys to go down to line 22. It looks like:
}, clientApiBaseUrl = 'https://api.ring.com/clients_api/', deviceApiBaseUrl = 'https://api.ring.com/devices/v1/', commandsApiBaseUrl = 'https://api.ring.com/commands/v1/', appApiBaseUrl = 'https://app.ring.com/api/v1/', apiVersion = 11;
  1. Delete appApiBaseUrl = 'https://app.ring.com/api/v1/' and type in appApiBaseUrl = 'https://prd-api-us.prd.rings.solutions/api/v1/'
  2. CTRL+X to Exit
  3. Y to save
  4. ENTER to confirm
  5. Restart bomebridge-ring child process or main process and it look at logs to confirm it works

from ring.

tFC-Styles avatar tFC-Styles commented on July 20, 2024

Spent a fair while doing the usual troubleshooting on this before I came across this thread a few hours ago. And having seen the comments thought I’d leave.

Since all the traffic of you guys making changes etc, I figured I’d do a full server reboot. As it looks like a DNS change on ring’a end, rather than anything else. (Server OS reboot not just service/app)

This appears to have fixed the issue for me.

Using raspberry pi running homebridge OS

from ring.

tsightler avatar tsightler commented on July 20, 2024

Just going to add that I did worry about the US in that domain name and wondered if this was US specific but just checking DNS logs I can see that app in UK is still connecting to prd-api-us.prd.rings.solutions so would appear to be a global thing

Thanks, I had this concern too, but I scoured the app source code and could not find any other reference to a non-US URL so I suspected it was not a problem.

from ring.

ThaShadow00 avatar ThaShadow00 commented on July 20, 2024

Just manually did the change. All statuses of all devices are back, camera streams work and Alarm status change including PIN challenge work. Awesome!

Please, can you explain me how to do it? ( i don't know how to edit the node modules)

  1. Go to homebridge UI terminal: something like http://192.168.1.11:8581/platform-tools/terminal
  2. look for Plugin Path in the terminal. Mine is /var/lib/homebridge/node_modules
  3. type in nano {PLUGIN_PATH}/homebridge-ring/node_modules/ring-client-api/lib/rest-client.js. Mine looks like nano /var/lib/homebridge/node_modules/homebridge-ring/node_modules/ring-client-api/lib/rest-client.js
  4. Use your arrow keys to go down to line 22. It looks like:
}, clientApiBaseUrl = 'https://api.ring.com/clients_api/', deviceApiBaseUrl = 'https://api.ring.com/devices/v1/', commandsApiBaseUrl = 'https://api.ring.com/commands/v1/', appApiBaseUrl = 'https://app.ring.com/api/v1/', apiVersion = 11;
  1. Delete appApiBaseUrl = 'https://app.ring.com/api/v1/' and type in appApiBaseUrl = 'https://prd-api-us.prd.rings.solutions/api/v1/'
  2. CTRL+X to Exit
  3. Y to save
  4. ENTER to confirm
  5. Restart bomebridge-ring child process or main process and it look at logs to confirm it works

THANK YOU, it works

from ring.

r1si avatar r1si commented on July 20, 2024

Proposal:
But what if we set a url we, which automatically links to the correct API url?
That way in a situation with today's, we could globally change the url and the whole thing would be solved, without requiring a new plugin update

from ring.

tsightler avatar tsightler commented on July 20, 2024

Proposal: But what if we set a url we, which automatically links to the correct API url? That way in a situation with today's, we could globally change the url and the whole thing would be solved, without requiring a new plugin update

I appreciate the suggestion, but the Ring API is complex, it's not just a single URL, there are at least a dozen different URLs listed in the code, it makes zero sense to try to expose them all. Many times when they change the API itself also changes, what headers are needed, what authentication they use, etc.

from ring.

tsightler avatar tsightler commented on July 20, 2024

I made another workaround without changing the source code, I changed the /etc/hosts and added this line:

app.ring.com prd-api-us.prd.rings.solutions

Restarted the complement and all is working fine for me. Alarm, sensor, etc..

Good idea and nice workaround for the interim.

from ring.

nicks123 avatar nicks123 commented on July 20, 2024

If your running Pihole can change the CNAME record to redirect until a better solution is found

from ring.

Tofusito avatar Tofusito commented on July 20, 2024

Everything is working again, with no modifications. I just restarted the addon in Home Assistant

No change in the hosts file or in the code? Maybe ring recover the previous url?

from ring.

broyuken avatar broyuken commented on July 20, 2024

yep works for me again too, just restarted the addon and it's good again

from ring.

jimloki avatar jimloki commented on July 20, 2024

Everything is working again, with no modifications. I just restarted the addon in Home Assistant

No change in the hosts file or in the code? Maybe ring recover the previous url?

Yes, I think so

from ring.

Tofusito avatar Tofusito commented on July 20, 2024

Everything is working again, with no modifications. I just restarted the addon in Home Assistant

No change in the hosts file or in the code? Maybe ring recover the previous url?

Yes, I think so

Yup, I reverted my change, restarted the addon and it's working! No change in the code needed I guess

from ring.

qoodanny avatar qoodanny commented on July 20, 2024

Rollling Back To v 11.8.1 solve the issue

from ring.

tsightler avatar tsightler commented on July 20, 2024

Rollling Back To v 11.8.1 solve the issue

No it won't, it's just that the outage is over and Ring has corrected the issue.

from ring.

jimloki avatar jimloki commented on July 20, 2024

Here we go again! It does not work anymore... (without the modification)

from ring.

TNOTA avatar TNOTA commented on July 20, 2024

I did the modification to the file and everything works perfectly, in fact my Ring cameras come up instantly in HomeKit now.

BUT I tried going back to the pre modified rest-client.js file when others said it was working again, and I am still getting error 500.

So I went back again to the modified file and it all works. So this issue may not be cleared on Rings end of things.

from ring.

tsightler avatar tsightler commented on July 20, 2024

Yes, there have been several periods of time where it worked or didn't work throughout the day. I guess we'll see if it stabilizes and, if not, we'll have to push out an update.

from ring.

ahaverty avatar ahaverty commented on July 20, 2024

Just fyi for anyone else not back yet, I'm now getting a "Response code 503 (Service Unavailable)"

I'm in Ireland, so presumably Ring/DNS are slowly propogating a fix.

from ring.

tomiy1 avatar tomiy1 commented on July 20, 2024

I restarted HB plugin, disabled and re-enabled it... no go still here. Am i supposed to do something else? thanks in advance!

from ring.

tsightler avatar tsightler commented on July 20, 2024

There is nothing to do until Ring either fixes the issue, or we push out a new version to work around the problem, unless you are able to implement one of the workarounds already posted in this thread.

from ring.

tomiy1 avatar tomiy1 commented on July 20, 2024

/etc/hosts is easy enough, ill give that a shot! Thanks @tsightler

Update: Worked like a charm (for now) ... thanks again!

from ring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.