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

[Bug]: Version 2.4.0 broken (No module named 'icalendar.windows_to_olson') #2987

Open
7 tasks done
BoGnY opened this issue Nov 4, 2024 · 16 comments
Open
7 tasks done

Comments

@BoGnY
Copy link

BoGnY commented Nov 4, 2024

I Have A Problem With:

The integration in general

What's Your Problem

The version 2.4.0 which try to fix icalendar v6 error get "No module named 'icalendar.windows_to_olson'"

Version 2.3.0 with ics calendar 5.0.3 (not 5.0.4) works without problem.

Not tested 'master' because there isn't master selectable:
image

Source (if relevant)

contarina_it

Logs

error loading source ics: No module named 'icalendar.windows_to_olson' Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 217, in create source_module: SourceModule = importlib.import_module( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 15, in <module> from waste_collection_schedule.service.ICS import ICS File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 7, in <module> from icalevents import icalevents File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 3, in <module> from .icalparser import parse_events, Event File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 18, in <module> from icalendar.windows_to_olson import WINDOWS_TO_OLSON ModuleNotFoundError: No module named 'icalendar.windows_to_olson'

Relevant Configuration

waste_collection_schedule:
  sources:
    - name: ics
      args:
        regex: '.*: (.*)'
        split_at: ', '
        url: https://contarina.it/ajax/moduli/appbugfixapi/genera_ics_calendari?id_zona=19
      customize:
        - type: Carta
          icon: mdi:package-variant
        - type: Secco
          icon: mdi:dump-truck
        - type: Umido
          icon: mdi:compost
        - type: Vegetale
          icon: mdi:leaf
        - type: Vpl
          icon: mdi:bottle-wine

Checklist Source Error

  • Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • Checked that the website of your service provider is still working
  • Tested my attributes on the service provider website (if possible)
  • I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@ReneNulschDE
Copy link
Contributor

Did you installed ics_calendar 5.0.4 after the update?

@BoGnY
Copy link
Author

BoGnY commented Nov 4, 2024

Many installation.. Tried all combinations...

Started with iCalendar 5.0.3 and WCS 2.3.0 and in this order:
Updated iCalendar to 5.0.4: broken
Downgraded iCalendar to 5.0.3 as suggested in other issue: work again
Updated iCalendar to 5.0.4 and WCS to 2.4.0: broken
Downgraded iCalendar to 5.0.3: broken
Downgraded WCS to 2.3.0: broken

Every step with reboot.

Now with iCalendar 5.0.3 and WCS 2.3.0 is not working 😅 (source ics not found)..

I have HAOS on raspberry..
Tomorrow I try to uninstall all, rebooting and reinstalling iCalendar 5.0.3 and WCS 2.3.0 until fix

@Marco4223
Copy link

Same problem here. WCS is no longer working. I removed it and reinstalled it. Eve3ry time I try to configure/add this as device I can start configuring and can select Germany, that selcting AWSH and get an 'UNKOWN ERROR'
In the logs I get this:

2024-11-07 17:49:41.089 WARNING (MainThread) [homeassistant.util.loop] 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 "", 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/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 556, in start task = asyncio.Task(coro, loop=loop, eager_start=True) 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 86, 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 1301, in async_init flow, result = await self._async_init(flow_id, handler, context, data) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1326, in _async_init flow = await self.async_create_flow(handler, context=context, data=data) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1524, 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: 2024-11-07 17:50:08.192 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): 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 86, 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/config/config_entries.py", line 222, in post return await super().post(request, flow_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/helpers/data_entry_flow.py", line 122, in post result = await self._flow_mgr.async_configure(flow_id, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in async_configure result = await self._async_configure(flow_id, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 414, in _async_configure result = await self._async_handle_step( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/config_flow.py", line 406, in async_step_source return await self.async_step_args() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/config_flow.py", line 683, in async_step_args schema, module = await self.__get_arg_schema( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/config_flow.py", line 485, in __get_arg_schema module = 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 "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/awsh_de.py", line 9, in from waste_collection_schedule.service.ICS import ICS File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 7, in from icalevents import icalevents File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 3, in from .icalparser import parse_events, Event File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 18, in from icalendar.windows_to_olson import WINDOWS_TO_OLSON ModuleNotFoundError: No module named 'icalendar.windows_to_olson'

@ReneNulschDE
Copy link
Contributor

ReneNulschDE commented Nov 7, 2024

In every case I've encountered, this solution resolved the issue. If it doesn’t work for you, please provide as many details about your environment as possible.

@BoGnY
Copy link
Author

BoGnY commented Nov 8, 2024

Yes, your suggestion solves the issue.
But I currently have installed 2.3.0, I haven't try updating WCS to 2.4.0 yet.

@Marco4223
Copy link

In every case I've encountered, this solution resolved the issue. If it doesn’t work for you, please provide as many details about your environment as possible.

You are right. Many thanks.
Yes this fixed the issue.

@ohhfem
Copy link

ohhfem commented Nov 17, 2024

I have an issue too. I can't try the solution provided by ReneNulschDE because I don't have HA as a docker container but I have HAOS installed in a VM. When I try to configure the component, I select Italy, then Contarina and it says "Unknown Error Occured".
I'm trying with version 2.4.0, ics Calendar version 5.0.4, HAOS version 2024.11.2

@ReneNulschDE
Copy link
Contributor

Please describe you're HAOS install method and environment in detail. In case you used this one - then you can use the same approach. the docker containers running inside your virtual machine. (I have HAOS running in a VM on a Synology box and created the orignal solution in that environment.)

@ohhfem
Copy link

ohhfem commented Nov 17, 2024 via email

@ohhfem
Copy link

ohhfem commented Nov 17, 2024

Ok I was using another terminal add-on that doesn't work. Now I'm able to run the commands, but here are my version when I recall pip list | grep ical:
ical 8.2.0
icalendar 6.0.1
icalevents 0.1.29
recurring-ical-events 3.3.3

@ReneNulschDE
Copy link
Contributor

Thx, could you share the list of custom_components too?

@ohhfem
Copy link

ohhfem commented Nov 17, 2024

You mean all my custom components installed via hacs? Sorry for the dumb questions

@ReneNulschDE
Copy link
Contributor

All custom_components that you have installed - I want to check, if a component is using icalendar (or lib that is used by the CC is using icalendar)

@ohhfem
Copy link

ohhfem commented Nov 17, 2024

Screenshot_20241117-194646.png

Screenshot_20241117-194727.png

@ReneNulschDE
Copy link
Contributor

Looks like we have to adjust step 5 of the initial solution in your environment.

New:
5. Uninstall the libs with pip uninstall icalendar icalevents recurring-ical-events (icalevents needs to be uninstalled to make sure that we get the right version on restart)

Rest is the same. I have not tested it but it should not destroy your system :-)

You can delete the image-posts. Not needed anymore - will improve readability...

@ohhfem
Copy link

ohhfem commented Nov 17, 2024

Ok now it works, but maybe it's better to not update ICS calendar right? Thx in advance man

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

4 participants