Skip to content

Fix artifact upload collision between Debug and Release matrix legs#1564

Merged
lewing merged 1 commit intomainfrom
fix/artifact-upload-collision
Mar 15, 2026
Merged

Fix artifact upload collision between Debug and Release matrix legs#1564
lewing merged 1 commit intomainfrom
fix/artifact-upload-collision

Conversation

@lewing
Copy link
Copy Markdown
Member

@lewing lewing commented Mar 14, 2026

Problem

Both Debug and Release matrix legs in the public CI pipeline call CIBuild.cmd/cibuild.sh, which includes -publish. This causes both legs to simultaneously upload PackageArtifacts/Microsoft.DotNet.XHarness.CLI.11.0.0-ci.nupkg to the same AzDO artifact container, resulting in intermittent "Blob is incomplete (missing block)" errors when the blob uploads interleave.

This was observed in the most recent CI runs on #1563 and is a well-known pattern across dotnet repos (see dotnet/dnceng#1916).

Root Cause

The arcade SDK's PushToBuildStorage MSBuild task (invoked by Publish.proj when Publish=true) emits ##vso[artifact.upload containerfolder=PackageArtifacts;artifactname=PackageArtifacts] commands. When both matrix legs run this simultaneously for the same .nupkg file, AzDO's blob storage encounters write conflicts.

Fix

Pass /p:Publish=false to the Debug matrix leg so only the Release leg publishes packages to artifact storage. The Debug leg still builds, tests, signs, and packs — it just skips the artifact upload step. MSBuild's "last property wins" rule ensures this overrides the -publish flag passed by CIBuild.cmd.

Applied to both Windows and macOS stages.

Both Debug and Release matrix legs call CIBuild which includes -publish,
causing both to simultaneously upload PackageArtifacts (e.g.
Microsoft.DotNet.XHarness.CLI.nupkg) to the same AzDO artifact container.
This results in intermittent 'Blob is incomplete (missing block)' errors.

Fix by passing /p:Publish=false for the Debug leg so only the Release
leg publishes packages to artifact storage. The Debug leg still builds,
tests, signs, and packs -- it just skips the artifact upload step.

Ref: dotnet/dnceng#1916

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lewing
Copy link
Copy Markdown
Member Author

lewing commented Mar 15, 2026

/ba-g failures are not related

@lewing lewing merged commit 6fe0045 into main Mar 15, 2026
14 of 17 checks passed
@lewing lewing deleted the fix/artifact-upload-collision branch March 15, 2026 03:46
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