Skip to content

feat(build): Improve error messages for nonexistent projects#2753

Closed
runningcode wants to merge 3 commits intomasterfrom
no/improve-build-upload-error-messages
Closed

feat(build): Improve error messages for nonexistent projects#2753
runningcode wants to merge 3 commits intomasterfrom
no/improve-build-upload-error-messages

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

Summary

  • Improve error messages when sentry-cli build upload fails due to nonexistent projects
  • Provide specific guidance about using --project and --org flags
  • Add integration test for nonexistent project scenario

Changes

  • Enhanced error handling in src/commands/build/upload.rs to detect "Project not found" errors
  • Added helpful guidance messages for users when project doesn't exist
  • Created integration test command_build_upload_nonexistent_project with mock endpoints

Fixes EME-175

@linear
Copy link
Copy Markdown

linear bot commented Sep 12, 2025

@runningcode runningcode force-pushed the no/improve-build-upload-error-messages branch from bd9e1c2 to 3c46d63 Compare September 12, 2025 16:47
@runningcode runningcode marked this pull request as ready for review September 12, 2025 16:58
@runningcode runningcode requested review from a team and szokeasaurusrex as code owners September 12, 2025 16:58
runningcode and others added 3 commits September 15, 2025 13:50
When build upload fails due to nonexistent project or organization,
now provides clearer error messages with specific guidance:

- Shows "Project not found" with guidance to check --project and --org flags
- Shows "Organization not found" with guidance to check --org flag
- Preserves original error messages for other error types

Resolves EME-175: Missing error message on build upload with nonexistent project

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When 'sentry-cli build upload' fails due to a nonexistent project,
provide specific guidance to users about using --project and --org flags.

Fixes EME-175
@chromy chromy force-pushed the no/improve-build-upload-error-messages branch from 9ee0e81 to 1235c29 Compare September 15, 2025 12:50
@szokeasaurusrex
Copy link
Copy Markdown
Member

@runningcode What's wrong with the existing output? If you run this code against master, you'll get an output like:

  WARN    2025-09-15 16:10:45.833138 +02:00 Failed to upload 1 file:
  WARN    2025-09-15 16:10:45.833274 +02:00   - tests/integration/_fixtures/build/archive.xcarchive (Project not found. Ensure that you configured the correct project and organization.)

This does not mention the specific flags, but given that there are multiple ways of specifying orgs and projects, and given that we use this same error message everywhere else in Sentry CLI, I am not sure we need to add a specific additional message only for the build commands.

EME-175 appears to have been opened before the error message was added to the warning line. I would argue that the general warning should be sufficient to resolve that issue.

@runningcode
Copy link
Copy Markdown
Contributor Author

runningcode commented Sep 15, 2025

Yes you're right we don't need this PR. The error message was already improved on the backend.

The still existing bad message is when the org is non-existant though. I'll need to fix that.

The Sentry server lacks chunked uploading support, which is required for build uploads. If you are using a self-hosted Sentry server, update to the latest version of Sentry to use the build upload command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants