Ring: Error: 401 Client Error: Unauthorized for url

Hi all–I tried incorporating the fix as both a custom_component and by overwriting ring_doorbell at /usr/local/lib/python3.7/ring_doorbell (I am running hass in docker on a nuc) but I still get the same 401 error. I deleted my .ring_cache.pickle file and updated my password and can log in via the ring app and ring website. The weird thing is the pickle file never gets re-created after restarting the docker container. But when I ‘touch .ring_cache.pickle’ and restart, it gets updated.

Update: I had quotes around my ring password in secrets.yaml and removed them to work.

I do not mind to try that manual update that was suggested in github. The problem is that I cannot get to /srv/. I do not have it when I installed Samba from Hass store.

What can I do?

Updated the manifest.json for the ring component in my homeassistant install from 0.2.3 to 0.2.5 and we’re good.

If anyone is interested, it’s in /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/ring/ or similar directory on a venv install.

1 Like

103.3 brought all my ring entities back. Thanks for the quick work.

2 Likes

@Mike_D Have you done anything else aside from upgrading to 103.3? Because my hass.io still shows the same errors on Ring…

works for me too since updating… i did also change my password whilst troubleshooting though

I changed my password in the ring app before upgrading, actually unrelated to this issue, i did it because of all the breach press lately. Figured best to change it just in case. Maybe it unknowingly helped in the fix. But as far as hassio goes, no other changes, just the upgrade.

1 Like

Can two step verification be used? or does this stop it from working in Hassio?

Currently 2FA cannot be used.

It worked before 103. So the problem is not fully fixed yet… Apparently that is why it doesn’t work for me under 103.3…
(on a side note - everybody should use 2FA when ever possible, check this just from this month…)

Just updated to latest HA version 0.103.4 and my log is being spammed with:

2019-12-24 00:14:09 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.ring_front_door_motion fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ring/binary_sensor.py", line 116, in update
    self._data.check_alerts()
  File "/usr/local/lib/python3.7/site-packages/ring_doorbell/doorbot.py", line 82, in check_alerts
    self.update()
  File "/usr/local/lib/python3.7/site-packages/ring_doorbell/generic.py", line 54, in update
    self._get_attrs()
  File "/usr/local/lib/python3.7/site-packages/ring_doorbell/generic.py", line 86, in _get_attrs
    lst = self._ring.query(url).get(self.family)
  File "/usr/local/lib/python3.7/site-packages/ring_doorbell/__init__.py", line 224, in query
    self._authenticate()
  File "/usr/local/lib/python3.7/site-packages/ring_doorbell/__init__.py", line 162, in _authenticate
    req.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.ring.com/clients_api/session

I did add the custom_components/ring in the previous version to fix the 401/403 errors, has the built in integration been fixed? Maybe this can be removed now?

Nope still broken :frowning:
Tried with custom_component and without.
Also changed password while I was at it.
Anyone got it working on 0.103.4?

1 Like

103.3 fixed it for most…until today…when it broke again. I’m wondering if Ring is actively breaking non-sanctioned integrations and turning this int a cat and mouse game.

Its failing for me running 0.103.4

I just posted a workaround that I applied to my local HA: https://github.com/tchellomello/python-ring-doorbell/issues/146#issuecomment-568645501

Failing for me on 0.103.4, I had 2FA on, I turned it off and verified it’s off. I also rebooted

2019-12-23 20:27:41 ERROR (SyncWorker_5) [homeassistant.components.ring] Unable to connect to Ring service: 401 Client Error: Unauthorized for url: https://api.ring.com/clients_api/session
2019-12-23 20:27:41 ERROR (MainThread) [homeassistant.setup] Setup failed for ring: Integration failed to initialize.
2019-12-23 20:27:42 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ring.binary_sensor: Unable to set up component.
2019-12-23 20:27:42 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ring.camera: Unable to set up component.
2019-12-23 20:28:01 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform ring.sensor: Unable to set up component.

Cheers, worked for me

Same here, was fine for last 2 days but came back. Slightly different this time last time was 403 client error, this time 401 client error.

@tekmaven’s URL fix did the trick for me too :slight_smile:

1 Like