Open Varorbc opened 4 months ago
@Varorbc if you can reproduce this, could you add more error logging and/or a binlog so we can get a sense of how the pushes are failing specifically?
@baronfel
/dotnet/sdk/8.0.300/Containers/build/Microsoft.NET.Build.Containers.targets(242,5): error : Containerize: error CONTAINER004: CONTAINER1005: Registry push failed; received status code 'PreconditionFailed'.
/dotnet/sdk/8.0.300/Containers/build/Microsoft.NET.Build.Containers.targets(242,5): error : URI: https://***/manifests/***
/dotnet/sdk/8.0.300/Containers/build/Microsoft.NET.Build.Containers.targets(242,5): error : at Microsoft.NET.Build.Containers.DefaultManifestOperations.PutAsync(String repositoryName, String reference, ManifestV2 manifest, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry/DefaultManifestOperations.cs:line 52
/dotnet/sdk/8.0.300/Containers/build/Microsoft.NET.Build.Containers.targets(242,5): error : at Microsoft.NET.Build.Containers.Registry.PushAsync(BuiltImage builtImage, SourceImageReference source, DestinationImageReference destination, Boolean pushTags, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Registry/Registry.cs:line 491
/dotnet/sdk/8.0.300/Containers/build/Microsoft.NET.Build.Containers.targets(242,5): error : at Microsoft.NET.Build.Containers.Tasks.CreateNewImage.PushToRemoteRegistryAsync(BuiltImage builtImage, SourceImageReference sourceImageReference, DestinationImageReference destinationImageReference, CancellationToken cancellationToken) in /_/src/Containers/Microsoft.NET.Build.Containers/Tasks/CreateNewImage.cs:line 227
Sorry, another question - when you are pushing multiple images, are you pushing
My suspicion is that because the publish is done on a per-project basis there's the possibility that multiple projects have shared layers and pushing the same layer to the registry simultaneously is what's causing the failure.
If that's the case, then for multi-project publishes (i.e. at solution level or Traversal props level) we'd need a more sophisticated system than we have today. We'd have to create all of the specific layers and report them back to some central process that could deduplicate and push each layer at most once.
I'm pushing a bunch of app images that all have the same base image to the registry. Sometimes, things don't go perfectly smooth, and I end up only getting some of them pushed successfully while others fail. Now, when I try again, I get an error saying it failed because I've set up rules in Harbor to stop duplicate pushes. That's why I'm thinking it'd be sweet if we could add an option like --skip-duplicate that they use with NuGet pushes.
When I push multiple images, I receive a
PreconditionFailed
error. Can you add--skip-duplicate
option like nuget to treat the error as a warning so that other image packages can push successfully