dockerContainerStats: the first container of every refresh keeps docker stats' clear-screen codes in its id
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- docker, typescript
调研方向
从 docker-stats.service.ts 中的 DockerStatsService.processStatsLine(第 92 行)开始,issue 指出这里会剥除转义码;将正则表达式与复现示例中的 erase-display 和 cursor-home 序列进行比较。如有需要,检查 useDockerContainerStats.ts 和 DockerContainerStatCell.vue 中报告的 ID 匹配行为。完成的标准是,每次刷新后,所有已发布的 ID 都符合预期的服务器 ID 和 container ID 格式。
由索引模型根据 Issue 内容生成。
描述
Environment
Unraid OS Version: 7.3.4 (Docker 29.8.2)
Are you using a reverse proxy? No
Pre-submission Checklist
- I have verified that my Unraid OS is up to date
- I have tested this issue by accessing my server directly (not through a reverse proxy)
- This is not an Unraid Connect related issue
Issue Description
DockerStatsService.processStatsLine (docker-stats.service.ts:92) strips escape codes with /\x1B\[[0-9;]*[mK]/g. That removes colour and erase-line codes but not the erase-display and cursor-home pair (\x1B[J\x1B[H) that docker stats writes at every refresh, so the first container of every refresh is published with the pair in front of its ID, and a client that matches stats to containers by ID never gets that container's stats. The Docker overview component would show "—" for it, since it stores stats under the published ID (useDockerContainerStats.ts:18) and looks them up by the container's ID (DockerContainerStatCell.vue:16), but it is not enabled on 7.3.4 (DockerContainersPageModification.shouldApply returns false).
Steps to Reproduce
- On the server, run
docker stats --format '{{.ID}}' --no-trunc | od -c: every refresh starts with033 [ J 033 [ Hbefore the first ID. - Subscribe to
subscription { dockerContainerStats { id } }. - Watch the IDs for a few seconds.
Expected Behavior
Every ID is <server-id>:<container-id>.
Actual Behavior
The first ID of each refresh is <server-id>:\u001b[J\u001b[H<container-id>, the same container every time here. Replaying 7 s of docker stats output from this server (33 containers, 12 refreshes) through DockerStatsService, 12 of the 396 published IDs match no running container.
Additional Context
Stripping every CSI sequence fixes it: /\x1B\[[0-9;?]*[ -/]*[@-~]/g. The socket-based rewrite proposed in #2008 (for #2007) would also remove it, since it stops parsing docker stats output. #2120 is a different problem in the same service.
- 主要语言
- TypeScript
- 星标
- 123
- 派生
- 25
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 9
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
unraid/api 的其他 Issue
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullable未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
难度 2/5 1-3 小时 新手友好度 68/100
mckinsey/agents-at-scale-ark#4091 · 1 条评论 ·
维护者通常 1 天内回复
-
factory:subtask
难度 1/5 1 小时以内 新手友好度 94/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
NUS-Project-SaBai/project-sabai#386 ·
维护者通常 3 天内回复
-
android needs clarification
难度 2/5 1-3 小时 新手友好度 72/100
super-productivity/super-productivity#12105 · 3 条评论 ·
维护者通常 1 天内回复