You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C#: buildless extraction warns "No NuGet feeds are reachable" when the repository has no nuget.config #22766
C# buildless extraction logs "No NuGet feeds are reachable" when the repository has no nuget.config
Problem
With build-mode: none for C#, a repository that has no nuget.config gets this warning in every analysis log, even though nuget.org is reachable and is used a moment later:
[build-stdout] [001] Found 0 nuget.config files in /home/runner/work/Interfaces/Interfaces.
[build-stdout] [001] Found 1 NuGet feeds (with inherited ones) in nuget.config files: https://api.nuget.org/v3/index.json
[build-stdout] [001] Checking NuGet feed reachability on feeds:
[build-stdout] [001] Warning: No NuGet feeds are reachable.
...
[build-stdout] [001] Checking NuGet feed reachability on feeds: https://api.nuget.org/v3/index.json
[build-stdout] [001] Querying NuGet feed 'https://api.nuget.org/v3/index.json' succeeded.
[build-stdout] [001] Reachable NuGet feeds: https://api.nuget.org/v3/index.json
The list after "on feeds:" is empty. CodeQL CLI 2.27.1, github/codeql-action@v4, ubuntu-24.04. Full log: run 37528763774, line 3483. The same warning is in the earlier scheduled CodeQL runs of linksplatform/Interfaces, for example run 36213154910 (2026-09-26) and run 37194208178 (2026-10-04).
Root cause
NugetPackageRestorer.Restore() always evaluates feedManager.ReachableExplicitFeeds when the responsiveness check is on. That calls CheckSpecifiedFeeds(ExplicitFeeds), and ExplicitFeeds comes from the nuget.config files in the source tree, so it is empty here. GetReachableNuGetFeeds then warns whenever the result is empty, including when there was nothing to check (FeedManager.cs on main):
varreachableFeeds=feedsToCheck.Where(feed =>feedManagerIo.IsFeedReachable(feed,initialTimeout,tryCount)).ToList();if(reachableFeeds.Count==0){logger.LogWarning($"No {fallbackStr}NuGet feeds are reachable.");}
Reproduction
Create a repository with any C# project that restores a package from nuget.org and has no nuget.config.
Run the default CodeQL setup or github/codeql-action/init@v4 with languages: csharp and build-mode: none.
The Perform CodeQL Analysis log contains Checking NuGet feed reachability on feeds: (empty) followed by Warning: No NuGet feeds are reachable.
Workaround
A nuget.config does not help. With one, the explicit set is {nuget.org}, but the inherited set (AllFeeds minus ExplicitFeeds) is now empty, and CheckSpecifiedFeeds(InheritedFeeds) logs the same warning (run 37530537674):
[build-stdout] [001] Found 1 nuget.config files in /home/runner/work/Interfaces/Interfaces: ...
[build-stdout] [001] Checking NuGet feed reachability on feeds: https://api.nuget.org/v3/index.json
[build-stdout] [001] Checking NuGet feed reachability on feeds:
[build-stdout] [001] Warning: No NuGet feeds are reachable.
The only workaround is to turn the reachability check off for repositories whose only feed is nuget.org:
Yes, we should avoid logging a warning in this case - I will open a PR for it (we still want the warning for fallback feeds - also if the set is empty - so I will make the change in a slightly different location). I also agree that the log messages are confusing. This has already been somewhat addressed here, but it hasn't been released yet.
Activity
hvitved commentedon Oct 7, 2026
@michaelnebel : Do you agree with the assessment above?
michaelnebel commentedon Oct 7, 2026
Yes, we should avoid logging a warning in this case - I will open a PR for it (we still want the warning for fallback feeds - also if the set is empty - so I will make the change in a slightly different location). I also agree that the log messages are confusing. This has already been somewhat addressed here, but it hasn't been released yet.
Thank you for the suggestion @konard .
In any case, I would recommend against setting
CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK=falseto avoid this warning.michaelnebel commentedon Oct 7, 2026
Expect to fix the issue here.