mampfes / hacs_waste_collection_schedule

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

[Bug]: Yarra Ranges Council Error #2974

Closed Huskywatch closed 2 weeks ago

Huskywatch commented 2 weeks ago

I Have A Problem With:

A specific source

What's Your Problem

Recently I started not getting data, and when I tried to re-configure the plugin I am getting this error:

The source returned an invalid response: "'NoneType' object has no attribute 'strip'". Please check the provided arguments and try again.

Source (if relevant)

yarra_ranges_vic_gov_au

Logs

This error originated from a custom integration.

Logger: custom_components.waste_collection_schedule.waste_collection_schedule.source_shell
Source: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:160
integration: Waste Collection Schedule (documentation)
First occurred: 4:37:04 PM (1 occurrences)
Last logged: 4:37:04 PM

fetch failed for source Yarra Ranges Council: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 158, in fetch entries: Iterable[Collection] = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/yarra_ranges_vic_gov_au.py", line 79, in fetch next_pickup = article.find(class_="next-service").string.strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strip'

----------------------------------------------------------------------------------------------------------
Logger: homeassistant.util.loop
Source: util/loop.py:136
First occurred: 4:37:04 PM (2 occurrences)
Last logged: 9:10:40 PM

Detected blocking call to load_default_certs with args (<ssl.SSLContext object at 0x7f3e2b205e50>, <Purpose.SERVER_AUTH: _ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')>) inside the event loop by integration 'daikin' at homeassistant/components/daikin/__init__.py, line 46: device: Appliance = await DaikinFactory( (offender: /usr/local/lib/python3.12/ssl.py, line 713: context.load_default_certs(purpose)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+daikin%22 For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#load_default_certs 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/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in _async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in <genexpr> create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 742, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/daikin/__init__.py", line 46, in async_setup_entry device: Appliance = await DaikinFactory(
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 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 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

waste_collection_schedule:
  sources:
    - name: yarra_ranges_vic_gov_au
      args:
        street_address: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Checklist Source Error

Checklist Sensor Error

Required

Huskywatch commented 2 weeks ago

I suspect that Yarra Ranges may have changed something about their API url....??..

ReneNulschDE commented 2 weeks ago

I have created a PR to fix this. However you have to double check the address information. Looks like the address structure has changed. Example old: 316 Maroondah Hwy, Healesville VIC 3777 new: 316 Maroondah Highway Healesville 3777 or old: 447-449 Maroondah Hwy, Lilydale VIC 3140 new: 5/447-449 Maroondah Highway Lilydale 3140

Huskywatch commented 2 weeks ago

I checked that and I am using the “new” format (it has been that format for a while now, and it was working fine up until last week)

On 4 Nov 2024, at 5:11 am, Rene Nulsch @.***> wrote:



I have created a PR to fix this. However you have to double check the address information. Looks like the address structure has changed. Example old: 316 Maroondah Hwy, Healesville VIC 3777 new: 316 Maroondah Highway Healesville 3777 or old: 447-449 Maroondah Hwy, Lilydale VIC 3140 new: 5/447-449 Maroondah Highway Lilydale 3140

— Reply to this email directly, view it on GitHubhttps://github.com/mampfes/hacs_waste_collection_schedule/issues/2974#issuecomment-2453516137, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALWWNBNY57A547NF6XQM3F3Z6ZRMFAVCNFSM6AAAAABRCTGWK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGUYTMMJTG4. You are receiving this because you authored the thread.Message ID: @.***>

Kind Regards,

Jamie Myers

5ila5 commented 2 weeks ago

fixed by #2978

This will be part of the next release or is available now as master (git) version

install master/git: Developer tools -> actions -> select update: Install update -> click Coose entity and select WCS -> select version and type master in the input field -> run the action -> restart HA

Older versions of HACS:

install master with HACS version < 2.0: (3-dot menu -> redownload -> change version to master -> fully restart HA (this will increase update cycle by a lot)