Skip to content

List Index Out of Range error in the HA log viewer #447

@KruseLuds

Description

@KruseLuds

Describe the bug

This appears in the log viewer:

2025-09-16 20:20:53.614 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1140, in _async_update_entity_states
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 981, in async_update_ha_state
self._async_write_ha_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1151, in _async_write_ha_state
self.__async_calculate_state()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1088, in __async_calculate_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1032, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 560, in state
value = self.native_value
^^^^^^^^^^^^^^^^^
File "/config/custom_components/pirateweather/sensor.py", line 1161, in native_value
native_val = self.get_state(daily.data[self.forecast_day].d)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
IndexError: list index out of range

Expected behavior

Everything works sorrectly but there are error messages in the log viewer - as noted above in the description

Actual behavior

Please note what is in the log viewer that I put in the description. Here are my settings:

Image Image

Home Assistant version

2025.9.3

Integration version

1.7.6

Other details

Also here is my HA configuration:

`## System Information

version core-2025.9.3
installation_type Home Assistant OS
dev false
hassio true
docker true
container_arch aarch64
user root
virtualenv false
python_version 3.13.7
os_name Linux
os_version 6.12.43-haos
arch aarch64
timezone America/New_York
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.5
Stage running
Available Repositories 2298
Downloaded Repositories 33
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 16.2
update_channel stable
supervisor_version supervisor-2025.09.0
agent_version 1.7.2
docker_version 28.3.3
disk_total 491.4 GB
disk_used 19.9 GB
nameservers 192.168.0.1
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization kvm
board generic-aarch64
supervisor_api ok
version_api ok
installed_addons Matter Server (8.1.0), AdGuard Home (5.3.3), Log Viewer (0.17.1), Home Assistant Google Drive Backup (0.112.1), Cloudflared (5.3.8), Mosquitto broker (6.5.2), Ring-MQTT with Video Streaming (5.8.1), RPC Shutdown (2.5), Studio Code Server (5.19.3), DbStats (0.5.12), Advanced SSH & Web Terminal (21.0.3), NetAlertX (25.8.6), Music Assistant Server (2.5.8)
Dashboards
dashboards 11
resources 22
views 44
mode storage
Network Configuration
adapters lo (disabled), enp1s0 (enabled, default, auto), docker0 (disabled), hassio (disabled), vethc9ad3c6 (disabled), veth93e4aa7 (disabled), vethe3d8980 (disabled), veth8834ca6 (disabled), veth56c3fb8 (disabled), veth3ed8190 (disabled), vethac618a4 (disabled), vethb71eaae (disabled), veth47b86db (disabled), vethbd07d19 (disabled), veth008738b (disabled), vetha61d67b (disabled), veth7929e89 (disabled)
ipv4_addresses lo (127.0.0.1/8), enp1s0 (192.168.0.34/32), docker0 (172.30.232.1/23), hassio (172.30.32.1/23), vethc9ad3c6 (), veth93e4aa7 (), vethe3d8980 (), veth8834ca6 (), veth56c3fb8 (), veth3ed8190 (), vethac618a4 (), vethb71eaae (), veth47b86db (), vethbd07d19 (), veth008738b (), vetha61d67b (), veth7929e89 ()
ipv6_addresses lo (::1/128), enp1s0 (fe80::fe76:bddc:7a90:f01c/64), docker0 (fe80::a470:34ff:fed5:400/64), hassio (fe80::58de:6aff:fe24:3412/64), vethc9ad3c6 (fe80::4b2:9dff:fe83:fe2f/64), veth93e4aa7 (fe80::3c19:aaff:fe89:cbb2/64), vethe3d8980 (fe80::58c0:76ff:fe77:dcca/64), veth8834ca6 (fe80::80d2:b0ff:fe62:a44e/64), veth56c3fb8 (fe80::2457:6cff:fe90:e4d3/64), veth3ed8190 (fe80::906c:4dff:fe51:a5b1/64), vethac618a4 (fe80::2470:ccff:fe47:d922/64), vethb71eaae (fe80::10eb:38ff:feca:e16d/64), veth47b86db (fe80::8cac:b8ff:fecd:2347/64), vethbd07d19 (fe80::f076:2dff:fea7:8bc7/64), veth008738b (fe80::740d:dcff:fe14:62ee/64), vetha61d67b (fe80::805b:2dff:fe1f:51c0/64), veth7929e89 (fe80::8437:dfff:fe27:a230/64)
announce_addresses 192.168.0.34, fe80::fe76:bddc:7a90:f01c
Recorder
oldest_recorder_run August 16, 2025 at 6:31 PM
current_recorder_run September 15, 2025 at 8:58 PM
estimated_db_size 3736.13 MiB
database_engine sqlite
database_version 3.48.0
`

Troubleshooting steps

  • I have updated my Home Assistant installation to the latest version.
  • I have updated the Pirate Weather Integration to the latest version.
  • I have gone through the documentation before opening this issue.
  • I have searched this repository and API Repository to see if the issue has already been reported.
  • I have restarted my Home Assistant installation.
  • I have queried the API in my browser to confirm the issue is not with the API.
  • I have not included my API key anywhere in my issue.
  • I have written an informative title.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions