Error since update to Z-stack firmware 20240710: Received an exception while passing frame to API

未关闭
#261 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

The report identifies a malformed ZDO Routes response after the Z-stack firmware update and includes the failing frame and traceback. Start by tracing how ZDO response frames are decoded in zigpy_znp/types/commands.py and how the Routes parameter is defined; then check the relevant decoding tests. Done means the frame is handled correctly or reported without flooding the log, with coverage for the truncated response.

由索引模型根据 Issue 内容生成。

描述

My coordinator is a CC2652P, since update to Koenkk Z-stack firmware 20240710, my log is flooded with these errors, but apart from that, everything seems to work fine, just wanted to report this.

2025-06-08 20:39:29.490 ERROR (MainThread) [zigpy_znp.uart] Received an exception while passing frame to API: TransportFrame(payload=GeneralFrame(header=CommandHeader(id=0xB2, subsystem=Subsystem.ZDO, type=CommandType.AREQ), data=b'\x83\xDE\x84'))
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/types/commands.py", line 417, in from_frame
    params[param.name], data = param.type.deserialize(data)
                               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy/types/struct.py", line 319, in deserialize
    value, data = field_type.deserialize(data)
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy/types/basic.py", line 199, in deserialize
    raise ValueError(f"Data is too short to contain {byte_size} bytes")
ValueError: Data is too short to contain 1 bytes

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/uart.py", line 56, in data_received
    self._api.frame_received(frame.payload)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/api.py", line 860, in frame_received
    command = command_cls.from_frame(frame, align=self.nvram.align_structs)
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/types/commands.py", line 424, in from_frame
    raise ValueError(
    ...<2 lines>...
    )
ValueError: Frame data is truncated (parsed {'Src': 0xDE83, 'Status': <Status.NOT_SUPPORTED: 132>}), required parameter remains: Param(name='Routes', type=<class 'zigpy.zdo.types.Routes'>, description='Routes', optional=False)
2025-06-08 20:43:30.506 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/api.py", line 1120, in request_callback_rsp
    return await callback_rsp
           ^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/api.py", line 1117, in request_callback_rsp
    async with asyncio_timeout(timeout):
               ~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError
2025-06-08 20:43:30.507 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/api.py", line 1120, in request_callback_rsp
    return await callback_rsp
           ^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.13/site-packages/zigpy_znp/api.py", line 1117, in request_callback_rsp
    async with asyncio_timeout(timeout):
               ~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/local/lib/python3.13/asyncio/timeouts.py", line 116, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

主要语言
Python
星标
172
派生
49
平均合并
3 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

zigpy/zigpy-znp 的其他 Issue

查看 zigpy/zigpy-znp 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。