Skip to content
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

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

Open
MichaelSimons opened this issue Apr 16, 2024 · 1 comment

Comments

@MichaelSimons
Copy link
Member

Found as part of dotnet/dotnet-docker#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.<UpdateBaseline>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.<GetCliCommand>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.<<BuildInvocationChain>b__0>d.MoveNext()

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

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

2 participants