Skip to content

SDK Container publish fails on transient HTTP download error #48940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MattKotsenas opened this issue May 14, 2025 · 1 comment
Open

SDK Container publish fails on transient HTTP download error #48940

MattKotsenas opened this issue May 14, 2025 · 1 comment
Assignees
Labels
Area-Containers Related to dotnet SDK containers functionality

Comments

@MattKotsenas
Copy link
Member

Describe the bug

It appears that the SDK container publish task is not resilient to transient HTTP / networking errors on download. There's already retry on push that I found here: https://github.com/dotnet/sdk-container-builds/pull/256/files

However, on download we pass the HTTP stream directly to copy, which doesn't appear to have any retries wrapped around it.

Impact

This is more impactful that it might seem because it fails the build. That means in CI the whole pipeline fails or needs retried.

Exceptions (if any)

Microsoft.NET.Build.Containers.targets(352,5): error MSB4018: The "CreateImageIndex" task failed unexpectedly. [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018: System.Net.Http.HttpIOException: The response ended prematurely. (ResponseEnded) [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at System.Net.Http.HttpConnection.FillAsync(Boolean async) [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at System.Net.Http.HttpConnection.CopyToContentLengthAsync(Stream destination, Boolean async, UInt64 length, Int32 bufferSize, CancellationToken cancellationToken) [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at System.Net.Http.HttpConnection.ContentLengthReadStream.CompleteCopyToAsync(Task copyTask, CancellationToken cancellationToken) [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.Registry.DownloadBlobAsync(String repository, Descriptor descriptor, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs:line 417 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.DockerCli.WriteImageLayers(TarWriter writer, BuiltImage image, SourceImageReference sourceReference, Func`2 layerPathFunc, CancellationToken cancellationToken, JsonArray layerTarballPaths) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 338 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.DockerCli.WriteOciImageToBlobs(TarWriter writer, BuiltImage image, SourceImageReference sourceReference, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 492 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.DockerCli.WriteMultiArchOciImageToStreamAsync(MultiArchImage multiArchImage, SourceImageReference sourceReference, DestinationImageReference destinationReference, Stream imageStream, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/DockerCli.cs:line 515 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.LocalDaemons.ArchiveFileRegistry.LoadAsync[T](T image, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken, Func`6 writeStreamFunc) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/ArchiveFileRegistry.cs:line 48 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.LocalDaemons.ArchiveFileRegistry.LoadAsync[T](T image, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken, Func`6 writeStreamFunc) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/ArchiveFileRegistry.cs:line 48 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.LocalDaemons.ArchiveFileRegistry.LoadAsync(MultiArchImage multiArchImage, SourceImageReference sourceReference, DestinationImageReference destinationReference, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/ArchiveFileRegistry.cs:line 60 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.ImagePublisher.PushToLocalRegistryAsync[T](T image, SourceImageReference sourceImageReference, DestinationImageReference destinationImageReference, TaskLoggingHelper Log, Telemetry telemetry, CancellationToken cancellationToken, Func`5 loadFunc) in /_/src/Containers/Microsoft.NET.Build.Containers/ImagePublisher.cs:line 107 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.ImagePublisher.PublishImageAsync(MultiArchImage multiArchImage, SourceImageReference sourceImageReference, DestinationImageReference destinationImageReference, TaskLoggingHelper Log, Telemetry telemetry, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/ImagePublisher.cs:line 63 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.Tasks.CreateImageIndex.ExecuteAsync(CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateImageIndex.cs:line 86 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.NET.Build.Containers.Tasks.CreateImageIndex.Execute() in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateImageIndex.cs:line 32 [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() [/__w/1/s/Sample.csproj]
Microsoft.NET.Build.Containers.targets(352,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/__w/1/s/Sample.csproj]

Further technical details

dotnet sdk 8.0.407 on Windows

@dotnet-policy-service dotnet-policy-service bot added the untriaged Request triage from a team member label May 14, 2025
@github-actions github-actions bot added the Area-Containers Related to dotnet SDK containers functionality label May 14, 2025
@MattKotsenas
Copy link
Member Author

/cc @surayya-MS, @baronfel

@MattKotsenas MattKotsenas changed the title SDK Container publish fails on transient HTTP error SDK Container publish fails on transient HTTP download error May 14, 2025
@surayya-MS surayya-MS self-assigned this May 14, 2025
@surayya-MS surayya-MS removed the untriaged Request triage from a team member label May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality
Projects
None yet
Development

No branches or pull requests

2 participants