Health route 503 hides the real cause of a storage failure, and the store-open failure path is untested
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
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nextjs, sqlite, typescript
- Área
- backend-api-design, testing
Línea de trabajo
Empieza en reference-implementations/dacs-directory/app/api/health/route.ts:15 para ver el catch que devuelve el 503 genérico, y luego lee src/catalog/store.ts:45-49, donde se envuelve el fallo de apertura. Ejecuta test/health-route-bad-data-path.test.ts para ver por qué fallan los casos existentes antes de que se abra el store, y después añade un archivo de prueba separado en el que el directorio sea escribible pero directory.sqlite no pueda abrirse. Está terminado cuando el cuerpo del 503 sigue siendo genérico, el log del servidor conserva el error original, los errores del store incluyen error.message y la nueva prueba observa el 503.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Where: reference-implementations/dacs-directory/app/api/health/route.ts:15 (on phase0-completion at the linked commit)
What goes wrong: Three parts of one problem: an operator who gets a 503 from /api/health cannot tell why. (1) The route's catch {} (reference-implementations/dacs-directory/app/api/health/route.ts:15) answers 503 with a generic body and discards the error, so it is impossible to tell whether the directory is unwritable, the database failed to open, or something else broke. (2) When the database cannot be opened, reference-implementations/dacs-directory/src/catalog/store.ts:45-49 always throws "configure DACS_DIRECTORY_DATA to a writable persistent volume", including when better-sqlite3 fails to load its native addon inside the constructor. The original message is kept only as cause, which many log setups do not print. (3) Both tests in reference-implementations/dacs-directory/test/health-route-bad-data-path.test.ts:17 and :23 point the data path at or under a regular file, so mkdirSync throws before the route imports the store and calls loadCatalog(). The 503 for a store that fails to open on a creatable, accessible directory is not tested.
Suggested fix: In route.ts, log the caught error server-side (for example with console.error) and keep the generic 503 body. In store.ts, include error.message in the thrown message and give the writable-volume advice only for path or permission errors. Add a new test file (the store reads DACS_DIRECTORY_DATA once at import, so it needs its own file) where the directory is readable and writable but directory.sqlite cannot be opened (for example a corrupt file) and assert the 503.
Size: Small
This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 3
- Merge medio
- 20 h 26 min
- PR fusionados (30 d)
- 119
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 DACS-Agent-commerce/Community
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyAbiertocontributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DACS-Agent-commerce/Community#366 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
DACS-Agent-commerce/Community#361 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
DACS-Agent-commerce/Community#359 ·
Los mantenedores suelen responder en 1 día
-
contributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DACS-Agent-commerce/Community#354 ·
Los mantenedores suelen responder en 1 día
-
OpenAPI entry for the listing version route omits its 409 responsePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertocontributors-section
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
DACS-Agent-commerce/Community#348 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de DACS-Agent-commerce/Community
Issues similares
-
Y2025: QBI forms print a negative taxable income; Form 8995-A lines 14b/14c check the wrong columnAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
readest/readest#7903 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
type: documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Oddmash/oddmash-ui#72 ·
Los mantenedores suelen responder en 1 día
-
bug good first issue priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
TMHSDigital/steam-mcp#106 ·
-
bug priority:p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
LCNINE/almondyoung-server#1562 ·
Los mantenedores suelen responder en 1 día