dockerContainerStats: the first container of every refresh keeps docker stats' clear-screen codes in its id

Abierto Apto para principiantes
#2,131 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
docker, typescript
Área
api, backend

Línea de trabajo

Empieza en docker-stats.service.ts, en DockerStatsService.processStatsLine (línea 92), donde el issue indica que se eliminan los códigos de escape, y compara la expresión regular con las secuencias erase-display y cursor-home de la reproducción. Si hace falta, comprueba el comportamiento de coincidencia de ID indicado en useDockerContainerStats.ts y DockerContainerStatCell.vue. Se considera terminado cuando cada ID publicado coincide con el formato de ID de servidor y container esperado en todas las actualizaciones.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

  1. On the server, run docker stats --format '{{.ID}}' --no-trunc | od -c: every refresh starts with 033 [ J 033 [ H before the first ID.
  2. Subscribe to subscription { dockerContainerStats { id } }.
  3. 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.

Lenguaje dominante
TypeScript
Estrellas
123
Forks
25
Merge medio
2 d 16 h
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de unraid/api

Todos los issues de unraid/api

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.