robbrad / UKBinCollectionData

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

Unable to load Data using v0.104.0 #914

Open Sergeant-Steve opened 5 days ago

Sergeant-Steve commented 5 days ago

Home Assistant Version

2024.10.3

Installation Method

Using HACS

Name of Council (if relevant)

Renfrewshire

Issue Information

Fresh install using the latest version (0.104.0, published 14/15 hours ago or so) does not load any information and shows errors in the logs:

Logger: homeassistant.helpers.entity_platform
Source: helpers/entity_platform.py:415
First occurred: 12:58:25 (4 occurrences)
Last logged: 13:41:18

uk_bin_collection raises exception ConfigEntryNotReady in forwarded platform sensor; Instead raise ConfigEntryNotReady before calling async_forward_entry_setups
This error originated from a custom integration.

Logger: custom_components.uk_bin_collection.sensor
Source: helpers/update_coordinator.py:354
integration: UK Bin Collection Data (documentation, issues)
First occurred: 12:58:25 (4 occurrences)
Last logged: 13:41:18

Unexpected error fetching xxxxxx data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/uk_bin_collection/sensor.py", line 172, 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 101, in run
    return self.client_code(
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 121, 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 61, in template_method
    bin_data_dict = self.get_and_parse_data(this_url, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 84, in get_and_parse_data
    bin_data_dict = self.parse_data("", url=address_url, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/councils/RenfrewshireCouncil.py", line 30, in parse_data
    driver = create_webdriver(web_driver, headless, None, __name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/common.py", line 325, in create_webdriver
    return webdriver.Chrome(
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
    super().__init__(
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 55, in __init__
    self.service.start()
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 101, in start
    self._start_process(self._path)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/common/service.py", line 211, in _start_process
    self.process = subprocess.Popen(
                   ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/root/.wdm/drivers/chromedriver/linux64/114.0.5735.90/chromedriver'

Running Home Assistant OS on a Raspberry Pi 4, I believe I followed the correct setup procedure, and didn't tick any boxes that weren't ticked by default, or enter any custom URL's for Selenium.

Verification

m26dvd commented 5 days ago

@Sergeant-Steve If you are setting up Renfrewshire Council, you will need to provide a URL for Selenium

https://github.com/robbrad/UKBinCollectionData/wiki/Councils#renfrewshire-council

Sergeant-Steve commented 5 days ago

I was under the impression that the "Run Selenium in Headless mode" tick box kinda did that for you, and that running your own Selenium Server instance was optional in case you already used it for something else.

So what you're saying is I need to run my own version of Selenium somewhere else other than in Home Assistant and input the URL & port under the "Remote selenium server" box?

m26dvd commented 5 days ago

@Sergeant-Steve There is multiple ways to run Selenium but essentially yeah.

Lots of examples here - https://github.com/robbrad/UKBinCollectionData?tab=readme-ov-file#selenium

Sergeant-Steve commented 5 days ago

So I've installed Selenium along with chromium & chromium-chromedriver packages via the AppDaemon Add-on in Home Assistant, but now I get the following:


Logger: custom_components.uk_bin_collection.sensor
Source: helpers/update_coordinator.py:354
integration: UK Bin Collection Data (documentation, issues)
First occurred: 19:39:56 (9 occurrences)
Last logged: 20:00:14

Unexpected error fetching xxxxxx data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/uk_bin_collection/sensor.py", line 172, 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 101, in run
    return self.client_code(
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 121, 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 61, in template_method
    bin_data_dict = self.get_and_parse_data(this_url, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 84, in get_and_parse_data
    bin_data_dict = self.parse_data("", url=address_url, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/councils/RenfrewshireCouncil.py", line 30, in parse_data
    driver = create_webdriver(web_driver, headless, None, __name__)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/common.py", line 323, in create_webdriver
    return webdriver.Remote(command_executor=web_driver, options=options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
    self.start_session(capabilities)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 193, in check_response
    raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: 405: Method Not Allowed

I set the remote Selenium Server to http://127.0.0.1:5050 which is the default port AppDaemon programs itself onto, and I even tried using http://localhost:5050/wd/hub with the same error message.

I'm not sure if this is a restriction in AppDaemon, or something else I've misconfigured somewhere.

s9550110 commented 22 hours ago

Same issue but for Dover District Council, was working fine and then last updated it stopped working. I've rolled back to v0.103 and it's working again.