sentry-cli icon indicating copy to clipboard operation
sentry-cli copied to clipboard

Infinite loop in `build upload` if assemble "created" response lacks `artifact_url`

Open szokeasaurusrex opened this issue 1 month ago • 2 comments

Description

I encountered this code while trying to write an integration test which simulated server responses.

In this code:

https://github.com/getsentry/sentry-cli/blob/1886edc0fff0a79aec90abc4563786040a4c315e/src/commands/build/upload.rs#L564-L600

If the backend's assemble endpoint only ever returns a "created" response, and this response lacks an "artifact_url" (which could happen if we ever remove this field from the server's responses in the future for whatever reason), we will get stuck in an infinite loop.

Two thoughts:

  1. The final if statement should also check if we return "created", not just "Error" or "OK"
  2. There needs to be some sort of timeout and/or maximum iteration count on this loop, so that it is impossible to get stuck in an infinite loop.

szokeasaurusrex avatar Nov 11 '25 21:11 szokeasaurusrex

CLI-225

linear[bot] avatar Nov 11 '25 21:11 linear[bot]

Thanks for filing, do you have that script you used for the integration test?

runningcode avatar Nov 13 '25 13:11 runningcode