Open dangel666 opened 2 months ago
Hey there @geoffreylagaisse, @finder39, mind taking a look at this issue as it has been labeled with an integration (qbittorrent
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
qbittorrent documentation qbittorrent source (message by IssueLinks)
I have the same issues.
2024.7.3 still has the same problems.
Maybe this is fixed by https://github.com/home-assistant/core/pull/122848?
Still broken in 2024.8.3. I attempted to remove and re-add the qbit integration and HA throws an error when clicking "Delete".
ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component comp = await self.hass.async_add_import_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/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 "/usr/src/homeassistant/homeassistant/components/qbittorrent/init.py", line 30, in from .coordinator import QBittorrentDataCoordinator File "/usr/src/homeassistant/homeassistant/components/qbittorrent/coordinator.py", line 16, in from qbittorrentapi.torrents import TorrentStatusesT ImportError: cannot import name 'TorrentStatusesT' from 'qbittorrentapi.torrents' (/usr/local/lib/python3.12/site-packages/qbittorrentapi/torrents.py). Did you mean: 'TorrentStates'? During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 462, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 537, in _handle resp = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, 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 210, 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/config/config_entries.py", line 95, in delete result = await hass.config_entries.async_remove(entry_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1762, in async_remove await entry.async_remove(self.hass) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 868, in async_remove component = await integration.async_get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component self._component_future.result() File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component comp = self._get_component() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 "/usr/src/homeassistant/homeassistant/components/qbittorrent/init.py", line 30, in from .coordinator import QBittorrentDataCoordinator File "/usr/src/homeassistant/homeassistant/components/qbittorrent/coordinator.py", line 16, in from qbittorrentapi.torrents import TorrentStatusesT ImportError: cannot import name 'TorrentStatusesT' from 'qbittorrentapi.torrents' (/usr/local/lib/python3.12/site-packages/qbittorrentapi/torrents.py). Did you mean: 'TorrentStates'?
The problem
Logger: homeassistant Source: components/qbittorrent/sensor.py:181 First occurred: 07:51:47 (6 occurrences) Last logged: 07:54:17
Error doing job: Task exception was never retrieved (None) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 255, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 411, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 165, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 491, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state state, attr, capabilities, shadowed_attr = self.async_calculate_state() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1068, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 533, in state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/qbittorrent/sensor.py", line 170, in native_value return self.entity_description.value_fn(self.coordinator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/qbittorrent/sensor.py", line 101, in
value_fn=lambda coordinator: count_torrents_in_states(coordinator, []),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/qbittorrent/sensor.py", line 181, in count_torrents_in_states
return len(torrents)
^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
What version of Home Assistant Core has the issue?
core-2024.7.1
What was the last working version of Home Assistant Core?
core-2024.6.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
qbittorrent
Link to integration documentation on our website
https://www.home-assistant.io/integrations/qbittorrent/
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
I first tried 2024.7 and reverted due to this - the sensor went missing which I thought was odd and hence I looked (better) when trying 2024.7.1 and found this in the logs on boot.