Unusual Log Error - Appears to be Python?

Hi Folks,

Have seen the error below several times… but not being a Python person I’m not sure what it means? Probably nothing, but could someone please give me a minute to let me know where I might look to resolve any issue… much appreciated.

Logger: aiohttp.server
Source: components/stream/hls.py:294
First occurred: 28 June 2022 at 06:55:54 (1 occurrences)
Last logged: 28 June 2022 at 06:55:54

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 79, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 220, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/stream/core.py", line 354, in get
    return await self.handle(request, stream, sequence, part_num)
  File "/usr/src/homeassistant/homeassistant/components/stream/hls.py", line 294, in handle
    if hls_msn + 1 == last_segment.sequence:
AttributeError: 'NoneType' object has no attribute 'sequence'

Thanks, Mark

It is only the last line that are actually important.
The others are unrelated.

The last line state that a value is not defined, so the attribute sequence does not exist.
This typical happens at startup where the sensors are set up, but before their value have been pulled from the sensors, addons, integrations and so on.
To avoid this error you need to look through your configuration and your lovelace cards for a sensor that use an attribute called sequence.
This line probably need a default option added, so HA knows how to compute the sensors before the real values are gathered.

Hi Wally,

Thanks for coming back to me. Interestingly I had searched for ‘sequence’ in all my automation files, lovelace, and yaml files, but found nothing. So it is indeed a mystery.

Oh well, will keep looking. Nothing seems affected, so there’s that :+1:

Thanks, Mark

It’s only an issue in the interval between sensor setup and retrieval of sensor data