docker { logs } returns no lines for containers that log to stderr
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
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, typescript
- Área
- backend
Línea de trabajo
Empieza con DockerLogService.getContainerLogs en api/src/unraid-api/graph/resolvers/docker/docker-log.service.ts, donde el issue indica que solo se lee stdout del comando docker. Comprueba cómo el resolver analiza y ordena las líneas con marca de tiempo y, después, verifica que la consulta también devuelve la salida de stderr, incluida la reproducción proporcionada con un contenedor que solo escribe en stderr.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
Unraid OS Version:
7.4.0 (API 4.37.11+8e587fe2)
Are you using a reverse proxy?
Yes (NPMPlus). I reproduced the issue directly on the server through the API's unix socket (/var/run/unraid-api.sock), without the proxy. The result is the same.
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 (if it is, please submit via the support form instead)
Issue Description
The docker { logs } query returns an empty lines list and no error for a container that writes its log output to stderr. Containers that log to stdout return their lines as expected.
A client therefore cannot tell "the container logged nothing" from "the container logs to stderr", which is the default for Python's logging and many Go services.
Steps to Reproduce
-
Start a container that only writes to stderr:
docker run -d --name stderr-test alpine sh -c 'while true; do echo "to stderr" >&2; sleep 5; done' -
Check on the host that the output is on stderr only:
# docker logs --tail 3 stderr-test to stderr to stderr to stderr # docker logs --tail 3 stderr-test 2>/dev/null # -
Look up the container id with
query { docker { containers { id names } } }and request its logs, directly on the server:curl -s --unix-socket /var/run/unraid-api.sock http://localhost/graphql \ -H "x-api-key: $KEY" -H "Content-Type: application/json" \ -d '{"query":"{ docker { logs(id: \"<id>\", tail: 3) { lines { timestamp message } } } }"}'
Expected Behavior
The lines from both stdout and stderr, ordered by timestamp, as docker logs shows them.
Actual Behavior
{"data":{"docker":{"logs":{"lines":[]}}}}
No lines and no error. The same happens without tail and with since. On the same server, containers that log to stdout (for example jellyfin, pihole, redis) return lines through the same query.
Additional Context
DockerLogService.getContainerLogs in api/src/unraid-api/graph/resolvers/docker/docker-log.service.ts reads only stdout:
const { stdout } = await execa('docker', args);
docker logs writes the container's stderr stream to its own stderr, so that stream is dropped. The line is the same in v4.30.0, v4.35.0, v4.37.5, v4.37.11 and on main, so this is not a regression of 7.4.0.
Reading both streams would fix it, for example with execa's all: true and parsing all instead of stdout. --timestamps is already passed, so the lines can be put in order.
I searched open and closed issues and pull requests for an existing report and found none.
I first noticed this with a real container (unbound) and tracked it down with the help of an AI assistant. I ran the reproduction above myself on the server.
- Lenguaje dominante
- TypeScript
- Estrellas
- 123
- Forks
- 25
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 9
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de unraid/api
-
Temperature metrics: lm-sensors voltages, fan speeds and power are reported as temperatures (°C)Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
flash { guid } always fails: resolver no longer returns guid but the schema marks it non-nullableAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
parityHistory query fails with NaN when a parity-checks.log record has an empty errors fieldAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
Todos los issues de unraid/api
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
yavorsky/unbuilt.app#65 ·
-
CVE security
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mckinsey/agents-at-scale-ark#4091 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
factory:subtask
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
NUS-Project-SaBai/project-sabai#386 ·
Los mantenedores suelen responder en 3 días
-
android needs clarification
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
super-productivity/super-productivity#12105 · 3 comentarios ·
Los mantenedores suelen responder en 1 día