robbrad / UKBinCollectionData

UK Council Bin Collection Data Parser Outputting Bin Data as a JSON
MIT License
114 stars 75 forks source link

Not sure if this is council or integration issue - "No connection adapters were found" #626

Open danmiles86 opened 5 months ago

danmiles86 commented 5 months ago

Name of Council

Newark & Sherwood

Issue Information

Just setting up a new integration on 0.61.1 for Newark & Sherwood, example PID (not my own) http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994' & get the below output.

Any help really appriciated.

2024-03-01 00:27:30.847 INFO (MainThread) [custom_components.uk_bin_collection] [UKBinCollection] Data Supplied: {'url': 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994', 'name': 'Main Street', 'council': 'NewarkAndSherwoodDC'} 2024-03-01 00:27:30.848 INFO (MainThread) [custom_components.uk_bin_collection] [UKBinCollection] Setting up UK Bin Collection Data for council: NewarkAndSherwoodDC 2024-03-01 00:27:30.848 INFO (MainThread) [custom_components.uk_bin_collection] [UKBinCollection] Config entry data: {'url': 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994', 'name': 'Main Street', 'council': 'NewarkAndSherwoodDC'} 2024-03-01 00:27:30.849 INFO (MainThread) [custom_components.uk_bin_collection] [UKBinCollection] Successfully set up UK Bin Collection Data for council: NewarkAndSherwoodDC 2024-03-01 00:27:30.856 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] Setting up UK Bin Collection Data platform. 2024-03-01 00:27:30.858 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] Data Supplied: {'url': 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994', 'name': 'Main Street', 'council': 'NewarkAndSherwoodDC'} 2024-03-01 00:27:30.858 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] UKBinCollectionApp args: ['NewarkAndSherwoodDC', 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994'] 2024-03-01 00:27:30.860 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] Args set 2024-03-01 00:27:30.860 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] UKBinCollectionApp Init 2024-03-01 00:27:30.860 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] UKBinCollectionApp Init Refresh 2024-03-01 00:27:30.860 INFO (MainThread) [custom_components.uk_bin_collection.sensor] [UKBinCollection] UKBinCollectionApp Updating 2024-03-01 00:27:30.863 ERROR (SyncWorker_57) [uk_bin_collection.uk_bin_collection.get_bin_data] Oops: Something Else No connection adapters were found for 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994' 2024-03-01 00:27:30.864 DEBUG (MainThread) [custom_components.uk_bin_collection.sensor] Finished fetching Main Street data in 0.004 seconds (success: False) 2024-03-01 00:27:30.864 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up uk_bin_collection platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/uk_bin_collection/sensor.py", line 133, in _async_update_data data = await self.hass.async_add_executor_job(self.ukbcd.run) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 96, in run return self.client_code( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 115, in client_code return get_bin_data_class.template_method(address_url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 65, in template_method page = self.get_data(address_url) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 122, in get_data full_page = requests.get(url, headers, verify=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 73, in get return request("get", url, params=params, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/api.py", line 59, in request return session.request(method=method, url=url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 697, in send adapter = self.get_adapter(url=request.url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 794, in get_adapter raise InvalidSchema(f"No connection adapters were found for {url!r}") requests.exceptions.InvalidSchema: No connection adapters were found for 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 344, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/uk_bin_collection/sensor.py", line 75, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 285, in async_config_entry_first_refresh raise ex homeassistant.exceptions.ConfigEntryNotReady: No connection adapters were found for 'python collect_data.py NewarkAndSherwoodDC http://app.newark-sherwooddc.gov.uk/bincollection/calendar?pid=100031449994'

Verification

robbrad commented 1 week ago

Worked ok for me with the same UPRN.

What did you enter in the input field? Can you try again?

image

ps. Its BIN DAY !!!