Create release sentry-cli 302 Bad JSON

We’ve been using sentry-cli to manage our releases & sourcemaps during our build. However, recently it has started failing to create a release. Any help would be appreciated.

sentry-cli --log-level DEBUG --auth-token xxxx releases --org getaround --project production-24 new xxxxxx

Response

[INFO] sentry_cli::api request POST https://sentry.io/api/0/projects/getaround/production-24/releases/
[INFO] sentry_cli::api using token authentication
[INFO] sentry_cli::api sending JSON data (143 bytes)
[INFO] sentry_cli::api > POST /api/0/projects/getaround/production-24/releases/ HTTP/1.1
[INFO] sentry_cli::api > Host: sentry.io
[INFO] sentry_cli::api > Accept: */*
[INFO] sentry_cli::api > Connection: TE
[INFO] sentry_cli::api > TE: gzip
[INFO] sentry_cli::api > User-Agent: sentry-cli/1.32.2
[INFO] sentry_cli::api > Authorization: Bearer xxxxx
[INFO] sentry_cli::api > Content-Type: application/json
[INFO] sentry_cli::api > Content-Length: 143
[INFO] sentry_cli::api < HTTP/1.1 302 FOUND
[INFO] sentry_cli::api < Server: nginx
[INFO] sentry_cli::api < Date: Tue, 12 Jun 2018 05:21:33 GMT
[INFO] sentry_cli::api < Content-Type: application/json
[INFO] sentry_cli::api < Content-Length: 34
[INFO] sentry_cli::api < Connection: keep-alive
[INFO] sentry_cli::api < X-XSS-Protection: 1; mode=block
[INFO] sentry_cli::api < Content-Language: en
[INFO] sentry_cli::api < X-Content-Type-Options: nosniff
[INFO] sentry_cli::api < Vary: Accept-Language, Cookie
[INFO] sentry_cli::api < Allow: GET, POST, HEAD, OPTIONS
[INFO] sentry_cli::api < X-Frame-Options: deny
[INFO] sentry_cli::api < X-Served-By: web-c401c6a4
[INFO] sentry_cli::api < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
[INFO] sentry_cli::api response: 302
[INFO] sentry_cli::api body: {"detail": {"slug": "production"}}
error: could not parse JSON response
  caused by: missing field `version` at line 1 column 34

Can you make sure that your org and project match the slug at sentry.io?
It should be just production instead of production-24.
TBH we probably could improve on the error message :sweat_smile:

Thank you.

I was too eager with my “return”, sent it to production-, & got a much better response: “error: project not found”. I’m asking around our organization to try to determine who changed the project name & why (found & scolded! :laughing: )

Anyway, with the correct project it works. Thanks again!

btw, we’ve updated sentry-cli so it shows a more helpful error message :slight_smile:

1 Like