`sentry release set-commits` ends with `Unexpected error: TypeError` when the release PUT is answered `200 {}`
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 72/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- git, node.js, typescript
Piste de recherche
La réponse non vérifiée provient de updateRelease dans packages/cli/src/lib/api/releases.ts (vers les lignes 374-377), et le plantage se situe dans formatCommitsSet dans packages/cli/src/commands/release/set-commits.ts (vers les lignes 407-409). Compare avec unwrapValidatedResult dans packages/cli/src/lib/api/infrastructure.ts, que d'autres appels utilisent pour vérifier la structure de la réponse. Exécute le repro du gist lié sur une build locale pour confirmer le cas 200 {}. C'est terminé lorsque 200 {} signale que les commits ont été définis ou échoue avec une ApiError nommant la mise à jour de la release, les cas 404 et 200-avec-release restant inchangés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- TypeScript
- Étoiles
- 975
- Forks
- 189
- Merge moyen
- 19 h 57 min
- PR mergées (30 j)
- 542
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getsentry/toolkit
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
getsentry/toolkit#2531 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
mcp-feedback-pattern
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
getsentry/toolkit#2458 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
getsentry/toolkit#2444 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
mcp-feedback-pattern
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
getsentry/toolkit#2362 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
mcp-feedback-pattern
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
getsentry/toolkit#2315 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de getsentry/toolkit
Issues similaires
-
sumHorizontal, maxHorizontal, minHorizontal, allHorizontal, anyHorizontal, struct and argSortBy treat strings as literals instead of column namesPeut-être pris @tomaionescu l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
pola-rs/nodejs-polars#486 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
jaegertracing/jaeger-ui#4853 ·
Les mainteneurs répondent en général sous 1 jour
-
area/plugins platform/linux reproduced type/bug version/v2
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
anomalyco/opencode#66970 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
area:tui enhancement platform:macos
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
anthropics/claude-code#112838 ·
-
Add: Sports First TV (US)Ouverteapproved check:passed streams:add
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour