NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. #13838

Open Epigeos-com opened 1 week ago

Epigeos-com commented 1 week ago

NuGet Product Used

dotnet.exe

Product Version

Linux, Arch-based, x64, 8.0.108

Worked before?

No response

Impact

I'm unable to use this version

Repro Steps & Context

dotnet restore on any project, even one fresh from dotnet new

Verbose Logs

Assembly loaded during TaskRun (NuGet.Build.Tasks.RestoreTask): System.Runtime.Intrinsics, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 (location: /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.8/System.Runtime.Intrinsics.dll, MVID: 76c4fb63-66d1-4fbf-8aff-dd1c4a6bb94c, AppDomain: [Default]) (TaskId:36)
03:33:03.804     1>/usr/share/dotnet/sdk/8.0.108/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/kirki/Code/a/a.csproj]
/usr/share/dotnet/sdk/8.0.108/NuGet.targets(156,5): error :   The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. [/home/kirki/Code/a/a.csproj]
                     Assembly loaded during TaskRun (NuGet.Build.Tasks.RestoreTask): System.Diagnostics.StackTrace, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (location: /usr/share/dotnet/shared/Microsoft.NETCore.App/8.0.8/System.Diagnostics.StackTrace.dll, MVID: aa9eb643-db2b-4c3a-8381-d02c8f479a8e, AppDomain: [Default]) (TaskId:36)
                     NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://api.nuget.org/v3/index.json.
                      ---> System.TimeoutException: The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms.
                        at NuGet.Protocol.TimeoutUtility.StartWithTimeout[T](Func`2 getTask, TimeSpan timeout, String timeoutMessage, CancellationToken token)
                        at NuGet.Protocol.HttpRetryHandler.SendAsync(HttpRetryHandlerRequest request, String source, ILogger log, CancellationToken cancellationToken)
                        at NuGet.Protocol.HttpSource.GetThrottledResponse(Func`1 requestFactory, TimeSpan requestTimeout, TimeSpan downloadTimeout, Int32 maxTries, Boolean isRetry, Boolean isLastAttempt, Guid sessionId, ILogger log, CancellationToken cancellationToken)
                        at NuGet.Protocol.HttpSource.<>c__DisplayClass15_0`1.<<GetAsync>b__0>d.MoveNext()
                     --- End of stack trace from previous location ---
                        at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
                        at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T](String filePath, Func`2 action, CancellationToken token)
                        at NuGet.Protocol.HttpSource.GetAsync[T](HttpSourceCachedRequest request, Func`2 processAsync, ILogger log, CancellationToken token)
                        at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
                        --- End of inner exception stack trace ---
                        at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
                        at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
                        at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
                        at NuGet.Protocol.Providers.VulnerabilityInfoResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
                        at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
                        at NuGet.Commands.VulnerabilityInformationProvider.GetVulnerabilityInfoAsync()
                        at NuGet.Commands.VulnerabilityInformationProvider.GetVulnerabilityInformationAsync(CancellationToken cancellationToken)
                        at NuGet.Commands.Restore.Utility.AuditUtility.GetAllVulnerabilityDataAsync(CancellationToken cancellationToken)
                        at NuGet.Commands.Restore.Utility.AuditUtility.CheckPackageVulnerabilitiesAsync(CancellationToken cancellationToken)
                        at NuGet.Commands.RestoreCommand.PerformAuditAsync(EnabledValue enableAudit, IEnumerable`1 graphs, TelemetryActivity telemetry, CancellationToken token)
                        at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
                        at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
                        at NuGet.Commands.RestoreRunner.ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, IRestoreProgressReporter progressReporter, CancellationToken token)
                        at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks)
                        at NuGet.Commands.RestoreRunner.RunAsync(IEnumerable`1 restoreRequests, RestoreArgs restoreArgs, CancellationToken token)
                        at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token)
                        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)
                        at NuGet.Build.Tasks.RestoreTask.ExecuteAsync(ILogger log) (TaskId:36)
                   Done executing task "RestoreTask" -- FAILED. (TaskId:36)
03:33:03.809     1>Done building target "Restore" in project "a.csproj" -- FAILED.: (TargetId:42)
03:33:03.810     1>Done Building Project "/home/kirki/Code/a/a.csproj" (Restore target(s)) -- FAILED.
Deferred Messages
03:33:03.810     0>
Detailed Build Summary
======================
     (TaskId:0)

                     ============================== Build Hierarchy (IDs represent configurations) =====================================================
                     Id                  : Exclusive Time   Total Time   Path (Targets)
                     ----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
                     0                   : 605.957s           606.033s       /home/kirki/Code/a/a.csproj (Restore)  (TaskId:0)
                     | 1                 : 0.011s           0.011s       /home/kirki/Code/a/a.csproj (_IsProjectRestoreSupported)  (TaskId:0)
                     | 2                 : 0.002s           0.002s       /home/kirki/Code/a/a.csproj (_GenerateRestoreProjectPathWalk)  (TaskId:0)
                     | 3                 : 0.058s           0.058s       /home/kirki/Code/a/a.csproj (_GenerateRestoreGraphProjectEntry)  (TaskId:0)
                     . 4                 : 0.004s           0.004s       /home/kirki/Code/a/a.csproj (_GenerateProjectRestoreGraph)  (TaskId:0)

                     ============================== Node Utilization (IDs represent configurations) ====================================================
                     Timestamp:            1        Duration   Cumulative
                     ----------------------------------------------------------------------------------------------------------------------------------- (TaskId:0)
                     638637817777761148:   0        0.216s     0.216s .... (TaskId:0)
                     638637817779925252:   1        0.011s     0.228s  (TaskId:0)
                     638637817780039260:   0        0.011s     0.238s  (TaskId:0)
                     638637817780145178:   2        0.002s     0.241s  (TaskId:0)
                     638637817780167035:   0        0.002s     0.242s  (TaskId:0)
                     638637817780185073:   3        0.058s     0.301s . (TaskId:0)
                     638637817780767182:   0        0.002s     0.302s  (TaskId:0)
                     638637817780783608:   4        0.004s     0.307s  (TaskId:0)
                     638637817780827136:   0        605.728s     606.035s ############ (scale 1:1000) (TaskId:0)
                     -----------------------------------------------------------------------------------------------------------------------------------
                     Utilization:          100.0    Average Utilization: 100.0 (TaskId:0)

Project Evaluation Performance Summary:
      177 ms  /home/kirki/Code/a/a.csproj                2 calls

Project Performance Summary:
    605914 ms  /home/kirki/Code/a/a.csproj                6 calls
              605850 ms  Restore                                    1 calls
                  0 ms  _IsProjectRestoreSupported                 2 calls
                  2 ms  _GenerateRestoreProjectPathWalk            1 calls
                 58 ms  _GenerateRestoreGraphProjectEntry          1 calls
                  4 ms  _GenerateProjectRestoreGraph               1 calls

Target Performance Summary:
        0 ms  _GenerateProjectRestoreGraph               1 calls
        0 ms  _GenerateRestoreDependencies               1 calls
        0 ms  _GetRestoreSettingsCurrentProject          1 calls
        0 ms  _GenerateRestoreGraphProjectEntry          1 calls
        0 ms  _GenerateProjectRestoreGraphCurrentProject   1 calls
        0 ms  _GenerateRestoreProjectPathItemsCurrentProject   1 calls
        0 ms  _CheckForObsoleteDotNetCliToolReferences   1 calls
        0 ms  _GetRestoreSettingsPerFramework            1 calls
        0 ms  _GetProjectJsonPath                        1 calls
        0 ms  _CheckForLanguageAndFeatureCombinationSupport   1 calls
        0 ms  _GetRestoreTargetFrameworkOverride         1 calls
        0 ms  _GetRestoreSettingsOverrides               1 calls
        0 ms  _CheckForUnsupportedCppNETCoreVersion      2 calls
        0 ms  _AddMicrosoftNetCompilerToolsetFrameworkPackage   1 calls
        0 ms  _IsProjectRestoreSupported                 1 calls
        0 ms  CollectFrameworkReferences                 1 calls
        0 ms  _CheckForUnsupportedNETCoreVersion         2 calls
        0 ms  _GenerateRestoreProjectPathItems           1 calls
        0 ms  _GenerateRestoreSpecs                      1 calls
        0 ms  _GenerateRestoreProjectSpec                1 calls
        0 ms  _GenerateRestoreProjectPathItemsPerFramework   1 calls
        0 ms  CollectPackageReferences                   1 calls
        1 ms  _GenerateDotnetCliToolReferenceSpecs       1 calls
        1 ms  _CollectTargetFrameworkForTelemetry        1 calls
        1 ms  CollectCentralPackageVersions              1 calls
        1 ms  CollectPackageDownloads                    1 calls
        1 ms  _GenerateRestoreProjectPathWalk            1 calls
        1 ms  _GenerateProjectRestoreGraphPerFramework   1 calls
        1 ms  _GetRestoreTargetFrameworksOutput          1 calls
        1 ms  _GetRestoreProjectStyle                    1 calls
        2 ms  CheckForImplicitPackageReferenceOverrides   1 calls
        2 ms  _ComputeToolPackInputsToProcessFrameworkReferences   1 calls
        4 ms  _LoadRestoreGraphEntryPoints               1 calls
        5 ms  _GetAllRestoreProjectPathItems             1 calls
       21 ms  _GetRestoreSettings                        1 calls
       29 ms  ProcessFrameworkReferences                 1 calls
       45 ms  _FilterRestoreGraphProjectInputItems       1 calls
       65 ms  _GenerateRestoreGraph                      1 calls
    605726 ms  Restore                                    1 calls

Task Performance Summary:
        0 ms  GetRestorePackageReferencesTask            1 calls
        0 ms  GetRestoreFrameworkReferencesTask          1 calls
        0 ms  GetRestoreProjectReferencesTask            1 calls
        0 ms  CheckForDuplicateFrameworkReferences       1 calls
        0 ms  GetRestorePackageDownloadsTask             1 calls
        0 ms  AllowEmptyTelemetry                        1 calls
        0 ms  GetRestoreDotnetCliToolsTask               1 calls
        0 ms  ConvertToAbsolutePath                      2 calls
        0 ms  NuGetMessageTask                           1 calls
        0 ms  CheckForImplicitPackageReferenceOverrides   1 calls
        1 ms  Message                                    3 calls
        1 ms  GetProjectTargetFrameworksTask             1 calls
        1 ms  GetRestoreProjectStyleTask                 1 calls
        1 ms  CheckForDuplicateNuGetItemsTask            3 calls
        2 ms  RemoveDuplicates                           5 calls
        3 ms  WarnForInvalidProjectsTask                 1 calls
        5 ms  ResolveAppHosts                            1 calls
       21 ms  GetRestoreSettingsTask                     1 calls
       23 ms  ProcessFrameworkReferences                 1 calls
       89 ms  MSBuild                                    6 calls
    605725 ms  RestoreTask                                1 calls

Build FAILED.

                   "/home/kirki/Code/a/a.csproj" (Restore target) (1) ->
                   (Restore target) -> 
                     /usr/share/dotnet/sdk/8.0.108/NuGet.targets(156,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/home/kirki/Code/a/a.csproj]
                   /usr/share/dotnet/sdk/8.0.108/NuGet.targets(156,5): error :   The HTTP request to 'GET https://api.nuget.org/v3/index.json' has timed out after 100000ms. [/home/kirki/Code/a/a.csproj]
jebriede commented 4 days ago

@Epigeos-com First, I want to make sure you can access the URL from your computer before diving into further troubleshooting. Can you please try accessing https://api.nuget.org/v3/index.json in your web browser and see if you get any errors or if that works and let us know? Thanks!

Epigeos-com commented 4 days ago

@jebriede Yes, browser works and I also checked cURL does too It also turned out that it randomly starts and stops working, usually about every other day... It's not about reboots either

jeffkl commented 1 day ago

@Epigeos-com are you able to reproduce the problem on another machine or does it only happen on this one? It sounds like something is misconfigured with the network? NuGet calls .NET APIs to interact with HTTP endpoints, I would expect any .NET application on this machine to experience the same issue. I'm not an expert on Arch Linux networking configuration, are there steps you can take to attempt to troubleshoot the problem?