3

Using AzureDevOps I should be able to restore packages from the feeds hosted within AzureDevOps. The Nuget.config seems correct, the build has access to the feed, locally it runs fine with explicitly using the same config file.

I've seen VSTS Build vNext NuGet custom package source but would very much like to stay out of adding apikey's there. The official documentation states it should be possible: https://www.visualstudio.com/docs/package/get-started/build/team-build

NuGet.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Net2Library" value="https://xxx.pkgs.visualstudio.com/DefaultCollection/_packaging/yyy/nuget/v3/index.json" />
  </packageSources>
  <activePackageSource>
    <add key="All" value="(Aggregate source)" />
  </activePackageSource>
</configuration>

Feed settings enter image description here

Restore settings (it uses the correct config, visible from listing the feed in the logs)

enter image description here

Relevant logs:

2016-07-30T12:33:37.8085538Z Restoring NuGet package XYZ.2016.7.29.14.
2016-07-30T12:33:42.6885539Z Unable to find version '2016.7.29.14' of package 'XYZ'.
2016-07-30T12:33:42.6915543Z Feeds used:
2016-07-30T12:33:42.6925542Z   C:\Users\buildguest\AppData\Local\NuGet\Cache
2016-07-30T12:33:42.6925542Z   C:\Users\buildguest\.nuget\packages\
2016-07-30T12:33:42.6925542Z   https://api.nuget.org/v3/index.json
2016-07-30T12:33:42.6935552Z   https://xxx.pkgs.visualstudio.com/DefaultCollection/_packaging/yyy/nuget/v3/index.json
2016-07-30T12:33:42.7235541Z ##[debug]rc:1
2016-07-30T12:33:42.7245545Z ##[debug]success:false
2016-07-30T12:33:42.7325527Z ##[error]Error: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.103.1\agent\Worker\Tools\nuget.exe failed with return code: 1
2016-07-30T12:33:42.7335525Z ##[error]Packages failed to install
2016-07-30T12:33:42.7335525Z ##[debug]task result: Failed
2016-07-30T12:33:42.7345538Z ##[error]Return code: 1
PiJei
  • 584
  • 4
  • 19
janpieter_z
  • 1,722
  • 13
  • 28
  • I'm having a similar problem - started last night https://stackoverflow.com/questions/38679316/ . I now wonder if its me or them. – rism Jul 31 '16 at 00:40
  • @rism interesting! I didn't get more detail out of my logs, but have been having this issue for a while (not recently), although I've only this week been giving it more attention and changed a couple of settings that might cause to 'work now' but possibly having the same issue as you. I'll track your issue too and post updates here if any. – janpieter_z Jul 31 '16 at 11:32

2 Answers2

2

This is caused by VSTS issue which has been fixed by now, please try the build again.

Issue: Failures while restoring nuget packages in Visual Studio Team Services – 8/1 – Resolved

Other possible issue: Packaging issues with Visual Studio Team Services – 7/30 – Resolved .

janpieter_z
  • 1,722
  • 13
  • 28
Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • Thanks! Sadly this didn't resolve it for me. I only have one nuget package restore, which still fails by not finding the version. Thoughts? – janpieter_z Aug 01 '16 at 07:47
  • @janpieter_z Did you try the workaround in the page: If you have the above repro then, you go to your agent pool in web UI, right click, and choose “Update All Agents”? – Eddie Chen - MSFT Aug 01 '16 at 07:49
  • I tried, but was only able to do this on the Default pool, not the Hosted pool (which is what I use). Didn't have any effect. – janpieter_z Aug 01 '16 at 08:04
  • I have just submitted an incident, since (as far as I know) people at MS can then easily have access to my account and poke around. – janpieter_z Aug 01 '16 at 08:54
  • 1
    @janpieter_z A new VSTS Issue: https://blogs.msdn.microsoft.com/vsoservice/?p=12025 – Eddie Chen - MSFT Aug 02 '16 at 00:58
  • Hi Eddie, I'm still facing this error. I tried the "Update All Agents" solution (hosted agent) but I get the following error, even though I have the Build Administrator permissions: "403: Access denied. Rui Jarimba needs Manage permissions for pool Hosted to perform the action." Any suggestion? – Rui Jarimba Aug 29 '16 at 13:52
0

I'm having the exact same issue. I've been experiencing the error most of the times when the build starts from a push from the local repo (either from VS 2015 or git bash).
The workaround for me has been to queue a build directly on VSTS build definition, through "Queue Build.
It's annoying but it's the only way I found to overcome the issue. I do think this is a bug and hope MS fix it. Hope my workaround helps.

DMVC
  • 240
  • 1
  • 2
  • 15