cmd/fsck: `--ui=false` Exits 0 on Corrupted Logs
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with cmd/fsck/main.go:76–101 and tessera/fsck/fsck.go:167, then build ./cmd/fsck and reproduce the corrupted-log case with --ui=false. Add a test that executes the fsck binary against a corrupted fixture and verifies diagnostics plus a non-zero exit; done also requires issuer checks to be included without premature cancellation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[discovered w/ the help of Claude]
Problem
fsck --ui=false always exits 0 even on corruption, discarding errors before they reach $?. In 2 of 3 failure modes, no diagnostic is printed, making --ui=false unusable as an automated CI/pipeline gate.
Impact Matrix (Fault Injection on Static-CT Log)
| Corruption Type | Detected Internally | Output Diagnostic | Exit Code |
|---|---|---|---|
Bit flip (tile/0/042) |
Yes (hash mismatch) | None | 0 |
Truncation (tile/data/042) |
Yes (bundle parse error) | None | 0 |
Missing issuer (issuer/<hex>) |
Yes (fetch failure) | WARN only |
0 |
Underlying detection logic in tessera/fsck is sound; only cmd/fsck error reporting fails.
Root Causes
- Early Return Bypasses
eg.Wait()(main.go:92–101):
f.Checkcompletion invokes deferredcancel(), closingctx.Done(). The non-TUI loop executescase <-ctx.Done(): return, exitingmaindirectly and skippingeg.Wait(),os.Exit(1), andslog.Info("OK"). - Disconnected Issuer Status:
Successfully fsck'd log(tessera/fsck/fsck.go:167) reflects tree verification only, omitting concurrentcheckIssuersTaskstatus. - LIFO Defer Prematurely Cancels Context (
main.go:76–81):
defer cancel()runs beforedefer lsc.Close(), cancelingctxwhile issuer workers may still be drainingissuersToCheck, potentially truncating checks on large logs or causing spurious HTTPcontext cancelederrors. - Regression test: No test currently invokes the cmd/fsck binary — all existing fsck coverage calls Check() directly and inspects the returned error, which is why this went unnoticed. Add a test that execs the built binary against a corrupted fixture with --ui=false and asserts a non-zero exit.
Minimal Reproduction
go build -o /tmp/fsck-ct ./cmd/fsck
# Corrupt single byte in a mirrored log tile:
cp -r /path/to/log /tmp/broken
printf '\x01' | dd of=/tmp/broken/tile/0/042 bs=1 seek=100 conv=notrunc
# Run without TUI:
/tmp/fsck-ct --monitoring_url=file:///tmp/broken \
--origin=<origin> --public_key=<key> --ui=false
echo $? # Returns 0 with no error diagnostics (BUG)
- Lenguaje dominante
- Go
- Estrellas
- 41
- Forks
- 20
- Merge medio
- 1 d 21 h
- PR fusionados (30 d)
- 26
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 transparency-dev/tesseract
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
transparency-dev/tesseract#879 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
transparency-dev/tesseract#851 ·
Los mantenedores suelen responder en 1 día
-
Remove support for precert signing certificatesPosiblemente ocupada @phbnf la tomó hace 4 días. Abiertobug
transparency-dev/tesseract#995 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
internal/ct: return errors from NewLog instead of calling os.Exit(1)Posiblemente ocupada @phbnf la tomó hace 25 días. Abiertobug
transparency-dev/tesseract#976 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Migrate Tessera MTC Log and Mirror code to the TesseraCT repoQuizá libre de nuevo @phbnf la tomó hace 34 días y no hay ningún pull request abierto. Abiertoenhancement
transparency-dev/tesseract#962 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de transparency-dev/tesseract
Issues similares
-
go good first issue test
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
[UI] Guard webApis against undefined window in SSR environmentsPosiblemente ocupada @madhavzanwar la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
kind/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
automated-analysis code-quality refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
github/gh-aw-mcpg#17105 ·
Los mantenedores suelen responder en 1 día