`sentry release set-commits` ends with `Unexpected error: TypeError` when the release PUT is answered `200 {}`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 72/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- git, node.js, typescript
Direção de pesquisa
A resposta não verificada vem de updateRelease em packages/cli/src/lib/api/releases.ts (por volta das linhas 374-377), e a falha está em formatCommitsSet em packages/cli/src/commands/release/set-commits.ts (por volta das linhas 407-409). Compare com unwrapValidatedResult em packages/cli/src/lib/api/infrastructure.ts, que outras chamadas usam para verificar o formato da resposta. Execute o repro do gist vinculado contra um build local para confirmar o caso 200 {}. Está concluído quando 200 {} informa que os commits foram definidos ou falha com um ApiError que menciona a atualização do release, mantendo inalterados os casos 404 e 200-com-release.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 975
- Forks
- 189
- Merge médio
- 19h 57min
- PRs com merge (30d)
- 542
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de getsentry/toolkit
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
getsentry/toolkit#2531 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
mcp-feedback-pattern
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
getsentry/toolkit#2458 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
getsentry/toolkit#2444 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
mcp-feedback-pattern
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
getsentry/toolkit#2362 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
mcp-feedback-pattern
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
getsentry/toolkit#2315 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de getsentry/toolkit
Issues semelhantes
-
sumHorizontal, maxHorizontal, minHorizontal, allHorizontal, anyHorizontal, struct and argSortBy treat strings as literals instead of column namesTalvez já em andamento @tomaionescu assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
pola-rs/nodejs-polars#486 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
jaegertracing/jaeger-ui#4853 ·
Mantenedores costumam responder em até 1 dia
-
area/plugins platform/linux reproduced type/bug version/v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
anomalyco/opencode#66970 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
area:tui enhancement platform:macos
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
anthropics/claude-code#112838 ·
-
Add: Sports First TV (US)Abertaapproved check:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia