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

Detected blocking call to open inside the event loop #139

Open
Justin991q opened this issue Jun 20, 2024 · 4 comments
Open

Detected blocking call to open inside the event loop #139

Justin991q opened this issue Jun 20, 2024 · 4 comments

Comments

@Justin991q
Copy link

I am getting a lot of errors about a blocking loop event, which is spamming the Home-Assistant logs with a lot of log entries.
I am Home-Assistant 2024.6.3 and ICS Calendar version 4.2.0.

https://github.com/franc6/ics_calendar/blob/4.2.0/custom_components/ics_calendar/parsers/parser_rie.py#L32

2024-06-20 09:59:25.985 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'ics_calendar' at custom_components/ics_calendar/parsers/parser_rie.py, line 32: self._calendar = Calendar.from_ical(content) (offender: /usr/local/lib/python3.12/site-packages/pytz/__init__.py, line 108: return open(filename, 'rb')), please create a bug report at https://github.com/franc6/ics_calendar/issues
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/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    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 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 672, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 660, in get
    calendar_event_list = await entity.async_get_events(
  File "/config/custom_components/ics_calendar/calendar.py", line 173, in async_get_events
    return await self.data.async_get_events(hass, start_date, end_date)
  File "/config/custom_components/ics_calendar/calendar.py", line 264, in async_get_events
    self.parser.set_content(self._calendar_data.get())
  File "/config/custom_components/ics_calendar/parsers/parser_rie.py", line 32, in set_content
    self._calendar = Calendar.from_ical(content)
@franc6
Copy link
Owner

franc6 commented Jun 20, 2024

Thanks for the report. I’ll have to see if there’s a way around how pytz is used or if there’s a better solution.

@latetedemelon
Copy link

@franc6 - I came here to report the same. Please let me know if I can assist with info, logs, testing etc.

@franc6
Copy link
Owner

franc6 commented Sep 11, 2024

Fixed in 5.0.1

@franc6 franc6 closed this as completed Sep 11, 2024
@franc6
Copy link
Owner

franc6 commented Sep 11, 2024

Oops, wrong issue... It might be fixed, but hasn't been confirmed.

@franc6 franc6 reopened this Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants