dotnet / dotnet/docker-tools

updateImageSizeBaseline fails with "Property with the same name already exists on object"

Open
#1,243 1 comment 0 reactions 0 assignees View on GitHub
area-infrastructure bug
Dominant language
C#
Stars
181
Forks
67
Avg merge
2d 15h
Merged PRs (30d)
10

Description

Found as part of https://github.com/dotnet/dotnet-docker/pull/5359.

Steps to reproduce in dotnet-docker nightly branch

``` .\tests\performance\Validate-ImageSize.ps1 -UpdateBaselines -ImageBuilderCustomArgs "--os-version azurelinux3.0"```

Results

```
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ArgumentException: Can not add property src/runtime-deps/8.0/azurelinux3.0/amd64 to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object.
at Newtonsoft.Json.Linq.JObject.ValidateToken(JToken o, JToken existing)
at Newtonsoft.Json.Linq.JContainer.InsertItem(Int32 index, JToken item, Boolean skipParentCheck, Boolean copyAnnotations)
at Newtonsoft.Json.Linq.JObject.InsertItem(Int32 index, JToken item, Boolean skipParentCheck, Boolean copyAnnotations)
at Newtonsoft.Json.Linq.JContainer.TryAddInternal(Int32 index, Object content, Boolean skipParentCheck, Boolean copyAnnotations)
at Newtonsoft.Json.Linq.JContainer.Add(Object content)
at Newtonsoft.Json.Linq.JObject.Add(String propertyName, JToken value)
at Microsoft.DotNet.ImageBuilder.Commands.UpdateImageSizeBaselineCommand.<>c__DisplayClass5_0.g__processImage|0(String repoId, String imageId, String imageTag, String platform) in /image-builder/src/Commands/UpdateImageSizeBaselineCommand.cs:line 83
at Microsoft.DotNet.ImageBuilder.Commands.ImageSizeCommand`2.ProcessImages(ImageHandler processImage) in /image-builder/src/Commands/ImageSizeCommand.cs:line 39
at Microsoft.DotNet.ImageBuilder.Commands.UpdateImageSizeBaselineCommand.UpdateBaseline() in /image-builder/src/Commands/UpdateImageSizeBaselineCommand.cs:line 87
at Microsoft.DotNet.ImageBuilder.Commands.UpdateImageSizeBaselineCommand.ExecuteAsync() in /image-builder/src/Commands/UpdateImageSizeBaselineCommand.cs:line 31
at Microsoft.DotNet.ImageBuilder.Commands.Command`2.b__9_0(TOptions options) in /image-builder/src/Commands/Command.TOptions.cs:line 46
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
```

I was expecting this to work. If not intended to work, I would have expected a meaningful message.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.