core: Oncue Unexpected error fetching Data does not reconnect

The problem

This error has occurred ~6 times over the last 4 months. I had never been on a recent version of HASS until now.

Unexpected error fetching Oncue peterage data: Invalid username specified (1202)
5:25:00 AM – (ERROR) Oncue by Kohler - message first occurred at January 14, 2023, 9:41:00 PM and shows up 465 times 

When this occurs all of the generator data is marked unavailable (correct behavior) and the integration periodically retries the connection (correct behavior) but if never succeeds. In this example it was unavailable starting at 9:40pm. I waited until the following morning to see if it had reconnected, it did not. So I “reloaded” the integration and it immediately reconnected. I have had this same experience in the prior instances of this error, that it persists until the integration is reloaded or HA is restarted.

What version of Home Assistant Core has the issue?

2022.12.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Oncue

Link to integration documentation on our website

https://www.home-assistant.io/integrations/oncue/

Diagnostics information

Integration does not have diagnostics

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

2023-01-14 21:40:00.490 ERROR (MainThread) [homeassistant.components.oncue] Unexpected error fetching Oncue petesage data: Invalid username specified (1202)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data
return await self.update_method()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 162, in async_fetch_all
devices = await self.async_list_devices_with_params()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 198, in async_list_devices_with_params
return await self._get_authenticated(
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 144, in _get_authenticated
await self.async_login()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 156, in async_login
raise LoginFailedException(self._auth_invalid)
aiooncue.LoginFailedException: Invalid username specified (1202)
2023-01-14 21:40:00.718 ERROR (MainThread) [homeassistant.components.oncue] Unexpected error fetching Oncue petesage data: Invalid username specified (1202)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data
return await self.update_method()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 162, in async_fetch_all
devices = await self.async_list_devices_with_params()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 198, in async_list_devices_with_params
return await self._get_authenticated(
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 144, in _get_authenticated
await self.async_login()
File "/usr/local/lib/python3.10/site-packages/aiooncue/__init__.py", line 156, in async_login
raise LoginFailedException(self._auth_invalid)
aiooncue.LoginFailedException: Invalid username specified (1202)

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 23 (16 by maintainers)

Commits related to this issue

Most upvoted comments

The goal in the lib was to detect a login failure and throw so they can fix the password

https://github.com/bdraco/aiooncue/blob/0025ce5f1484b3e7667edcb9b44d71a83fa28ebc/aiooncue/__init__.py#L140

It probably needs to be adjusted to handle transient failures on the api side

Thanks for the update. This is on my list, just behind a couple of things. If it happens again, try reloading the integration from the config panel. Be good to see if that solves it.

FWIW, I just had this happen again overnight. With a HA restart, all was ok. (HA Core 2023.5.2)

The logic that after an authentication error, the next attempt should have no state from before, is compelling. I think it’s reasonable to make that change without a test - perhaps that’s what you are saying.

I have a test up and running with prototype code to determine if closing the session really fixes the problem. Now its a waiting game.