mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
1.12k stars 670 forks source link

[Bug]: Detected blocking call to open with args #2985

Closed wwerther closed 3 weeks ago

wwerther commented 3 weeks ago

I Have A Problem With:

The integration in general

What's Your Problem

The integration worked but then suddenly started failing. Removing and reinstallation does not help. During configuraiton I get "unknown error" as reply on the frontend, so I tried to get something from the detailed logs. The log states that i should contact the author and open a ticket.

If there is something I can help with troubleshooting, plese let me know. It's sad that there is not more debug information in the protocols (at least I don't find it)

Source (if relevant)

No response

Logs

Detected blocking call to open with args (PosixPath('/config/custom_components/waste_collection_schedule/sources.json'),) inside the event loop by custom integration 'waste_collection_schedule' at custom_components/waste_collection_schedule/config_flow.py, line 331: with p.open(encoding="utf-8") as json_file: (offender: /config/custom_components/waste_collection_schedule/config_flow.py, line 331: with p.open(encoding="utf-8") as json_file:), please report it to the author of the 'waste_collection_schedule' custom integration For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open 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 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/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle return await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, 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 83, 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/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post return await self._post_impl(request, data) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl return await super()._post_impl(request, data) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl result = await self._flow_mgr.async_init( File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1287, in async_init flow, result = await self._async_init(flow_id, handler, context, data) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1312, in _async_init flow = await self.async_create_flow(handler, context=context, data=data) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1505, in async_create_flow flow = handler() File "/config/custom_components/waste_collection_schedule/config_flow.py", line 306, in __init__ self._sources = self._get_source_list() File "/config/custom_components/waste_collection_schedule/config_flow.py", line 331, in _get_source_list with p.open(encoding="utf-8") as json_file:

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

ReneNulschDE commented 3 weeks ago

Please share some more details:

wwerther commented 3 weeks ago

Hi, I tried to run the configuration for "Germany -> Erding (Awido_DE)" and it fails after I selected the provider. It is not possible to select the city exactly.

It might be connected to issue: #2987 or #2896 because I found this message now also in my logs. So perhaps you can merge the bugs.

Besides running WCS 2.4.0 I also already tried downgrading to 2.2.0 which did not work, so I upgraded again. According to what I've seen in the two other issues it might be related to the ICS-Calendar 5.0.4 ?

I'm running

OS Version: Home Assistant OS 13.1 Home Assistant Core: 2024.10.4

➜ ~ pip list
Package Version


awake 1.0 packaging 24.0 pathspec 0.12.1 pip 24.0 pulsemixer 1.5.1 pyparsing 3.1.2 PyYAML 6.0.2 setuptools 70.3.0 yamllint 1.35.1

Installed HACS 2.0.1

Mushroom v4.0.8

Local Tuya v5.2.2

Waste Collection Schedule 2.4.0

Scheduler Card v3.2.13

Scheduler component v3.3.7

Battery Notes 2.5.4

Spook 👻 Your homie v3.1.0

WallPanel v4.30.0

Proxmox VE 3.4.4

Solaredge Modbus V1.12.0

HA LCARS HA-LCARS-3.0.1

Garmin Connect 0.2.19

Deutscher Wetterdienst v2.1.21

ICS Calendar (iCalendar) 5.0.4

TrashCard 2.4.3

Meteoalarm Card v2.7.1

Portainer v1.0.2

DWD Pollenflug 1.0.3

ICS 20240420.01

SolarEdge Optimizers Data v1.2.4

wwerther commented 3 weeks ago

Finally found it: https://github.com/mampfes/hacs_waste_collection_schedule/issues/2893#issuecomment-2433200004 solved the issue. So you're instruction to downgrade Icalendar solved the problem.

Marco4223 commented 2 weeks ago

Not on my side. Still not able to install this anymore.

ReneNulschDE commented 2 weeks ago

@Marco4223 : Please share the same set of details...