dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.53k stars 4.53k forks source link

NuGet restore failing with NullReferenceException #103823

Open kunalspathak opened 1 week ago

kunalspathak commented 1 week ago

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=715438 Build error leg or test failing: Build / windows-x64 release CrossDac / Build product Pull request: https://github.com/dotnet/runtime/pull/103806

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorPattern": "NuGet.RestoreEx.targets.*: error : Object reference not set to an instance of an object.",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=715438 Error message validated: [NuGet.RestoreEx.targets.*: error : Object reference not set to an instance of an object.] Result validation: :white_check_mark: Known issue matched with the provided build. Validation performed at: 6/21/2024 3:51:17 PM UTC

Report

Build Definition Step Name Console log Pull Request
724028 dotnet/runtime Build Tests Log dotnet/runtime#103412
723147 dotnet/runtime Build Tests Log dotnet/runtime#103735
722771 dotnet/runtime Build Tests Log dotnet/runtime#103144
721001 dotnet/runtime Build Tests Log dotnet/runtime#104017
717617 dotnet/runtime Build Tests Log dotnet/runtime#103510
717228 dotnet/runtime Build product Log dotnet/runtime#103860
715438 dotnet/runtime Build product Log dotnet/runtime#103806

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 4 7
dotnet-policy-service[bot] commented 1 week ago

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries See info in area-owners.md if you want to be subscribed.

jkotas commented 1 week ago

Likely duplicate of https://github.com/dotnet/runtime/issues/103526

jkotas commented 1 week ago

Stacktrace of the crash:

 Object reference not set to an instance of an object. [D:\a\_work\1\s\Build.proj]
    at System.Collections.Generic.Dictionary`2.FindValue(TKey key) [D:\a\_work\1\s\Build.proj]
    at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value) [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.ReflectTypeDescriptionProvider.GetTypeData(Type type, Boolean createIfNeeded) [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.DefaultTypeDescriptor.GetAttributes() [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes() [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.DefaultTypeDescriptor.GetAttributes() [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType) [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetConverter(Object instance, Boolean verifyIsRegisteredType) [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.DefaultTypeDescriptor.GetConverter() [D:\a\_work\1\s\Build.proj]
    at System.ComponentModel.TypeDescriptor.GetConverter(Type type) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.Serialization.JsonTypeReflector.CanTypeDescriptorConvertString(Type type, TypeConverter& typeConverter) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.Serialization.DefaultContractResolver.CanConvertToString(Type type) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType) [D:\a\_work\1\s\Build.proj]
    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) [D:\a\_work\1\s\Build.proj]
    at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.Read(TextReader reader, ILogger log, String path) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.Read(TextReader reader, ILogger log, String path) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.Read(Stream stream, ILogger log, String path) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.<>c__DisplayClass6_0.<Read>b__0(FileStream stream, String nupkgMetadataFilePath) [D:\a\_work\1\s\Build.proj]
    at NuGet.Common.FileUtility.SafeRead[T](String filePath, Func`3 read) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.Read(String filePath, ILogger log) [D:\a\_work\1\s\Build.proj]
    at NuGet.Packaging.NupkgMetadataFileFormat.Read(String filePath) [D:\a\_work\1\s\Build.proj]
    at NuGet.Protocol.LocalPackageFileCache.<>c__DisplayClass9_0.<GetOrAddSha512>b__1() [D:\a\_work\1\s\Build.proj]
    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode) [D:\a\_work\1\s\Build.proj]
 --- End of stack trace from previous location --- [D:\a\_work\1\s\Build.proj]
    at System.Lazy`1.CreateValue() [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.LockFileBuilder.CreateLockFile(LockFile previousLockFile, PackageSpec project, IEnumerable`1 targetGraphs, IReadOnlyList`1 localRepositories, RemoteWalkContext context, LockFileBuilderCache lockFileBuilderCache) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreCommand.BuildAssetsFile(LockFile existingLockFile, PackageSpec project, IEnumerable`1 graphs, IReadOnlyList`1 localRepositories, RemoteWalkContext contextForProject) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, IRestoreProgressReporter progressReporter, CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, IRestoreProgressReporter progressReporter, CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.RunAsync(IEnumerable`1 restoreRequests, RestoreArgs restoreArgs, CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token) [D:\a\_work\1\s\Build.proj]
    at NuGet.Build.Tasks.BuildTasksUtility.RestoreAsync(DependencyGraphSpec dependencyGraphSpec, Boolean interactive, Boolean recursive, Boolean noCache, Boolean ignoreFailedSources, Boolean disableParallel, Boolean force, Boolean forceEvaluate, Boolean hideWarningsAndErrors, Boolean restorePC, Boolean cleanupAssetsForUnsupportedProjects, ILogger log, CancellationToken cancellationToken) [D:\a\_work\1\s\Build.proj]

cc @steveharter