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
MSBuild integration fails the build when no Sentry auth token is available #5704
With SentryUploadSymbols, SentryUploadSources or SentryCreateRelease enabled, a build with no Sentry auth token fails:
EXEC : error : Auth token is required for this request. Please run `sentry-cli login` and try again!
The Sentry CLI is not fully configured with authentication, organization, and project.
Build FAILED.
That covers every build without a token: fork PRs (GitHub withholds secrets from them), contributors' local Release builds, and docker build without the secret mounted. Today the only way out is to know to pass /p:UseSentryCLI=false. SENTRY_ALLOW_FAILURE=true doesn't help.
An invalid or expired token, or an unreachable server, fails the same way. The targets emit "Sentry API request failed" as a warning for that case, but the build has already failed.
The JS bundler plugins warn and skip the upload in this situation. Our targets were written to do the same thing: PrepareSentryCLI probes with sentry-cli info and, on a non-zero exit, prints "not fully configured" and clears $(SentryCLI), which skips every upload and release target. That part still works, but by then the build has already failed.
Cause
The probe's Exec sets IgnoreExitCode="true" but not IgnoreStandardErrorWarningFormat="true". Since sentry-cli 2.30.0, info prints error: Auth token is required… (or error: API request failed), and MSBuild treats that as a build error. Up to 2.28.6 it exited 1 without printing anything. I checked every bundled CLI from 2.17.5 to 3.8.0: this has been broken since the CLI bump in #3203, i.e. since 4.2.0.
The integration tests miss it because RunDotnetWithSentryCLI (integration-test/common.ps1) always passes /p:SentryAuthToken=dummy.
HOME=$(mktemp -d) dotnet build -c Release # empty HOME so ~/.sentryclirc isn't picked up
Proposal
Add IgnoreStandardErrorWarningFormat="true" to the sentry-cli info probe in PrepareSentryCLI. With 6.9.0's targets patched this way, the repro builds and nothing is uploaded.
Say what was skipped, like the bundler plugins do, and keep the CLI's raw error: output out of the default console verbosity so it doesn't read as a failure.
Add integration tests for no token and for an invalid token that assert the build succeeds and nothing is uploaded.
Keep the skip as a high-importance message, not a <Warning>. A warning would fail builds that use -warnaserror or MSBuildTreatWarningsAsErrors, which is the same bug again.
Activity
linear-code commentedon Oct 11, 2026
NET-855
fix(msbuild): Don't fail the build when sentry-cli has no auth token (#…