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

Google Integration: Blocking Call for import_module (tzdata.zoneinfo) #121868

Closed
thickconfusion opened this issue Jul 12, 2024 · 6 comments · Fixed by #127049
Closed

Google Integration: Blocking Call for import_module (tzdata.zoneinfo) #121868

thickconfusion opened this issue Jul 12, 2024 · 6 comments · Fixed by #127049

Comments

@thickconfusion
Copy link

The problem

Detected blocking call to import_module with args ('tzdata.zoneinfo',) inside the event loop by integration 'google' at homeassistant/components/google/coordinator.py, line 75: timeline = await self.sync.store_service.async_get_timeline( (offender: /usr/local/lib/python3.12/importlib/resources/_common.py, line 82: return importlib.import_module(cand)),

What version of Home Assistant Core has the issue?

2024.7.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-07-12 11:55:18.837 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with a                      rgs ('tzdata.zoneinfo',) inside the event loop by integration 'google' at homeassistant/components/google/coordinator                      .py, line 75: timeline = await self.sync.store_service.async_get_timeline( (offender: /usr/local/lib/python3.12/impor                      tlib/resources/_common.py, line 82: return importlib.import_module(cand)), please create a bug report at https://gith                      ub.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+google%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.12/site-packages/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.12/site-packages/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/local/lib/python3.12/site-packages/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 288, in async_refr                      esh
    await self._async_refresh(log_failures=True)
  File "/usr/local/lib/python3.12/site-packages/homeassistant/helpers/update_coordinator.py", line 312, in _async_ref                      resh
    self.data = await self._async_update_data()
  File "/usr/local/lib/python3.12/site-packages/homeassistant/components/google/coordinator.py", line 75, in _async_u                      pdate_data
    timeline = await self.sync.store_service.async_get_timeline(

Additional information

No response

@home-assistant
Copy link

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (google) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of google can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign google Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


google documentation
google source
(message by IssueLinks)

@BobC76
Copy link

BobC76 commented Aug 27, 2024

+1 seeing same here, as with another integration pod_point.

@allenporter
Copy link
Contributor

@BobC76 different integration reports for this are not related.

I believe this is now fixed in google calendar as of #120888 though if folks still see this in google calendar in recent versions of home assistant then we can reopen.

@networkerict
Copy link

Still seeing the same error messages:

Version | core-2024.9.1

Logger: homeassistant.util.loop
Source: util/loop.py:136
First occurred: 12:27:05 (2 occurrences)
Last logged: 12:27:05

Detected blocking call to import_module with args ('tzdata.zoneinfo',) inside the event loop by integration 'google' at homeassistant/components/google/coordinator.py, line 75: timeline = await self.sync.store_service.async_get_timeline( (offender: /usr/local/lib/python3.12/importlib/resources/_common.py, line 82: return importlib.import_module(cand)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+google%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in async_refresh await self._async_refresh(log_failures=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/google/coordinator.py", line 75, in _async_update_data timeline = await self.sync.store_service.async_get_timeline(
Detected blocking call to open with args (PosixPath('/usr/local/lib/python3.12/site-packages/tzdata/zoneinfo/GMT+02:00'), 'rb') inside the event loop by integration 'google' at homeassistant/components/google/coordinator.py, line 75: timeline = await self.sync.store_service.async_get_timeline( (offender: /usr/local/lib/python3.12/zoneinfo/_common.py, line 12: return resources.files(package_name).joinpath(resource_name).open("rb")), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+google%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in async_refresh await self._async_refresh(log_failures=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/components/google/coordinator.py", line 75, in _async_update_data timeline = await self.sync.store_service.async_get_timeline(

@tube0013
Copy link
Contributor

seeing this as well with 2024.9.1

@allenporter
Copy link
Contributor

allenporter commented Sep 15, 2024

Thanks for the reports. I haven't been able to track down the source yet. The library preloads all timezones but here the system is set with a timezone that is invalid "GMT+02:00" so it doesn't work. It's clearly in the ical/tzif package e.g. https://github.com/allenporter/ical/blob/8412b69146777c6448a338ed8b709a904e3d4b5c/ical/tzif/timezoneinfo.py#L36 but thats burried pretty deep in the code.

@allenporter allenporter reopened this Sep 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants