You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0697de7
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): Name rejected project slugs and release versions instead of reporting 400s (#2159)
A wrong or inaccessible project slug, or a release version Sentry
rejects, comes back as a 400. The CLI used to print the raw body and
report it to Sentry as a CLI bug. These 400s are now CLI errors that
name the value and say what to check, and they count only on the
`cli.error.silenced` metric. These are CLI-2G3 (`release create`) and
CLI-344 (sourcemap assemble); on 0.49.0 nearly all of their events are
these cases. Any other 400 stays a captured `ApiError`.
The output below comes from binaries built from `main` and from this
branch, run against a local mock server that returns Sentry's 400 bodies
(checked against Sentry source).
**Wrong project slug: `release create` (CLI-2G3) and `sourcemap upload`
(CLI-344)**
```
# before
Error: Failed to create release: 400 Bad Request
{"projects":["Invalid project ids or slugs"]}
Error: Failed to assemble artifact bundle: 400 Bad Request
{"error":"One or more projects are invalid"}
# after (both)
Error: Project 'frontnd' was not found in organization 'my-org'.
Try:
sentry project list my-org/
Or:
- Check the slug passed with --project (or the bundler plugin's `project` option)
- Check that your auth token can access the project # release create only
```
**Release version Sentry rejects**
```
# before
Error: Failed to create release: 400 Bad Request
{"version":["Release with name .. is not allowed"]}
# after
Error: Sentry does not allow the release version '..'.
Try:
sentry release propose-version
Note: A release version cannot be 'latest', '.' or '..', contain a slash, backslash, tab or newline, or be longer than 200 characters.
```
**Release already exists for projects the token can't access**
```
# before
Error: Failed to create release: 400 Bad Request
{"projects":["You do not have permission to one of the projects: backend"]}
# after
Error: Release '1.0.0' already exists in organization 'my-org' for projects your auth token cannot access: backend.
Note: Use an auth token that can access those projects, or a different release version.
```
`projects: This field is required` (`release create` without
`--project`) stays captured on purpose. Auto-detecting the project there
is the CLI's job.
<!-- junior-request-attribution:start -->
via @betegon.
<!-- junior-request-attribution:end -->
<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A7c47dab6b11a9b2f157ce8a825ab2e8a -->
--
[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3A7c47dab6b11a9b2f157ce8a825ab2e8a/?project=4510944073809921)
<!-- junior-session-footer:end -->
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: bete <28983162+betegon@users.noreply.github.com>
0 commit comments