Health route 503 hides the real cause of a storage failure, and the store-open failure path is untested
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- nextjs, sqlite, typescript
調査の方向性
reference-implementations/dacs-directory/app/api/health/route.ts:15 から始めて、汎用的な 503 を返す catch を確認してください。次に src/catalog/store.ts:45-49 を読み、オープン失敗がどこでラップされているかを確認します。test/health-route-bad-data-path.test.ts を実行して、ストアを開く前に既存のケースが失敗する理由を確認し、そのうえで、ディレクトリは書き込み可能だが directory.sqlite を開けない状況を再現する別のテストファイルを追加してください。完了の条件は、503 のレスポンス本文が汎用のままであること、サーバーログに元のエラーが残ること、ストアのエラーに error.message が含まれること、そして新しいテストが 503 を検証していることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 0
- フォーク
- 3
- 平均マージ
- 20時間 26分
- マージ済み PR(30日)
- 119
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DACS-Agent-commerce/Community のほかの issue
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyオープンcontributors-section
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DACS-Agent-commerce/Community#366 ·
メンテナーはふだん 1 日以内に返信
-
contributors-section
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DACS-Agent-commerce/Community#361 ·
メンテナーはふだん 1 日以内に返信
-
contributors-section
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DACS-Agent-commerce/Community#359 ·
メンテナーはふだん 1 日以内に返信
-
contributors-section
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DACS-Agent-commerce/Community#354 ·
メンテナーはふだん 1 日以内に返信
-
OpenAPI entry for the listing version route omits its 409 response対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcontributors-section
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
DACS-Agent-commerce/Community#348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
DACS-Agent-commerce/Community の issue をすべて見る
似ている issue
-
Y2025: QBI forms print a negative taxable income; Form 8995-A lines 14b/14c check the wrong columnオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
readest/readest#7903 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Oddmash/oddmash-ui#72 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/steam-mcp#106 ·
-
bug priority:p3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LCNINE/almondyoung-server#1562 ·
メンテナーはふだん 1 日以内に返信