Sentry-cli: Version 1.60.0 seems to have broken `sentry-cli releases finalize`

Created on 2 Dec 2020  路  7Comments  路  Source: getsentry/sentry-cli

On 1.59.0:

root@10e8a5352e1a:~/web# npx sentry-cli releases finalize VERSION
Finalized release VERSION.

On 1.60.0:

root@10e8a5352e1a:~/web# npx sentry-cli releases finalize VERSION
error: API request failed
  caused by: sentry reported an error: request failure (http status: 400)
  Object({"projects": Array([String("This field is required.")])})

Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
Please attach the full debug log to all bug reports.

Debug log:

root@10e8a5352e1a:~/web# npx sentry-cli releases finalize VERSION --log-level=debug
  DEBUG   2020-12-02 09:11:35.169949271 +00:00 sentry-cli version: 1.60.0, platform: "linux", architecture: "x86_64"
  INFO    2020-12-02 09:11:35.170018940 +00:00 sentry-cli was invoked with the following command line: "/root/web/node_modules/@sentry/cli/sentry-cli" "releases" "finalize" "VERSION" "--log-level=debug"
  DEBUG   2020-12-02 09:11:35.170975013 +00:00 request POST https://sentry.io/api/0/organizations/opendoor/releases/
  DEBUG   2020-12-02 09:11:35.170997105 +00:00 using token authentication
  DEBUG   2020-12-02 09:11:35.171039632 +00:00 json body: {"version":"VERSION","dateReleased":"2020-12-02T09:11:35.170900821Z"}
  DEBUG   2020-12-02 09:11:35.171048211 +00:00 retry number 0, max retries: 0
  DEBUG   2020-12-02 09:11:35.275123930 +00:00 > POST /api/0/organizations/opendoor/releases/ HTTP/1.1
  DEBUG   2020-12-02 09:11:35.275160529 +00:00 > Host: sentry.io
  DEBUG   2020-12-02 09:11:35.275180764 +00:00 > Accept: */*
  DEBUG   2020-12-02 09:11:35.275190075 +00:00 > Connection: TE
  DEBUG   2020-12-02 09:11:35.275199341 +00:00 > TE: gzip
  DEBUG   2020-12-02 09:11:35.275208671 +00:00 > User-Agent: sentry-cli/1.60.0
  DEBUG   2020-12-02 09:11:35.275692854 +00:00 > Authorization: Bearer REDACTED
  DEBUG   2020-12-02 09:11:35.275712456 +00:00 > Content-Type: application/json
  DEBUG   2020-12-02 09:11:35.275719878 +00:00 > Content-Length: 102
  DEBUG   2020-12-02 09:11:35.424420280 +00:00 < HTTP/1.1 400 Bad Request
  DEBUG   2020-12-02 09:11:35.424450951 +00:00 < Server: nginx
  DEBUG   2020-12-02 09:11:35.424460433 +00:00 < Date: Wed, 02 Dec 2020 09:11:35 GMT
  DEBUG   2020-12-02 09:11:35.424469066 +00:00 < Content-Type: application/json
  DEBUG   2020-12-02 09:11:35.424477073 +00:00 < Content-Length: 40
  DEBUG   2020-12-02 09:11:35.424484652 +00:00 < Connection: keep-alive
  DEBUG   2020-12-02 09:11:35.424497928 +00:00 < Access-Control-Allow-Headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding
  DEBUG   2020-12-02 09:11:35.424505922 +00:00 < X-Content-Type-Options: nosniff
  DEBUG   2020-12-02 09:11:35.424513358 +00:00 < Content-Language: en
  DEBUG   2020-12-02 09:11:35.424520727 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After
  DEBUG   2020-12-02 09:11:35.424528496 +00:00 < Vary: Accept-Language, Cookie
  DEBUG   2020-12-02 09:11:35.424535652 +00:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2020-12-02 09:11:35.424542550 +00:00 < Allow: GET, POST, HEAD, OPTIONS
  DEBUG   2020-12-02 09:11:35.424549642 +00:00 < Access-Control-Allow-Origin: *
  DEBUG   2020-12-02 09:11:35.424556800 +00:00 < Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS
  DEBUG   2020-12-02 09:11:35.424563167 +00:00 < X-Frame-Options: deny
  DEBUG   2020-12-02 09:11:35.424570282 +00:00 < X-Served-By: web-c401c6a4
  DEBUG   2020-12-02 09:11:35.424578970 +00:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  DEBUG   2020-12-02 09:11:35.424598677 +00:00 response status: 400
  DEBUG   2020-12-02 09:11:35.424609708 +00:00 body: {"projects":["This field is required."]}
error: API request failed
  caused by: sentry reported an error: request failure (http status: 400)
  Object({"projects": Array([String("This field is required.")])})
  DEBUG   2020-12-02 09:11:35.425118390 +00:00 client close; no transport to shut down  (from sentry)

Most helpful comment

I'm sorry for the regression here. This is unfortunately actually caused by a backend API bug. We considered fixing it there but since the bug there is resident for a longer period of time this would also have broken on-prem installations of Sentry too we're putting a workaround in place instead and issuing a new release.

All 7 comments

Currently we are having exactly the same problem.

We are using sentry-cli from dockerhub.

$ sentry-cli releases finalize XXX-$CI_COMMIT_SHA
  DEBUG   2020-12-02 09:30:16.879701491 +00:00 sentry-cli version: 1.60.0, platform: "linux", architecture: "x86_64"
  INFO    2020-12-02 09:30:16.879745401 +00:00 sentry-cli was invoked with the following command line: "sentry-cli" "releases" "finalize" "XXX-YYY"
  DEBUG   2020-12-02 09:30:16.881297550 +00:00 request POST https://example.com/api/0/organizations/XXX/releases/
  DEBUG   2020-12-02 09:30:16.881320870 +00:00 using token authentication
  DEBUG   2020-12-02 09:30:16.881331040 +00:00 json body: {"version":"XXX-YYY","dateReleased":"2020-12-02T09:30:16.881257980Z"}
  DEBUG   2020-12-02 09:30:16.881335940 +00:00 retry number 0, max retries: 0
  DEBUG   2020-12-02 09:30:16.896508048 +00:00 > POST /api/0/organizations/XXX/releases/ HTTP/1.1
  DEBUG   2020-12-02 09:30:16.896531418 +00:00 > Host: example.com
  DEBUG   2020-12-02 09:30:16.896535428 +00:00 > Accept: */*
  DEBUG   2020-12-02 09:30:16.896538988 +00:00 > Connection: TE
  DEBUG   2020-12-02 09:30:16.896542228 +00:00 > TE: gzip
  DEBUG   2020-12-02 09:30:16.896546108 +00:00 > User-Agent: sentry-cli/1.60.0
  DEBUG   2020-12-02 09:30:16.896994095 +00:00 > Authorization: Bearer ***
  DEBUG   2020-12-02 09:30:16.897002205 +00:00 > Content-Type: application/json
  DEBUG   2020-12-02 09:30:16.897005895 +00:00 > Content-Length: 108
  DEBUG   2020-12-02 09:30:16.964716099 +00:00 < HTTP/1.1 400 Bad Request
  DEBUG   2020-12-02 09:30:16.964741639 +00:00 < Server: nginx/1.14.0 (Ubuntu)
  DEBUG   2020-12-02 09:30:16.964749829 +00:00 < Date: Wed, 02 Dec 2020 09:30:16 GMT
  DEBUG   2020-12-02 09:30:16.964755479 +00:00 < Content-Type: application/json
  DEBUG   2020-12-02 09:30:16.964760909 +00:00 < Content-Length: 40
  DEBUG   2020-12-02 09:30:16.964765519 +00:00 < Connection: keep-alive
  DEBUG   2020-12-02 09:30:16.964775969 +00:00 < Access-Control-Allow-Headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding
  DEBUG   2020-12-02 09:30:16.964779969 +00:00 < X-Content-Type-Options: nosniff
  DEBUG   2020-12-02 09:30:16.964784139 +00:00 < Content-Language: en
  DEBUG   2020-12-02 09:30:16.964788488 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After
  DEBUG   2020-12-02 09:30:16.964792408 +00:00 < Vary: Accept-Language, Cookie
  DEBUG   2020-12-02 09:30:16.964796148 +00:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2020-12-02 09:30:16.964799918 +00:00 < Allow: GET, POST, HEAD, OPTIONS
  DEBUG   2020-12-02 09:30:16.964803478 +00:00 < Access-Control-Allow-Origin: *
  DEBUG   2020-12-02 09:30:16.964807078 +00:00 < Access-Control-Allow-Methods: GET, POST, HEAD, OPTIONS
  DEBUG   2020-12-02 09:30:16.964810638 +00:00 < X-Frame-Options: deny
  DEBUG   2020-12-02 09:30:16.964827288 +00:00 response status: 400
  DEBUG   2020-12-02 09:30:16.964833588 +00:00 body: {"projects":["This field is required."]}
error: API request failed
  caused by: sentry reported an error: request failure (http status: 400)
  Object({"projects": Array([String("This field is required.")])})
  DEBUG   2020-12-02 09:30:16.965218486 +00:00 client close; no transport to shut down  (from sentry)

I think. I found the problem.

https://github.com/getsentry/sentry-cli/commit/6cd5fb2a626f7b588807eeacc02176076ba2d6c4#diff-adea2445327e39eb215de697b440dbbc02135357380fb612a10a9e659129a46bR755-R757

Function update_release is used in finalize. However the commit changes from PUT -> POST.
Which doesn't work well for the finalization of the release. And according to the doc the API endpoint is actually used to create releases.

https://docs.sentry.io/api/releases/create-a-new-release-for-an-organization/

Sorry for the inconvenience, we're working on fixing this right away. Also thanks for the PR @shenek, however this patch itself won't solve the problem completely without internal Sentry changes. Will keep you posted!

In case this is useful for anyone else who was using curl -sL https://sentry.io/get-cli/ | bash as we were you can replace it with this to pin to the previous working version:

sudo curl -sL https://downloads.sentry-cdn.com/sentry-cli/1.59.0/sentry-cli-Linux-x86_64 -o /usr/local/bin/sentry-cli && sudo chmod +x /usr/local/bin/sentry-cli

Thanks for your patience. Release 1.60.1 is in progress https://github.com/getsentry/sentry-cli/actions/runs/396146263

I'm sorry for the regression here. This is unfortunately actually caused by a backend API bug. We considered fixing it there but since the bug there is resident for a longer period of time this would also have broken on-prem installations of Sentry too we're putting a workaround in place instead and issuing a new release.

Thanks for the quick fix!

Was this page helpful?
0 / 5 - 0 ratings