`sentry release set-commits` ends with `Unexpected error: TypeError` when the release PUT is answered `200 {}`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- git, node.js, typescript
調査の方向性
未検証の応答は packages/cli/src/lib/api/releases.ts の updateRelease(374〜377行目付近)から来ており、クラッシュは packages/cli/src/commands/release/set-commits.ts の formatCommitsSet(407〜409行目付近)で発生しています。他の呼び出しが応答の形を確認するために使っている packages/cli/src/lib/api/infrastructure.ts の unwrapValidatedResult と比較してください。リンクされた gist の再現手順をローカルビルドに対して実行し、200 {} のケースを確認してください。200 {} がコミット設定の成功を報告するか、リリースの更新を名指しする ApiError で失敗すれば完了です。404 と 200-with-release のケースは変更しないでください。
索引モデルが issue の本文から書いたものです。
説明
Environment
sentrybundled frommainat d9a498101c5e8ed7bd8db0fa71c43c76076e02a2 with no uncommitted changes (sentry --version:0.52.0-dev.0), and[email protected]from npm, which does the same- node v26.12.1 on win32 x64, git version 2.56.0.windows.4
Steps to Reproduce
- In a git repository with an
originremote and two commits, runsentry release set-commits example-org/1.0.0 --localwithSENTRY_URLpointing at a server that answersGET /api/0/organizations/example-org/with the organization andPUT /api/0/organizations/example-org/releases/1.0.0/with200 {}, andSENTRY_AUTH_TOKENset to any value. - Run it again with the PUT answered
200with the release, and with404 {"detail":"not found"}.
Expected Result
With 200 {}, the command either reports the commits it set, or fails with an error that names the release update and its answer, as it does for the 404 (Error: Failed to update release '1.0.0': 404 Not Found). The PUT and the commits it carries stay as they are.
Actual Result
The PUT goes with both commits, then the command exits 1 with:
Unexpected error: TypeError: Cannot read properties of undefined (reading 'replace')
updateRelease returns the answer unchecked (packages/cli/src/lib/api/releases.ts#L374-L377), and formatCommitsSet passes its version to text() (packages/cli/src/commands/release/set-commits.ts#L407-L409). Other API calls check the answer's shape with unwrapValidatedResult (packages/cli/src/lib/api/infrastructure.ts#L1107-L1115), which throws ApiError naming the endpoint.
Reproducer
https://gist.github.com/YevheniiKotyrlo/8497fa9cdff5e0b58d4eccd8cd4f54ec
It makes a two-commit repository in a temporary folder, with no global or system git config, and runs the command three times against a local stand-in for the Sentry API that records each request, the release PUT answered with the release, with 404, and with 200 {}. It exits 1 while the 200 {} run ends in Unexpected error: TypeError after its PUT, 0 once that run exits 0 or fails naming the release update with no Unexpected error, 2 when a step fails, a control run or the 200 {} run ends another way, or the run is interrupted. Every child gets the caller's environment without its SENTRY_* and GIT_* variables, with TMPDIR, TEMP and TMP in the run's temporary folder. The run sets the repository's commit dates, its git user, an empty git config, commit.gpgsign=false and core.autocrlf=false, and gives the CLI SENTRY_HOST and SENTRY_URL (the stand-in), a placeholder SENTRY_AUTH_TOKEN, a SENTRY_CONFIG_DIR per run, SENTRY_CLI_NO_TELEMETRY and SENTRY_CLI_NO_UPDATE_CHECK. The verdict depends on SENTRY_HOST, SENTRY_URL and SENTRY_AUTH_TOKEN, which bring the requests to the stand-in; on SENTRY_CONFIG_DIR, since a stored sentry auth login takes priority over SENTRY_AUTH_TOKEN; and on leaving the caller's SENTRY_* and GIT_* variables out: with SENTRY_OUTPUT_FORMAT=json the command prints {} and exits 0, and a GIT_DIR points every git call at another repository. It depends as well on leaving the caller's git config out, since a hook it names can refuse the commits, and on the git user, without which git then makes no commit. It depends on none of the others. Paths below the temporary folder show as <tmp>. It needs git and no Sentry account.
node repro.mjs # sentry@latest from npm
node repro.mjs <toolkit> # a getsentry/toolkit checkout after `pnpm install`: runs `pnpm run bundle` in packages/cli first
Its output on main:
node v26.12.1 on win32 x64
git version 2.56.0.windows.4
$ # sentry: getsentry/toolkit at d9a498101c5e8ed7bd8db0fa71c43c76076e02a2, no uncommitted changes
$ pnpm run bundle # in packages/cli
$ git log --oneline
95c4fde Change the answer
9fda718 Add the app
$ sentry --version
0.52.0-dev.0
# the release PUT answered 200 with the release
$ sentry release set-commits example-org/1.0.0 --local
Commits Set: 1.0.0
━━━━━━━━━━━━━━━━━━
╭─────────┬───────╮
│ Version │ 1.0.0 │
│ Commits │ 2 │
╰─────────┴───────╯
exit 0; requests: GET /api/0/organizations/example-org/ -> 200, PUT /api/0/organizations/example-org/releases/1.0.0/ -> 200
the PUT carried 2 commits: 95c4fde, 9fda718
# the release PUT answered 404 {"detail":"not found"}
$ sentry release set-commits example-org/1.0.0 --local
Error: Failed to update release '1.0.0': 404 Not Found
not found
exit 30; requests: GET /api/0/organizations/example-org/ -> 200, PUT /api/0/organizations/example-org/releases/1.0.0/ -> 404
the PUT carried 2 commits: 95c4fde, 9fda718
# the release PUT answered 200 {}
$ sentry release set-commits example-org/1.0.0 --local
Unexpected error: TypeError: Cannot read properties of undefined (reading 'replace')
(10 stack frames not shown)
exit 1; requests: GET /api/0/organizations/example-org/ -> 200, PUT /api/0/organizations/example-org/releases/1.0.0/ -> 200
the PUT carried 2 commits: 95c4fde, 9fda718
RESULT (exit 1): defect shows (sentry 0.52.0-dev.0 built from d9a498101c5e): with the PUT answered 200 {}, the command exited 1 with "Unexpected error: TypeError..." after the PUT had gone
- 主要言語
- TypeScript
- スター
- 975
- フォーク
- 189
- 平均マージ
- 19時間 57分
- マージ済み PR(30日)
- 542
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/toolkit のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
getsentry/toolkit#2531 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mcp-feedback-pattern
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
getsentry/toolkit#2458 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/toolkit#2444 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mcp-feedback-pattern
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
getsentry/toolkit#2362 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
mcp-feedback-pattern
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
getsentry/toolkit#2315 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
getsentry/toolkit の issue をすべて見る
似ている issue
-
sumHorizontal, maxHorizontal, minHorizontal, allHorizontal, anyHorizontal, struct and argSortBy treat strings as literals instead of column names対応中かも @tomaionescu が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pola-rs/nodejs-polars#486 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
jaegertracing/jaeger-ui#4853 ·
メンテナーはふだん 1 日以内に返信
-
area/plugins platform/linux reproduced type/bug version/v2
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#66970 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
area:tui enhancement platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anthropics/claude-code#112838 ·
-
approved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信