Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Error on Private Source (AzureDevOps) #542

Closed
JBoothUA opened this issue Nov 18, 2018 · 44 comments
Closed

Error on Private Source (AzureDevOps) #542

JBoothUA opened this issue Nov 18, 2018 · 44 comments
Labels

Comments

@JBoothUA
Copy link

JBoothUA commented Nov 18, 2018

I have a working example of AzureDevOps "repo" command!!!!
So sweet!!! Talk about automating teadious workflows!!!!!

nukeeper

However, I seem to always have the same issue when trying to pull from my private repo.

I'm currently pulling the very latest master and running it, with great success, until I add our private feed as a --source parameter or add it to the nuget.config

At which time I always get a chunk of errors. I'm sure I am missing some sort of configuration, but I have tried to set my environment variables as far as I know... Maybe I missed something, I also am not sure if my env var credentials are correct since I'm using AzureDevOps..?

I basically get the same error over and over for each of my packages:

error on public package
Error getting Autofac from https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.

error on private package
Error getting Hexagon.Galileo.Common.Logging from https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.

Maybe there is an issue with passing in multiple sources with --source --source? It's almost like I'm passing in no sources now?

Here is the command I am running:

dotnet run -p NuKeeper\NuKeeper.csproj -- {URL} {PAT} --source https://api.nuget.org/v3/index.json --source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json --maxpr 5 --consolidate

Again this works fine if I only use --source and with the nuget.org feed, but as soon as I add my private feed all of my commands throw this error, also if I ONLY use my private feed it throws the same type of errors.

Although this linked issue is closed now, I was adding information at the end that seems to still be a problem, so it seems it could still be related to my issue:
#386 (comment)

That link also contains a lot of my configuration files, etc. but please let me know whatever would help troubleshoot this!! And of course I'd be happy to include any helpful information on this thread also.

Thanks for everything!! So close to getting this working in production!
Hexagon has over 18,000 employees, and I hope to spread this all over the company!!!
And to others!!

If we can get this last bug fixed I will forever be in your debt.

Please let me know if you need any screenshots or tutorials for Azure DevOps and NuKeeper I would be happy to help with anything!

@AnthonySteele
Copy link
Member

AnthonySteele commented Nov 18, 2018

The best way to manage sources is to have a NuGet.config file in the repository, with the correct <packageSources> elements. That way, NuGet and NuKeeper will both use these settings.

e.g. mine contains

  <packageSources>
    <add key="MyCo" value="http://packages.MyCo-internal.com/nuget/Default" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>

I'm not sure why your internal feed is not working, with the same url that nuget uses, and protocol version 3, you should be good!

@AnthonySteele
Copy link
Member

AnthonySteele commented Nov 18, 2018

Is it related to this issue? I looked up the error message "Nuget Unable to load the service index for source” and got a lot of links about proxy settings.

@JBoothUA
Copy link
Author

So we do have a NuGet.config with our private source.. I have added the nuget.org source, to the file and committed it to the repo, but it didn't seem to have any effect. Should I still pass in the 2 source parameters here? Thanks!

@slang25
Copy link
Member

slang25 commented Nov 19, 2018

What are you using for your nuget feed? If it's Azure DevOps Artifacts I had to do this little dance to get it to use credentials from environment variables:
https://stackoverflow.com/a/50749794/2225808
The password would be your PAT code.

@AnthonySteele
Copy link
Member

AnthonySteele commented Nov 19, 2018

If you have the nuget.config and want to use it, then you should not use the --source parameter as well, otherwise the --source will override what the file specifies.

If you set log --verbosity detailed then you should see output indicating what is read from the file, from here

@JBoothUA
Copy link
Author

JBoothUA commented Nov 20, 2018

Detailed Output when it works!! (just nuget.org source)

C:\Users\jbooth1\Source\Repos\NuKeeper [master ≡]> dotnet run -p NuKeeper\NuKeeper.csproj -- repo https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ {PAT} --source https://api.nuget.org/v3/index.json --verbosity detailed
--maxpr 5 --consolidate
Using launch settings from NuKeeper\Properties\launchSettings.json...
Matched uri 'https://dev.azure.com/hexagon-si-gpc/' to collaboration platform 'AzureDevOps'
FindPushFork. Fork Mode is SingleRepositoryOnly
2018-11-20T03:26:38Z: Started
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\a09922305c884f338e664dc7007804b7
Folder delete failed: IOException The directory is not empty : 'C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\a09922305c884f338e664dc7007804b7\Source\packages'
User name missing from profile, falling back to .gitconfig
Using upstream fork as push, for project OTHERHEXPRODS.SCPSAS at https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/
Repository search failed. NotImplementedException : The method or operation is not implemented.
at NuKeeper.AzureDevOps.AzureDevOpsPlatform.Search(SearchCodeRequest search) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.AzureDevOps\AzureDevopsPlatform.cs:line 97
at NuKeeper.Engine.RepositoryFilter.ContainsDotNetProjects(RepositorySettings repository) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\RepositoryFilter.cs:line 31
Git clone https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ to C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652
0 / 1968
196 / 1968
392 / 1968
588 / 1968
784 / 1968
980 / 1968
1176 / 1968
1372 / 1968
1568 / 1968
1764 / 1968
1960 / 1968
Git clone complete
Found 457 packages in use, 259 distinct, in 6 projects.
Autofac, Autofac.Extensions.DependencyInjection, Autofac.Extras.DynamicProxy, Autofac.ServiceFabric, AutoMapper, AutoMapper.Extensions.Microsoft.DependencyInjection, Castle.Core, codecracker.CSharp, FsCheck, FsCheck.Xunit, FSharp.Core, Hexagon.Galileo.Common.CommonConfiguration, Hexagon.Galileo.Common.CommonConfiguration.Abstractions, Hexagon.Galileo.Common.CommonFeatureFlag.Middleware, Hexagon.Galileo.Common.CommonFeatureFlagService.Abstractions, Hexagon.Galileo.Common.CommonTenantService.Abstractions, Hexagon.Galileo.Common.Context, Hexagon.Galileo.Common.Context.Abstractions, Hexagon.Galileo.Common.CosmosDB,
...
...
...
Nuget restore on C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652\Source\CommonHub.Configuration packages.config
In path C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652\Source\CommonHub.Configuration, running command: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe restore packages.config -Source https://api.nuget.org/v3/index.json
Nuget restore on packages.config complete
In path C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652\Source\CommonHub.Configuration, running command: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe update packages.config -Id Microsoft.AspNetCore.Http.Extensions -Version 2.1.1 -Source https://api.nuget.org/v3/index.json
Git commit with message ':package: Automatic update of Microsoft.AspNetCore.Http.Extensions to 2.1.1'
Git push to nukeeper_push/nukeeper-update-5-packages-BB094C2AC2B52A7B4DAF00002B3EB24B
Git checkout 'master'
Done 5 updates
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652
Deleted folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\0a15db5b504e4719bb57610bfba13652
Done at 2018-11-20T03:29:01Z

@JBoothUA
Copy link
Author

JBoothUA commented Nov 20, 2018

Detailed Output when it doesn't work:
(when I add my private Azure DevOps feed to --source, or to the nuget.config)

C:\Users\jbooth1\Source\Repos\NuKeeper [master ≡]> dotnet run -p NuKeeper\NuKeeper.csproj -- repo https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ {PAT} --maxpr 5 --consolidate --verbosity detailed
Using launch settings from NuKeeper\Properties\launchSettings.json...
Matched uri 'https://dev.azure.com/hexagon-si-gpc/' to collaboration platform 'AzureDevOps'
FindPushFork. Fork Mode is SingleRepositoryOnly
2018-11-20T03:55:24Z: Started
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\ef14853b6fb14f858b5d12218cecc565
Deleted folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\ef14853b6fb14f858b5d12218cecc565
User name missing from profile, falling back to .gitconfig
Using upstream fork as push, for project OTHERHEXPRODS.SCPSAS at https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/
Repository search failed. NotImplementedException : The method or operation is not implemented.
at NuKeeper.AzureDevOps.AzureDevOpsPlatform.Search(SearchCodeRequest search) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.AzureDevOps\AzureDevopsPlatform.cs:line 97
at NuKeeper.Engine.RepositoryFilter.ContainsDotNetProjects(RepositorySettings repository) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\RepositoryFilter.cs:line 31
Git clone https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ to C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665
0 / 1968
196 / 1968
392 / 1968
588 / 1968
784 / 1968
980 / 1968
1176 / 1968
1372 / 1968
1568 / 1968
1764 / 1968
1960 / 1968
Git clone complete
Reading file C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config for package sources
Reading file C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config for package sources
Reading file C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config for package sources
Read [nuget.org] : https://api.nuget.org/v3/index.json from file: C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config
Read [Galileo] : https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json from file: C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config
Found 457 packages in use, 259 distinct, in 6 projects.
...
...
...
Error getting Microsoft.AspNetCore.Html.Abstractions from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting Microsoft.AspNetCore.HttpOverrides from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting Microsoft.AspNetCore.JsonPatch from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting Microsoft.AspNetCore.Localization from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting Microsoft.AspNetCore.Mvc.ApiExplorer from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting Microsoft.AspNetCore.Mvc.Cors from Galileo [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)
at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
...
...
...
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.VisualStudio.Azure.Fabric.MSBuild-to-1.6.7
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.AspNetCore.Routing.Abstractions-to-2.1.1
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-System.Runtime.CompilerServices.Unsafe-to-4.5.2
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.ServiceFabric.Services.Remoting-to-3.2.187
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.Data.Services.Client-to-5.8.4
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-WindowsAzure.Storage-to-9.3.2
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Polly-to-6.1.1
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-System.Reactive-to-4.1.2
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.AspNetCore.Http-to-2.1.1
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.Rest.ClientRuntime-to-2.3.18
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.IdentityModel.Logging-to-5.3.0
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.AspNetCore.Mvc.Core-to-2.1.3
No branch found for OTHERHEXPRODS.SCPSAS / CommonSite / nukeeper-update-Microsoft.AspNetCore.Mvc.ViewFeatures-to-2.1.3
Selection of package updates: 145 candidates, filtered to 137, capped at 5
Selected package update of System.Runtime.CompilerServices.Unsafe to 4.5.2
Selected package update of Microsoft.Extensions.Primitives to 2.1.6
Selected package update of System.Buffers to 4.5.0
Selected package update of Microsoft.Net.Http.Headers to 2.1.1
Selected package update of Microsoft.AspNetCore.Http.Extensions to 2.1.1
Nuget restore on C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source CommonSite.sln
Checking for NuGet.exe in packages directory: C:\Users\jbooth1.nuget\packages\nuget.commandline
Found NuGet.exe: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe
In path C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source, running command: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe restore CommonSite.sln -Source https://api.nuget.org/v3/index.json -Source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json
Nuget restore on CommonSite.sln complete
Updating 5 packages
'System.Runtime.CompilerServices.Unsafe' from 4.5.1 to 4.5.2 in 2 projects
'Microsoft.Extensions.Primitives' from 2.1.1 to 2.1.6 in 2 projects
'System.Buffers' from 4.4.0 to 4.5.0 in 1 projects
'Microsoft.Net.Http.Headers' from 2.0.3, 2.1.0 to 2.1.1 in 2 projects
'Microsoft.AspNetCore.Http.Extensions' from 2.0.2, 2.1.0 to 2.1.1 in 2 projects
Git checkout 'master'
Using branch name: 'nukeeper-update-5-packages-BB094C2AC2B52A7B4DAF00002B3EB24B'
Git checkout new branch 'nukeeper-update-5-packages-BB094C2AC2B52A7B4DAF00002B3EB24B'
No dependencies between items, no need to sort on dependencies
Resorted 2 projects by dependencies, first change is Source\CommonSiteServiceTests\packages.config moved to position 0 from 1.
Updating 'System.Runtime.CompilerServices.Unsafe' to 4.5.2 in 2 projects
Nuget restore on C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source\CommonSiteServiceTests packages.config
Checking for NuGet.exe in packages directory: C:\Users\jbooth1.nuget\packages\nuget.commandline
Found NuGet.exe: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe
In path C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source\CommonSiteServiceTests, running command: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe restore packages.config -Source https://api.nuget.org/v3/index.json -Source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json
Nuget restore on packages.config complete
Checking for NuGet.exe in packages directory: C:\Users\jbooth1.nuget\packages\nuget.commandline
Found NuGet.exe: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe
In path C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source\CommonSiteServiceTests, running command: C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe update packages.config -Id System.Runtime.CompilerServices.Unsafe -Version 4.5.2 -Source https://api.nuget.org/v3/index.json -Source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json
Command C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe failed with exit code: 1

MSBuild auto-detection: using msbuild version '15.8.168.64424' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin'.
Feeds used:
https://api.nuget.org/v3/index.json
https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json

Attempting to gather dependency information for multiple packages with respect to project 'C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source\CommonSiteServiceTests\Hexagon.Galileo.Common.CommonSiteServiceTests.csproj', targeting '.NETFramework,Version=v4.7.1'
Please provide credentials for: https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json
UserName:

Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
The HTTP request to 'GET https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json' has timed out after 100000ms.

Updates failed NuKeeperException : Command C:\Users\jbooth1.nuget\packages\nuget.commandline\4.7.1\tools\NuGet.exe failed with exit code: 1

MSBuild auto-detection: using msbuild version '15.8.168.64424' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin'.
Feeds used:
https://api.nuget.org/v3/index.json
https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json

Attempting to gather dependency information for multiple packages with respect to project 'C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665\Source\CommonSiteServiceTests\Hexagon.Galileo.Common.CommonSiteServiceTests.csproj', targeting '.NETFramework,Version=v4.7.1'
Please provide credentials for: https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json
UserName:

Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
The HTTP request to 'GET https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json' has timed out after 100000ms.

at NuKeeper.Update.ProcessRunner.ExternalProcess.Run(String workingDirectory, String command, String arguments, Boolean ensureSuccess) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Update\ProcessRunner\ExternalProcess.cs:line 63
at NuKeeper.Update.Process.NuGetUpdatePackageCommand.Invoke(PackageInProject currentPackage, NuGetVersion newVersion, PackageSource packageSource, NuGetSources allSources) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Update\Process\NuGetUpdatePackageCommand.cs:line 48
at NuKeeper.Update.UpdateRunner.Update(PackageUpdateSet updateSet, NuGetSources sources) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Update\UpdateRunner.cs:line 49
at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, NuGetSources sources, SettingsContainer settings, IReadOnlyCollection1 updates) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\Packages\PackageUpdater.cs:line 77 at NuKeeper.Engine.Packages.PackageUpdater.MakeUpdatePullRequests(IGitDriver git, RepositoryData repository, IReadOnlyCollection1 updates, NuGetSources sources, SettingsContainer settings) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\Packages\PackageUpdater.cs:line 46
Attempted 5 updates and did 0
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665
Deleted folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\e8862d03b68343d99b92268d01dc4665
Done at 2018-11-20T04:03:39Z
C:\Users\jbooth1\Source\Repos\NuKeeper [master ≡]>

@JBoothUA
Copy link
Author

@slang25 thanks for your help!! could you let me know what commands you ran to set your PAT, or did you just add a username and PAT to all of your nuget.config files... (would rather not have to do that)

@AnthonySteele
Copy link
Member

AnthonySteele commented Nov 20, 2018

Reading file C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config for package sources
Reading file C:\Program Files (x86)\NuGet\Config\Microsoft.VisualStudio.Offline.config for package sources
Reading file C:\Program Files (x86)\NuGet\Config\ServiceFabricSDK.config for package sources
Read [nuget.org] : https://api.nuget.org/v3/index.json from file: C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config
Read [Galileo] : https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json from file: C:\Users\jbooth1\AppData\Roaming\NuGet\NuGet.Config

The sources are being read from config files correctly. It's going wrong after that :(

So the second feed Url for the private source is on .visualstudio.com - there might be auth needed?

@slang25
Copy link
Member

slang25 commented Nov 20, 2018

@JBoothUA I didn't run any commands as this was a build I was getting working in AppCenter, but I suspect you'll want to do a similar thing. If you are kicking this off from Azure DevOps build pipeline, you can configure environment variables in the ui, and you can store the PAT token in "Secure files", so it remains a secret.

@JBoothUA
Copy link
Author

JBoothUA commented Nov 20, 2018

@slang25 so you're recommending I add this to the nuget.config

<add key="Username" value="%USER_VARIABLE%" />
<add key="Password" value="%PASSWORD_VARIABLE%" />

Or should I use the name of my PAT token variable?

Still having problems here, @AnthonySteele any other ideas on how I could troubleshoot this?

@slang25
Copy link
Member

slang25 commented Nov 20, 2018

It's up to you really, if you already have an environment variable containing your PAT then you could use it in place of PASSWORD_VARIABLE.

@JBoothUA
Copy link
Author

JBoothUA commented Nov 20, 2018

@slang25 ok cool, that is good to know.
To start, I hardcoded the values, just for a test:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="packages" />
  </config>
  <packageSources>
    <add key="Galileo" value="https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json" />
	<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <packageSourceCredentials>
    <CustomNugetPackages>
        <add key="Username" value="jesse.booth@hexagonsi.com" />
        <add key="Password" value="{HARDCODED_PAT}" />
    </CustomNugetPackages>
    <Galileo>
        <add key="Username" value="jesse.booth@hexagonsi.com" />
        <add key="Password" value="{HARDCODED_PAT}" />
    </Galileo>
  </packageSourceCredentials>
</configuration>

But it didn't seem to have any effect still..
Does this nuget.config look correct to you?

@slang25
Copy link
Member

slang25 commented Nov 20, 2018

Odd. Be sure you have the necessary permissions granted on the PAT, here's mine:
image

@slang25
Copy link
Member

slang25 commented Nov 20, 2018

Ah, it appears the key is not Password, but ClearTextPassword. That's what I have in my project. Relevant docs here.

@MarcBruins
Copy link
Member

We might be able to make this functionality in the NuKeeper extension because we can insert the build agent pat there. Might be worthwhile if other people run into this issue as well.

@JBoothUA
Copy link
Author

Thanks @MarcBruins I'm still struggling with this issue. I feel like @slang25 has me on the right path, if I use those settings I can get the error to change into a 401 unauthorized error.. And on the latest master I can even get it to complete the process, of course my fear is that it will never attempt to update the packages from my private feeds...

So unfortunately this is still an issue for me. I do not have any problems with my Azure DevOps private feeds except with NuKeeper, so it's hard to tell if I have something configured poorly or if NuKeeper could be doing something to make my life easier.

@JBoothUA
Copy link
Author

JBoothUA commented Nov 21, 2018

Of course my fear is then that it will never update those private packages it threw the 401 error on.
And my secondary fear of having to add credentials to each nuget.config just in order for NuKeeper to be able to find the credentials? It seems Visual Studio, etc must have a way to do it without credentials in the nuget.config.

@shep1987
Copy link
Member

@JBoothUA, can you try the following nuget.config, we are using a custom package source as well and it works for us

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <clear />
        <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
        <add key="Galileo" value="https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json" />
    </packageSources>
    <activePackageSource>
        <add key="All" value="(Aggregate source)" />
    </activePackageSource>
    <packageSourceCredentials>
        <Galileo>
            <add key="Username" value="VssSessionToken" />
            <add key="ClearTextPassword" value="{HARDCODED_PAT}" />
        </Galileo>
    </packageSourceCredentials>
</configuration>

@phatcher
Copy link
Contributor

I think my comment from the previous discussion is still valid...

To authenticate to a private feed you might look at Using dotnet with Azure Artifacts which recommends using the Azure Artifacts Credential Provider

Also, it might be worthwhile looking at the source code for the NuGet task to see how it achieves it, some of the parameters are similar to what we need e.g.

  1. Where to pick up the nuget.config
  2. Which token to use to authenticate to the feed

@JBoothUA
Copy link
Author

@phatcher I tried to look at the credential provider, but I guess I didn't know what I was doing

@JBoothUA
Copy link
Author

@shep1987 no luck.. thanks for the advice though.. is the VssSessionToken something that is built in? maybe I need to set that up somehow?

@phatcher
Copy link
Contributor

phatcher commented Nov 26, 2018

@JBoothUA The use name for the package credentialst can be anything

@travisgosselin
Copy link

Our dev team standardized on "user" level NuGet.Config that contains the private source for AzureDevOps NuGet feed (and authorized credentials). We do not commit any NuGet.Config into source control. This works well since a developer can easily restore any / all repos from their user level NuGet.Config file. When building on Azure DevOps, as mentioned above, we can easily use the built in dotnet restore task to restore from the private feed.

As the thread suggests, this makes it also very difficult for us to run Nukeeper on any of our repositories. Typically most NuGet applications / integrations we work with all support the idea of a machine or user level configuration for NuGet.Config. Is it possible for Nukeeper to support this as well?

Additionally, it may benefit this thread allowing you to easily configure the authorization for your Azure Private DevOps feed at the user level for local usage, and could configure Nukeeper inside a docker container (or private build servers may be configured at the machine level for private feeds) to execute on the build server (with a NuGet.Config at the proper location).

Example local user level path (windows): C:\Users{username}\AppData\Roaming\NuGet\NuGet.Config
Example local docker path (ubuntu): /root/.nuget/NuGet/NuGet.Config

@skolima
Copy link
Collaborator

skolima commented Nov 26, 2018

NuKeeper uses NuGet own libraries to resolve and parse the nuget.config files, there's nothing custom there, in the sense that you should be getting the same sources resolved as NuGet/dotnet core would. Check the output of a verbose run, the probing paths should be listed near the start of the log.

@JBoothUA
Copy link
Author

JBoothUA commented Nov 26, 2018

Hi @skolima thanks for the help!! Here is the start of my log, could you point out what I should be looking for here??

I verified the same errors happen on my peers machine.. None of us have any issues pulling or publishing to our AzureDevOps artifact feeds, but there must be something that we're missing that makes it all work that NuKeeper isn't aware of???

Here is the log, after this I just get the same error repeated over and over:
You can see the error thrown on Autofac when I include my private repo as a source, but Autofac is not one of our packages...

C:\Users\jbooth1\Source\Repos\NuKeeper [master ≡]> dotnet run -p NuKeeper\NuKeeper.csproj -- repo {REPO_URL} { PAT } --source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json --maxpr 5 --consolidate --verbosity detailed
Using launch settings from NuKeeper\Properties\launchSettings.json...
Matched uri 'https://dev.azure.com/hexagon-si-gpc/' to collaboration platform 'AzureDevOps'
FindPushFork. Fork Mode is SingleRepositoryOnly
2018-11-26T21:52:45Z: Started
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\70b32c8371ab44e783bbc619f993b16a
Deleted folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\70b32c8371ab44e783bbc619f993b16a
User name missing from profile, falling back to .gitconfig
GetGitRepositories: Requesting OTHERHEXPRODS.SCPSAS/_apis/git/repositories?api-version=4.1
Using upstream fork as push, for project OTHERHEXPRODS.SCPSAS at https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/
Repository search failed. NotImplementedException : The method or operation is not implemented.
at NuKeeper.AzureDevOps.AzureDevOpsPlatform.Search(SearchCodeRequest search) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.AzureDevOps\AzureDevopsPlatform.cs:line 105
at NuKeeper.Engine.RepositoryFilter.ContainsDotNetProjects(RepositorySettings repository) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\RepositoryFilter.cs:line 31
Git clone https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ to C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\ec53cff3e1e544159254ae4eb0aaa8dd
0 / 1975
197 / 1975
394 / 1975
591 / 1975
788 / 1975
985 / 1975
1182 / 1975
1379 / 1975
1576 / 1975
1773 / 1975
1970 / 1975
Git clone complete
Found 457 packages in use, 259 distinct, in 6 projects.
Autofac, Autofac.Extensions.DependencyInjection, Autofac.Extras.DynamicProxy, Autofac.ServiceFabric, AutoMapper, AutoMapper.Extensions.Microsoft.DependencyInjection, Castle.Core, codecracker.CSharp, FsCheck, FsCheck.Xunit, FSharp.Core, Hexagon.Galileo.Common.CommonConfiguration, Hexagon.Galileo.Common.CommonConfiguration.Abstractions, Hexagon.Galileo.Common.CommonFeatureFlag.Middleware, Hexagon.Galileo.Common.CommonFeatureFlagService.Abstractions, Hexagon.Galileo.Common.CommonTenantService.Abstractions, Hexagon.Galileo.Common.Context, Hexagon.Galileo.Common.Context.Abstractions, Hexagon.Galileo.Common.CosmosDB, Hexagon.Galileo.Common.FaultPolicies, Hexagon.Galileo.Common.FaultPolicy.Configuration, Hexagon.Galileo.Common.FaultPolicy.Configuration.ServiceFabric, Hexagon.Galileo.Common.FeatureFlag.Middleware, Hexagon.Galileo.Common.FeatureFlags, Hexagon.Galileo.Common.FeatureFlagService.Abstractions, Hexagon.Galileo.Common.Generators, Hexagon.Galileo.Common.Logging, Hexagon.Galileo.Common.Logging.Abstractions, Hexagon.Galileo.Common.Logging.Configuration, Hexagon.Galileo.Common.Logging.Configuration.ServiceFabric, Hexagon.Galileo.Common.Provider.Abstractions, Hexagon.Galileo.Common.ResourceConfiguration, Hexagon.Galileo.Common.RestApi.Abstractions, Hexagon.Galileo.Common.Security, Hexagon.Galileo.Common.Security.Configuration, Hexagon.Galileo.Common.ServiceHelper, Hexagon.Galileo.Common.SessionContext.Middleware, Hexagon.Galileo.Common.TestHelpers, Hexagon.Galileo.Common.UserService.Abstractions, Hexagon.Galileo.ResourceService.Abstractions, jquery.TypeScript.DefinitelyTyped, Microsoft.ApplicationInsights, Microsoft.ApplicationInsights.Agent.Intercept, Microsoft.ApplicationInsights.AspNetCore, Microsoft.ApplicationInsights.DependencyCollector, Microsoft.ApplicationInsights.PerfCounterCollector, Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel, Microsoft.AspNetCore, Microsoft.AspNetCore.Antiforgery, Microsoft.AspNetCore.Authentication, Microsoft.AspNetCore.Authentication.Abstractions, Microsoft.AspNetCore.Authentication.Cookies, Microsoft.AspNetCore.Authentication.Core, Microsoft.AspNetCore.Authentication.JwtBearer, Microsoft.AspNetCore.Authentication.OAuth, Microsoft.AspNetCore.Authentication.OpenIdConnect, Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Authorization.Policy, Microsoft.AspNetCore.Cors, Microsoft.AspNetCore.Cryptography.Internal, Microsoft.AspNetCore.DataProtection, Microsoft.AspNetCore.DataProtection.Abstractions, Microsoft.AspNetCore.DataProtection.AzureStorage, Microsoft.AspNetCore.DataProtection.Extensions, Microsoft.AspNetCore.DataProtection.Redis, Microsoft.AspNetCore.Diagnostics.Abstractions, Microsoft.AspNetCore.Hosting, Microsoft.AspNetCore.Hosting.Abstractions, Microsoft.AspNetCore.Hosting.Server.Abstractions, Microsoft.AspNetCore.Html.Abstractions, Microsoft.AspNetCore.Http, Microsoft.AspNetCore.Http.Abstractions, Microsoft.AspNetCore.Http.Extensions, Microsoft.AspNetCore.Http.Features, Microsoft.AspNetCore.HttpOverrides, Microsoft.AspNetCore.JsonPatch, Microsoft.AspNetCore.Localization, Microsoft.AspNetCore.Mvc, Microsoft.AspNetCore.Mvc.Abstractions, Microsoft.AspNetCore.Mvc.ApiExplorer, Microsoft.AspNetCore.Mvc.Core, Microsoft.AspNetCore.Mvc.Cors, Microsoft.AspNetCore.Mvc.DataAnnotations, Microsoft.AspNetCore.Mvc.Formatters.Json, Microsoft.AspNetCore.Mvc.Localization, Microsoft.AspNetCore.Mvc.Razor, Microsoft.AspNetCore.Mvc.Razor.Extensions, Microsoft.AspNetCore.Mvc.RazorPages, Microsoft.AspNetCore.Mvc.TagHelpers, Microsoft.AspNetCore.Mvc.ViewFeatures, Microsoft.AspNetCore.Razor, Microsoft.AspNetCore.Razor.Language, Microsoft.AspNetCore.Razor.Runtime, Microsoft.AspNetCore.ResponseCaching.Abstractions, Microsoft.AspNetCore.Routing, Microsoft.AspNetCore.Routing.Abstractions, Microsoft.AspNetCore.Session, Microsoft.AspNetCore.SignalR, Microsoft.AspNetCore.SignalR.Redis, Microsoft.AspNetCore.StaticFiles, Microsoft.AspNetCore.WebUtilities, Microsoft.Azure.DocumentDB, Microsoft.Azure.KeyVault, Microsoft.Azure.KeyVault.Core, Microsoft.Azure.KeyVault.WebKey, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.Common, Microsoft.CodeAnalysis.CSharp, Microsoft.CodeAnalysis.Razor, Microsoft.CSharp, Microsoft.Data.Edm, Microsoft.Data.OData, Microsoft.Data.Services.Client, Microsoft.DotNet.PlatformAbstractions, Microsoft.Extensions.Caching.Abstractions, Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Caching.Redis, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Abstractions, Microsoft.Extensions.Configuration.EnvironmentVariables, Microsoft.Extensions.Configuration.FileExtensions, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.DiagnosticAdapter, Microsoft.Extensions.FileProviders.Abstractions, Microsoft.Extensions.FileProviders.Composite, Microsoft.Extensions.FileProviders.Physical, Microsoft.Extensions.FileSystemGlobbing, Microsoft.Extensions.Hosting.Abstractions, Microsoft.Extensions.Localization, Microsoft.Extensions.Localization.Abstractions, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.Logging.Debug, Microsoft.Extensions.ObjectPool, Microsoft.Extensions.Options, Microsoft.Extensions.Primitives, Microsoft.Extensions.WebEncoders, Microsoft.IdentityModel.Clients.ActiveDirectory, Microsoft.IdentityModel.Logging, Microsoft.IdentityModel.Protocols, Microsoft.IdentityModel.Protocols.OpenIdConnect, Microsoft.IdentityModel.Tokens, Microsoft.Net.Http.Headers, Microsoft.NETCore.Platforms, Microsoft.Rest.ClientRuntime, Microsoft.Rest.ClientRuntime.Azure, Microsoft.ServiceFabric, Microsoft.ServiceFabric.Actors, Microsoft.ServiceFabric.AspNetCore.Kestrel, Microsoft.ServiceFabric.Data, Microsoft.ServiceFabric.Diagnostics.Internal, Microsoft.ServiceFabric.FabricTransport.Internal, Microsoft.ServiceFabric.Services, Microsoft.ServiceFabric.Services.Remoting, Microsoft.VisualStudio.Azure.Fabric.MSBuild, Microsoft.VisualStudio.Web.BrowserLink, Microsoft.Win32.Registry, Moq, NETStandard.Library, Newtonsoft.Json, Newtonsoft.Json.Bson, Polly, Serilog, Serilog.AspNetCore, Serilog.Enrichers.Thread, Serilog.Extensions.Logging, Serilog.Sinks.ApplicationInsights, Serilog.Sinks.Async, Serilog.Sinks.AzureTableStorage, Serilog.Sinks.Console, Serilog.Sinks.File, Serilog.Sinks.Observable, Serilog.Sinks.PeriodicBatching, Serilog.Sinks.RollingFile, signalr.TypeScript.DefinitelyTyped, StackExchange.Redis.StrongName, StyleCop.Analyzers, System.AppContext, System.Buffers, System.Collections, System.Collections.Concurrent, System.Collections.Immutable, System.ComponentModel, System.ComponentModel.Annotations, System.ComponentModel.EventBasedAsync, System.Console, System.Diagnostics.Contracts, System.Diagnostics.Debug, System.Diagnostics.DiagnosticSource, System.Diagnostics.FileVersionInfo, System.Diagnostics.StackTrace, System.Diagnostics.Tools, System.Dynamic.Runtime, System.Globalization, System.IdentityModel.Tokens.Jwt, System.IO, System.IO.Compression, System.IO.FileSystem, System.IO.FileSystem.Primitives, System.Linq, System.Linq.Expressions, System.Linq.Queryable, System.Memory, System.Net.Http, System.Net.Requests, System.Numerics.Vectors, System.Reactive, System.Reactive.Core, System.Reactive.Interfaces, System.Reactive.Linq, System.Reactive.PlatformServices, System.Reactive.Windows.Threading, System.Reflection, System.Reflection.Extensions, System.Reflection.Metadata, System.Resources.ResourceManager, System.Runtime, System.Runtime.CompilerServices.Unsafe, System.Runtime.Extensions, System.Runtime.InteropServices, System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.WindowsRuntime, System.Runtime.Numerics, System.Security.AccessControl, System.Security.Claims, System.Security.Cryptography.Algorithms, System.Security.Cryptography.Encoding, System.Security.Cryptography.Primitives, System.Security.Cryptography.X509Certificates, System.Security.Cryptography.Xml, System.Security.Permissions, System.Security.Principal.Windows, System.Spatial, System.Text.Encoding, System.Text.Encoding.CodePages, System.Text.Encoding.Extensions, System.Text.Encodings.Web, System.Text.RegularExpressions, System.Threading, System.Threading.Tasks, System.Threading.Tasks.Extensions, System.Threading.Tasks.Parallel, System.Threading.Thread, System.Threading.Timer, System.ValueTuple, System.Xml.ReaderWriter, System.Xml.XDocument, System.Xml.XmlDocument, System.Xml.XPath, System.Xml.XPath.XDocument, TypeWriter.Proxy.Templates, WindowsAzure.Storage, xunit.abstractions, xunit.extensibility.core, xunit.extensibility.execution, xunit.runner.visualstudio
Error getting Autofac from https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
**Error getting Autofac.Extensions.DependencyInjection from https://hexagon-si-**gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
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.PackageMetadataResourceV3Provider.TryCreate(SourceRepository source, CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T](CancellationToken token)
at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsyncT
at NuKeeper.Inspection.NuGetApi.PackageVersionsLookup.RunFinderForSource(String packageName, Boolean includePrerelease, PackageSource source) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.Inspection\NuGetApi\PackageVersionsLookup.cs:line 47
Error getting codecracker.CSharp from https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json [https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json] FatalProtocolException : Unable to load the service index for source https://hexagon-si-gpc.pkgs.visualstudio.com/_packaging/Galileo/nuget/v3/index.json.
at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3(SourceRepository source, DateTime utcNow, ILogger log, CancellationToken token)

@shep1987
Copy link
Member

Hey @JBoothUA You just posted your PAT please revoke it asap

@JBoothUA
Copy link
Author

i caught that too, thanks!

@JBoothUA
Copy link
Author

JBoothUA commented Nov 26, 2018

In case this helps any, here is the start of the output for the same command, except here I specify nuget.org as a source. this works much better.

I'm starting to think that it might be related to what @travisgosselin mentioned in his comment above.

All of our devs do add our private feed to Visual Studio's Tools -> Options -> NuGet Package Manager -> Package Sources.. Maybe adding it to VS in this manner is doing something for our local machines that NuKeeper doesn't know to look for?? Just guessing at this point...

C:\Users\jbooth1\Source\Repos\NuKeeper [master ≡]> dotnet run -p NuKeeper\NuKeeper.csproj -- repo {REPO URL } { PAT }--source https://api.nuget.org/v3/index.json --maxpr 5 --consolidate --verbosity detailed
Using launch settings from NuKeeper\Properties\launchSettings.json...
Matched uri 'https://dev.azure.com/hexagon-si-gpc/' to collaboration platform 'AzureDevOps'
FindPushFork. Fork Mode is SingleRepositoryOnly
2018-11-26T22:45:51Z: Started
Attempting delete of folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\afebcd100e644ca3a8d067a6b61a4a15
Deleted folder C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\afebcd100e644ca3a8d067a6b61a4a15
User name missing from profile, falling back to .gitconfig
GetGitRepositories: Requesting OTHERHEXPRODS.SCPSAS/_apis/git/repositories?api-version=4.1
Using upstream fork as push, for project OTHERHEXPRODS.SCPSAS at https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/
Repository search failed. NotImplementedException : The method or operation is not implemented.
at NuKeeper.AzureDevOps.AzureDevOpsPlatform.Search(SearchCodeRequest search) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper.AzureDevOps\AzureDevopsPlatform.cs:line 105
at NuKeeper.Engine.RepositoryFilter.ContainsDotNetProjects(RepositorySettings repository) in C:\Users\jbooth1\Source\Repos\NuKeeper\NuKeeper\Engine\RepositoryFilter.cs:line 31
Git clone https://dev.azure.com/hexagon-si-gpc/OTHERHEXPRODS.SCPSAS/_git/CommonSite/ to C:\Users\jbooth1\AppData\Local\Temp\NuKeeper\03e2d50d67db444f9a855cf6fc1fd4d4
0 / 1975
197 / 1975
394 / 1975
591 / 1975
788 / 1975
985 / 1975
1182 / 1975
1379 / 1975
1576 / 1975
1773 / 1975
1970 / 1975
Git clone complete
Found 457 packages in use, 259 distinct, in 6 projects.
Autofac, Autofac.Extensions.DependencyInjection, Autofac.Extras.DynamicProxy, Autofac.ServiceFabric, AutoMapper, AutoMapper.Extensions.Microsoft.DependencyInjection, Castle.Core, codecracker.CSharp, FsCheck, FsCheck.Xunit, FSharp.Core, Hexagon.Galileo.Common.CommonConfiguration, Hexagon.Galileo.Common.CommonConfiguration.Abstractions, Hexagon.Galileo.Common.CommonFeatureFlag.Middleware, Hexagon.Galileo.Common.CommonFeatureFlagService.Abstractions, Hexagon.Galileo.Common.CommonTenantService.Abstractions, Hexagon.Galileo.Common.Context, Hexagon.Galileo.Common.Context.Abstractions, Hexagon.Galileo.Common.CosmosDB, Hexagon.Galileo.Common.FaultPolicies, Hexagon.Galileo.Common.FaultPolicy.Configuration, Hexagon.Galileo.Common.FaultPolicy.Configuration.ServiceFabric, Hexagon.Galileo.Common.FeatureFlag.Middleware, Hexagon.Galileo.Common.FeatureFlags, Hexagon.Galileo.Common.FeatureFlagService.Abstractions, Hexagon.Galileo.Common.Generators, Hexagon.Galileo.Common.Logging, Hexagon.Galileo.Common.Logging.Abstractions, Hexagon.Galileo.Common.Logging.Configuration, Hexagon.Galileo.Common.Logging.Configuration.ServiceFabric, Hexagon.Galileo.Common.Provider.Abstractions, Hexagon.Galileo.Common.ResourceConfiguration, Hexagon.Galileo.Common.RestApi.Abstractions, Hexagon.Galileo.Common.Security, Hexagon.Galileo.Common.Security.Configuration, Hexagon.Galileo.Common.ServiceHelper, Hexagon.Galileo.Common.SessionContext.Middleware, Hexagon.Galileo.Common.TestHelpers, Hexagon.Galileo.Common.UserService.Abstractions, Hexagon.Galileo.ResourceService.Abstractions, jquery.TypeScript.DefinitelyTyped, Microsoft.ApplicationInsights, Microsoft.ApplicationInsights.Agent.Intercept, Microsoft.ApplicationInsights.AspNetCore, Microsoft.ApplicationInsights.DependencyCollector, Microsoft.ApplicationInsights.PerfCounterCollector, Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel, Microsoft.AspNetCore, Microsoft.AspNetCore.Antiforgery, Microsoft.AspNetCore.Authentication, Microsoft.AspNetCore.Authentication.Abstractions, Microsoft.AspNetCore.Authentication.Cookies, Microsoft.AspNetCore.Authentication.Core, Microsoft.AspNetCore.Authentication.JwtBearer, Microsoft.AspNetCore.Authentication.OAuth, Microsoft.AspNetCore.Authentication.OpenIdConnect, Microsoft.AspNetCore.Authorization, Microsoft.AspNetCore.Authorization.Policy, Microsoft.AspNetCore.Cors, Microsoft.AspNetCore.Cryptography.Internal, Microsoft.AspNetCore.DataProtection, Microsoft.AspNetCore.DataProtection.Abstractions, Microsoft.AspNetCore.DataProtection.AzureStorage, Microsoft.AspNetCore.DataProtection.Extensions, Microsoft.AspNetCore.DataProtection.Redis, Microsoft.AspNetCore.Diagnostics.Abstractions, Microsoft.AspNetCore.Hosting, Microsoft.AspNetCore.Hosting.Abstractions, Microsoft.AspNetCore.Hosting.Server.Abstractions, Microsoft.AspNetCore.Html.Abstractions, Microsoft.AspNetCore.Http, Microsoft.AspNetCore.Http.Abstractions, Microsoft.AspNetCore.Http.Extensions, Microsoft.AspNetCore.Http.Features, Microsoft.AspNetCore.HttpOverrides, Microsoft.AspNetCore.JsonPatch, Microsoft.AspNetCore.Localization, Microsoft.AspNetCore.Mvc, Microsoft.AspNetCore.Mvc.Abstractions, Microsoft.AspNetCore.Mvc.ApiExplorer, Microsoft.AspNetCore.Mvc.Core, Microsoft.AspNetCore.Mvc.Cors, Microsoft.AspNetCore.Mvc.DataAnnotations, Microsoft.AspNetCore.Mvc.Formatters.Json, Microsoft.AspNetCore.Mvc.Localization, Microsoft.AspNetCore.Mvc.Razor, Microsoft.AspNetCore.Mvc.Razor.Extensions, Microsoft.AspNetCore.Mvc.RazorPages, Microsoft.AspNetCore.Mvc.TagHelpers, Microsoft.AspNetCore.Mvc.ViewFeatures, Microsoft.AspNetCore.Razor, Microsoft.AspNetCore.Razor.Language, Microsoft.AspNetCore.Razor.Runtime, Microsoft.AspNetCore.ResponseCaching.Abstractions, Microsoft.AspNetCore.Routing, Microsoft.AspNetCore.Routing.Abstractions, Microsoft.AspNetCore.Session, Microsoft.AspNetCore.SignalR, Microsoft.AspNetCore.SignalR.Redis, Microsoft.AspNetCore.StaticFiles, Microsoft.AspNetCore.WebUtilities, Microsoft.Azure.DocumentDB, Microsoft.Azure.KeyVault, Microsoft.Azure.KeyVault.Core, Microsoft.Azure.KeyVault.WebKey, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.Common, Microsoft.CodeAnalysis.CSharp, Microsoft.CodeAnalysis.Razor, Microsoft.CSharp, Microsoft.Data.Edm, Microsoft.Data.OData, Microsoft.Data.Services.Client, Microsoft.DotNet.PlatformAbstractions, Microsoft.Extensions.Caching.Abstractions, Microsoft.Extensions.Caching.Memory, Microsoft.Extensions.Caching.Redis, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Abstractions, Microsoft.Extensions.Configuration.EnvironmentVariables, Microsoft.Extensions.Configuration.FileExtensions, Microsoft.Extensions.Configuration.Json, Microsoft.Extensions.DependencyInjection, Microsoft.Extensions.DependencyInjection.Abstractions, Microsoft.Extensions.DependencyModel, Microsoft.Extensions.DiagnosticAdapter, Microsoft.Extensions.FileProviders.Abstractions, Microsoft.Extensions.FileProviders.Composite, Microsoft.Extensions.FileProviders.Physical, Microsoft.Extensions.FileSystemGlobbing, Microsoft.Extensions.Hosting.Abstractions, Microsoft.Extensions.Localization, Microsoft.Extensions.Localization.Abstractions, Microsoft.Extensions.Logging, Microsoft.Extensions.Logging.Abstractions, Microsoft.Extensions.Logging.Debug, Microsoft.Extensions.ObjectPool, Microsoft.Extensions.Options, Microsoft.Extensions.Primitives, Microsoft.Extensions.WebEncoders, Microsoft.IdentityModel.Clients.ActiveDirectory, Microsoft.IdentityModel.Logging, Microsoft.IdentityModel.Protocols, Microsoft.IdentityModel.Protocols.OpenIdConnect, Microsoft.IdentityModel.Tokens, Microsoft.Net.Http.Headers, Microsoft.NETCore.Platforms, Microsoft.Rest.ClientRuntime, Microsoft.Rest.ClientRuntime.Azure, Microsoft.ServiceFabric, Microsoft.ServiceFabric.Actors, Microsoft.ServiceFabric.AspNetCore.Kestrel, Microsoft.ServiceFabric.Data, Microsoft.ServiceFabric.Diagnostics.Internal, Microsoft.ServiceFabric.FabricTransport.Internal, Microsoft.ServiceFabric.Services, Microsoft.ServiceFabric.Services.Remoting, Microsoft.VisualStudio.Azure.Fabric.MSBuild, Microsoft.VisualStudio.Web.BrowserLink, Microsoft.Win32.Registry, Moq, NETStandard.Library, Newtonsoft.Json, Newtonsoft.Json.Bson, Polly, Serilog, Serilog.AspNetCore, Serilog.Enrichers.Thread, Serilog.Extensions.Logging, Serilog.Sinks.ApplicationInsights, Serilog.Sinks.Async, Serilog.Sinks.AzureTableStorage, Serilog.Sinks.Console, Serilog.Sinks.File, Serilog.Sinks.Observable, Serilog.Sinks.PeriodicBatching, Serilog.Sinks.RollingFile, signalr.TypeScript.DefinitelyTyped, StackExchange.Redis.StrongName, StyleCop.Analyzers, System.AppContext, System.Buffers, System.Collections, System.Collections.Concurrent, System.Collections.Immutable, System.ComponentModel, System.ComponentModel.Annotations, System.ComponentModel.EventBasedAsync, System.Console, System.Diagnostics.Contracts, System.Diagnostics.Debug, System.Diagnostics.DiagnosticSource, System.Diagnostics.FileVersionInfo, System.Diagnostics.StackTrace, System.Diagnostics.Tools, System.Dynamic.Runtime, System.Globalization, System.IdentityModel.Tokens.Jwt, System.IO, System.IO.Compression, System.IO.FileSystem, System.IO.FileSystem.Primitives, System.Linq, System.Linq.Expressions, System.Linq.Queryable, System.Memory, System.Net.Http, System.Net.Requests, System.Numerics.Vectors, System.Reactive, System.Reactive.Core, System.Reactive.Interfaces, System.Reactive.Linq, System.Reactive.PlatformServices, System.Reactive.Windows.Threading, System.Reflection, System.Reflection.Extensions, System.Reflection.Metadata, System.Resources.ResourceManager, System.Runtime, System.Runtime.CompilerServices.Unsafe, System.Runtime.Extensions, System.Runtime.InteropServices, System.Runtime.InteropServices.RuntimeInformation, System.Runtime.InteropServices.WindowsRuntime, System.Runtime.Numerics, System.Security.AccessControl, System.Security.Claims, System.Security.Cryptography.Algorithms, System.Security.Cryptography.Encoding, System.Security.Cryptography.Primitives, System.Security.Cryptography.X509Certificates, System.Security.Cryptography.Xml, System.Security.Permissions, System.Security.Principal.Windows, System.Spatial, System.Text.Encoding, System.Text.Encoding.CodePages, System.Text.Encoding.Extensions, System.Text.Encodings.Web, System.Text.RegularExpressions, System.Threading, System.Threading.Tasks, System.Threading.Tasks.Extensions, System.Threading.Tasks.Parallel, System.Threading.Thread, System.Threading.Timer, System.ValueTuple, System.Xml.ReaderWriter, System.Xml.XDocument, System.Xml.XmlDocument, System.Xml.XPath, System.Xml.XPath.XDocument, TypeWriter.Proxy.Templates, WindowsAzure.Storage, xunit.abstractions, xunit.extensibility.core, xunit.extensibility.execution, xunit.runner.visualstudio
GET https://api.nuget.org/v3/registration3-gz-semver2/codecracker.csharp/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.commonfeatureflag.middleware/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.logging/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.security/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.context/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.logging.abstractions/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.logging.configuration.servicefabric/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/autofac/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/autofac.extensions.dependencyinjection/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.sessioncontext.middleware/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.dataprotection/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/hexagon.galileo.common.servicehelper/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.authentication.core/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.http/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.mvc/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.applicationinsights.aspnetcore/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.signalr/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.extensions.caching.abstractions/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.aspnetcore.signalr.redis/index.json
GET https://api.nuget.org/v3/registration3-gz-semver2/microsoft.servicefabric/index.json

@skolima
Copy link
Collaborator

skolima commented Nov 27, 2018

My bad. If you include --source parameter, NuKeeper skips reading the NuGet.config file, as you've requested an override. What happens when you run without it?

@MarcBruins
Copy link
Member

MarcBruins commented Nov 27, 2018

For my current project we use NuKeeper in the build pipeline and also have a private nuget feed. I've tackled the issue by using a token replace task and then using the NuKeeper task:

pipeline

For more info on the Replace token task
And the NuKeeper task is here

The Nuget.Config is straightforward:

<packageSourceCredentials> <VSTS> <add key="Username" value="dontcare@dontcare.com" /> <add key="ClearTextPassword" value="__System.AccessToken__" /> </VSTS> </packageSourceCredentials>

@AnthonySteele
Copy link
Member

Is there anything simple that NuKeeper can do to make it easier to plug these tokens into the urls?
Maybe read and replace with env vars, e.g. http:/feed.url?token={{env-var-name}}

@travisgosselin
Copy link

I can also confirm that Nukeeper does in fact seem to be reading my Windows / user level NuGet.Config properly for authorizing against private feeds. However, my main use case is to have this functionality of using the machine level NuGet.Config inside a docker container.... which it never seems to pick up (not sure if this is a container or a linux issue specifically).

@shep1987
Copy link
Member

shep1987 commented Nov 28, 2018

Ok have made some progress..
I managed to replicate the problem and it does seem to be auth releated, as the inner exception in RunFinderForSource throws a 401. I will get a pr in for this to add the additional logging.

By using https://github.com/Microsoft/artifacts-credprovider/ I can get ExternalProcess.Run to not throw as it uses a cached token from the credential provider, however i am yet to find a way to use the same provider for RunFinderForSource

However i can get round all these problems by adding:
N.B. Galileo is the name of the key in the checked in Nuget.config

  <packageSourceCredentials>
        <Galileo>
            <add key="Username" value="VssSessionToken" />
            <add key="ClearTextPassword" value="{HARDCODED_PAT}" />
        </Galileo>
    </packageSourceCredentials>

to %appdata%\NuGet\NuGet.Config

@JBoothUA
Copy link
Author

@shep1987 I think you're right on the money, I was able to put that in place and run without any of the errors!!! It appears that I have to put that information in the %appdata% config as well as the nuget config inside of the repo. But I was able to get rid of the errors!!

@JBoothUA
Copy link
Author

JBoothUA commented Nov 29, 2018

Took it to my final test case... Using the --include ^Hexagon. flag to make sure it got to OUR packages, updating to our repo (both in Azure DevOps)

And I am still getting an error (although this one is new..) it does appear to have helped!

If there is anything you can do to make it easier, where I dont have to put the credentials in the %appdata% AND in the NuGet.config that lives in the repo, that would be helpful.

Also if the PAT is included in the NuGet.config files does it have to be a required command line arguement? I guess it is supposed to not be required if it is set to an environment variable, but that doesn't seem to be the case (unless I'm using the wrong env var)

But I think it is very close!!

Now I'm getting an issue that seems to have been open before:

"Cannot determine the packages folder to restore NuGet packages. Please specify either -PackagesDirectory or -SolutionDirectory."

I tried adding the flag to the end of the NuKeeper command but it didn't appear to be a valid NuKeeper argument.

Update the %appdata% nuget.config did get rid of the original errors!

So now I'm on my very very final test case!

Here is the issue I'm getting:
#72
Unfortunately, this issue is resolved, so not sure why it resurfaced here?

@ransagy
Copy link
Contributor

ransagy commented Aug 22, 2019

I know it's a bit old; But I'm facing exactly the same issues.

I have the hard-coded clear text password in both the repo-root located NuGet.config and in the %appdata%\NuGet\NuGet.Config files, But i still get 401 errors on everything NuKeeper tries to do. A detailed log shows it is picking up on both those files and dotnet/nuget.exe etc all authenticate well. I am using the cred provider as suggested.

Any suggestions would be very welcome.

@ransagy
Copy link
Contributor

ransagy commented Aug 28, 2019

I've added PR #868 to resolve the issues i had with this - auth issues mainly. With that, I can update NuGets against our Azure Artifacts repo perfectly.

@schamal2205
Copy link

@ransagy do you have any idea when this will be merged?
I'm highly waiting for this fix to update NuGets agains Azure Artifacts repo.

@ransagy
Copy link
Contributor

ransagy commented Oct 16, 2019

@Bene2205 That's a question for the maintainers, I'm afraid. I've been using it since and haven't noticed any issues, but i only test this scenario at work - So i don't know if anything else is impacted.

@Bouke
Copy link
Contributor

Bouke commented Dec 12, 2019

Until #868 possibly fixes this issue, I've added the following step in my Azure Builds Pipeline which writes a new NuGet.config file containing the system's access token. I simply overwrite any existing NuGet.config (mine isn't getting picked up, which is another issue: #907).

- powershell: |
    Set-Content "NuGet.Config" @"
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <packageSources>
            <clear />
            <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
            <add key="XXX" value="https://pkgs.dev.azure.com/XXX/_packaging/XXX/nuget/v3/index.json" />
        </packageSources>
        <packageSourceCredentials>
            <XXX>
                <add key="Username" value="VssAdministrator" />
                <add key="ClearTextPassword" value="$(System.AccessToken)" />
            </XXX>
        </packageSourceCredentials>
    </configuration>
    "@
  displayName: "Configure custom NuGet sources"

@npnelson
Copy link

I had good luck by adding the NuGet Authenticate Task to my pipeline to solve this problem https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/package/nuget-authenticate?view=azure-devops

I just started using NuKeeper today, so I wouldn't call this fully baked yet and might not follow all the best practices, but if I don't throw this out there now, I will forget to. I can say that the NugetAuthenticate task let me hit my own Azure Devops package feed

Here is the YAML file I ended up using:

trigger: none #don't run as CI Build
schedules:
- cron: "0 0 * * *" #run daily at UTC midnight
  branches:
     include: [master]
  always: true #always run, even if no code changes
resources:
- repo: self #always point to own repo    
       
pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NuGetAuthenticate@0

- task: NuKeeper@0
  displayName: Nukeeper 
  inputs: 
    arguments: '-a 2d -v d --consolidate -m 99'

@stale
Copy link

stale bot commented Jun 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 9, 2020
@stale stale bot closed this as completed Jun 30, 2020
@CrispyDrone
Copy link
Contributor

CrispyDrone commented Jul 18, 2020

I'm having similar problems. Since the new version:

  1. my .nuget/NuGet.Config file isn't getting picked up any more by NuKeeper (see NuGet.config not found #907)
  2. I'm either receiving Unable to load the service index for source or 401 unauthorized. I've exhausted all options.

I'm not running behind a proxy as far as I know, I'm connected to my corporate network through a VPN however. Even so I've tried all different combinations of my plaintext password, PAT (with all scopes), username, domain name for both packageSourceCredentials and config's http_proxy values to try to fix the issue, but it just isn't working.

We recently upgraded to Azure Devops Server 2019 from an older TFS2017, and just this morning I had some issues with cloning repositories that was solved by not using the https version of the url see microsoft/Git-Credential-Manager-for-Windows#904

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests