astroweather icon indicating copy to clipboard operation
astroweather copied to clipboard

"List index out of range" failure since 5am 17/04/2024

Open smalinj opened this issue 2 years ago • 6 comments

Hi,

I have an issue with astroweather integration.

Since 5am this morning I have an issue

Screenshot_20240417-135741

Reloading initilization doesn't work.

Only error is list index out of range.

smalinj avatar Apr 17 '24 12:04 smalinj

Same for me from today only also.

Erreur32 avatar Apr 17 '24 12:04 Erreur32

There is a "shortage" on weather forecast data at 7timer currently, as far as I have seen. Sadly I missed handling this in one of the loops.

For a quick fix change the pyastroweatherio dependency in your manifest.json to

    "requirements": [
        "pyastroweatherio==0.43.1.dev4"
    ],

You will only get the forecast for this day currently, but it does not error out anymore.

mawinkler avatar Apr 17 '24 12:04 mawinkler

Thanks for the work mawinkler, these things happen. made the change and the error went away, the daily stuff on the card is working.

Daali avatar Apr 17 '24 13:04 Daali

Thanks for the quick update ;) For me i will waiting your next update, no issue !

Thanks for your good works.

Erreur32 avatar Apr 17 '24 13:04 Erreur32

Get the same error. Although it seems to be a known problem just as additional information my corresponding log entry:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.astroweather
Quelle: helpers/update_coordinator.py:315
Integration: AstroWeather (Dokumentation, Probleme)
Erstmals aufgetreten: 15:24:12 (26 Vorkommnisse)
Zuletzt protokolliert: 15:49:11

Unexpected error fetching astroweather data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 102, in get_location_data
    return await self._get_location_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 216, in _get_location_data
    "deepsky_forecast": await self._get_deepsky_forecast(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 431, in _get_deepsky_forecast
    start_index = start_indexes[day]
                 ~~~~~~~~~~~~~^^^^^
IndexError: list index out of range

rlause avatar Apr 17 '24 13:04 rlause

Get the same error. Although it seems to be a known problem just as additional information my corresponding log entry:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.astroweather
Quelle: helpers/update_coordinator.py:315
Integration: AstroWeather (Dokumentation, Probleme)
Erstmals aufgetreten: 15:24:12 (26 Vorkommnisse)
Zuletzt protokolliert: 15:49:11

Unexpected error fetching astroweather data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 102, in get_location_data
    return await self._get_location_data()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 216, in _get_location_data
    "deepsky_forecast": await self._get_deepsky_forecast(),
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyastroweatherio/client.py", line 431, in _get_deepsky_forecast
    start_index = start_indexes[day]
                 ~~~~~~~~~~~~~^^^^^
IndexError: list index out of range

please see my comment from above.

There will be a new release with some (hopefully) nice new features for you all, as time permits.

mawinkler avatar Apr 17 '24 14:04 mawinkler

Fixed with release 0.50.0.

mawinkler avatar May 27 '24 20:05 mawinkler