Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent "Cannot talk to OWM API, check API key" Crashes Smart irrigation #514

Open
2 tasks done
lexo12345 opened this issue Jan 5, 2025 · 5 comments
Open
2 tasks done
Assignees
Labels
bug Something isn't working do-not-auto-close Label to make sure it's not auto closed by stale bot

Comments

@lexo12345
Copy link

Did you read the docs?

  • I read the docs and my question is not answered there.

What happened?

Smart irrigation stops working intermittently, Seems to coincide with an intermittent issue polling for weather data

How to reproduce

See line 4904 onwards, bug occurs at 6:00 exactly
config_entry-smart_irrigation-01JDS9SCMXANBX9NMV7M4GBAV9 (4).json
home-assistant (2).log

image

Once this bug has occured the Smart irrigation side pane is blank;
image

Restarting home assistant gets everything back up & running again until the bug re-occurs.

Relevant log output

2025-01-05 05:59:50.501 WARNING (SyncWorker_26) [custom_components.smart_irrigation.weathermodules.OWMClient] Cannot talk to OWM API, check API key.
2025-01-05 05:59:50.503 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/smart_irrigation/__init__.py", line 786, in _async_update_all
    weatherdata = await self.hass.async_add_executor_job(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 328, in get_data
    raise ex
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 236, in get_data
    raise IOError("Cannot talk to OWM API, check API key.")
OSError: Cannot talk to OWM API, check API key.
2025-01-05 06:00:00.899 WARNING (SyncWorker_14) [custom_components.smart_irrigation.weathermodules.OWMClient] Cannot talk to OWM API, check API key.
2025-01-05 06:00:00.902 ERROR (MainThread) [homeassistant.components.automation.calculate_retic] Calculate retic: Error executing script. Unexpected error for call_service at pos 2: Cannot talk to OWM API, check API key.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/__init__.py", line 2029, in handle_update_all_zones
    await self._async_update_all()
  File "/config/custom_components/smart_irrigation/__init__.py", line 786, in _async_update_all
    weatherdata = await self.hass.async_add_executor_job(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 328, in get_data
    raise ex
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 236, in get_data
    raise IOError("Cannot talk to OWM API, check API key.")
OSError: Cannot talk to OWM API, check API key.
2025-01-05 06:00:00.911 ERROR (MainThread) [homeassistant.components.automation.calculate_retic] While executing automation automation.calculate_retic
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 743, in async_trigger
    return await self.action_script.async_run(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
    return await asyncio.shield(create_eager_task(run.async_run()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
    return await long_task
           ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/__init__.py", line 2029, in handle_update_all_zones
    await self._async_update_all()
  File "/config/custom_components/smart_irrigation/__init__.py", line 786, in _async_update_all
    weatherdata = await self.hass.async_add_executor_job(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 328, in get_data
    raise ex
  File "/config/custom_components/smart_irrigation/weathermodules/OWMClient.py", line 236, in get_data
    raise IOError("Cannot talk to OWM API, check API key.")
OSError: Cannot talk to OWM API, check API key.

Which version are you running?

v2024.10.3

Diagnostics file

  • I have attached a diagnostics file

Additional information

No response

@lexo12345 lexo12345 added the bug Something isn't working label Jan 5, 2025
@jeroenterheerdt
Copy link
Owner

Interesting. Can you check the OWM api page to check you have not maxed out the requests?

@jajberni
Copy link

jajberni commented Jan 9, 2025

I am having a similar problem with a fresh install. The API key is not accepted, even if I am not using any requests. Tried to create a new API key without success.

@jeroenterheerdt
Copy link
Owner

@jajberni wait a couple of hours, as the docs say...

@lexo12345
Copy link
Author

Interesting. Can you check the OWM api page to check you have not maxed out the requests?

This was the case.

Is it all possible for this to be a notification when this occurs?

@jeroenterheerdt
Copy link
Owner

It's impossible to detect this case in software. But I can change the error message and update the docs.

@jeroenterheerdt jeroenterheerdt added the do-not-auto-close Label to make sure it's not auto closed by stale bot label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working do-not-auto-close Label to make sure it's not auto closed by stale bot
Projects
None yet
Development

No branches or pull requests

3 participants