home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.2k stars 30.22k forks source link

Attribute error related to 'timeleft' is not present in the 'LidarrQueueItem' object #91052

Closed uberoptix closed 1 year ago

uberoptix commented 1 year ago

The problem

It looks like there's an attribute error in the Lidarr sensor component related to timeleft. The attribute timeleft is not present in the LidarrQueueItem object. Enviroment & error log below.

Home Assistant 2023.4.1 Supervisor 2023.04.0 Operating System 9.5 Frontend 20230406.1 - latest

Logger: homeassistant Source: components/lidarr/sensor.py:158 First occurred: 1:21:01 PM (1 occurrences) Last logged: 1:21:01 PM

Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 193, in _handle_refresh_interval await self._async_refresh(log_failures=True, scheduled=True) File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 341, in _async_refresh self.async_update_listeners() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 142, in async_update_listeners update_callback() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 401, in _handle_coordinator_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 568, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 635, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/usr/src/homeassistant/homeassistant/components/lidarr/sensor.py", line 146, in extra_state_attributes return self.entity_description.attributes_fn(self.coordinator.data) File "/usr/src/homeassistant/homeassistant/components/lidarr/sensor.py", line 88, in attributes_fn=lambda data: {i.title: queue_str(i) for i in data.records}, File "/usr/src/homeassistant/homeassistant/components/lidarr/sensor.py", line 88, in attributes_fn=lambda data: {i.title: queue_str(i) for i in data.records}, File "/usr/src/homeassistant/homeassistant/components/lidarr/sensor.py", line 158, in queue_str and item.timeleft == "00:00:00" AttributeError: 'LidarrQueueItem' object has no attribute 'timeleft'

What version of Home Assistant Core has the issue?

2023.4.1

What was the last working version of Home Assistant Core?

Unknown

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (lidarr) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `lidarr` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign lidarr` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


lidarr documentation lidarr source (message by IssueLinks)

tkdrob commented 1 year ago

Same issue as #90468

What downloader are you using? Can you provide the requested information I outlined in that issue? I don't think I got my message across on that one.

uberoptix commented 1 year ago

Using the transmission-openvpn on docker to download; reading up on that other issue now.

uberoptix commented 1 year ago

Here's the json payload. let me know if you need anything else.

{ "page": 1, "pageSize": 20, "sortKey": "timeleft", "sortDirection": "ascending", "totalRecords": 51, "records": [ { "artistId": 34, "albumId": 1601, "quality": { "quality": { "id": 6, "name": "FLAC" }, "revision": { "version": 1, "real": 0, "isRepack": false } }, "size": 2862379041, "title": "REDACTED", "sizeleft": 0, "status": "completed", "trackedDownloadStatus": "warning", "trackedDownloadState": "importFailed", "statusMessages": [ { "title": "One or more albums expected in this release were not imported or missing", "messages": [] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] }, { "title": "REDACTED", "messages": [ "Failed to import track, Destination already exists." ] } ], "downloadId": "REDACTED", "protocol": "torrent", "downloadClient": "Transmission", "indexer": "REDACTED", "outputPath": "/downloads/lidarr/REDACTED", "downloadForced": false, "id": 1346291462 }, { "artistId": 126, "albumId": 1046, "quality": { "quality": { "id": 4, "name": "MP3-320" }, "revision": { "version": 1, "real": 0, "isRepack": false } }, "size": 178787950, "title": "REDACTED, "sizeleft": 5742, "status": "downloading", "trackedDownloadStatus": "ok", "trackedDownloadState": "downloading", "statusMessages": [], "downloadId": "REDACTED", "protocol": "torrent", "downloadClient": "Transmission", "indexer": "REDACTED", "outputPath": "/downloads/lidarr/REDACTED", "downloadForced": false, "id": 617467118 }, { "artistId": 87, "albumId": 793, "quality": { "quality": { "id": 4, "name": "MP3-320" }, "revision": { "version": 1, "real": 0, "isRepack": false } }, "size": 102982522, "title": "REDACTED", "sizeleft": 65536, "status": "downloading", "trackedDownloadStatus": "ok", "trackedDownloadState": "downloading", "statusMessages": [], "downloadId": "REDACTED", "protocol": "torrent", "downloadClient": "Transmission", "indexer": "REDACTED", "outputPath": "/downloads/lidarr/REDACTED", "downloadForced": false, "id": 1683623776 }, { "artistId": 82, "albumId": 757, "quality": { "quality": { "id": 6, "name": "FLAC" }, "revision": { "version": 1, "real": 0, "isRepack": false } }, "size": 376867302, "title": "REDACTED", "sizeleft": 1477094, "status": "downloading", "trackedDownloadStatus": "ok", "trackedDownloadState": "downloading", "statusMessages": [], "downloadId": "REDACTED", "protocol": "torrent", "downloadClient": "Transmission", "indexer": "REDACTED", "outputPath": "/downloads/lidarr/REDACTED", "downloadForced": false, "id": 674588119 }, { "artistId": 27, "albumId": 211, "quality": { "quality": { "id": 6, "name": "FLAC" }, "revision": { "version": 1, "real": 0, "isRepack": false } }, "size": 1174803626, "title": "REDACTED", "sizeleft": 27262976, "status": "downloading", "trackedDownloadStatus": "ok", "trackedDownloadState": "downloading", "statusMessages": [], "downloadId": "REDACTED", "protocol": "torrent", "downloadClient": "Transmission", "indexer": "REDACTED", "outputPath": "/downloads/lidarr/REDACTED", "downloadForced": false, "id": 1838913646 } ] }