Azure-pipelines-tasks: Nuget restore task fails while restoring from VSTS

Created on 3 Oct 2016  路  11Comments  路  Source: microsoft/azure-pipelines-tasks

Nuget restore task is failing when attempting to restore packages in VSTS build. Local restore in visual studio works fine. See log below.

Same as issue: #2173

2016-10-03T12:18:38.9198911Z ##[section]Starting: NuGet restore Platform.sln 2016-10-03T12:18:39.6564698Z [command]C:\Windows\system32\chcp.com 65001 2016-10-03T12:18:39.7014701Z Active code page: 65001 2016-10-03T12:18:39.7414706Z Detected NuGet version 3.3.0.212 / 3.3.0 2016-10-03T12:18:39.7484706Z SYSTEMVSSCONNECTION exists true 2016-10-03T12:18:39.7764701Z save nuget.config to temp config file 2016-10-03T12:18:39.7764701Z Preparing to set credentials in NuGet.config 2016-10-03T12:18:39.7774696Z [command]C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.17\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe sources Remove -NonInteractive -Name tos-nuget -ConfigFile C:\a\1\Nuget\tempNuGet_882.config 2016-10-03T12:18:40.8763939Z Package source with Name: xxx removed successfully. 2016-10-03T12:18:40.8763939Z Setting credentials in NuGet.config 2016-10-03T12:18:40.8813957Z [command]C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.17\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe sources Add -NonInteractive -Name xxx -Source https://xxx.pkgs.visualstudio.com/DefaultCollection/_packaging/xxx/nuget/v3/index.json -Username VssSessionToken -Password ******** -ConfigFile C:\a\1\Nuget\tempNuGet_882.config 2016-10-03T12:18:41.5683947Z Package Source with Name: xxx added successfully. 2016-10-03T12:18:41.5775228Z [command]C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.17\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe restore -NonInteractive C:\a\1\s\Platform.sln -ConfigFile C:\a\1\Nuget\tempNuGet_882.config 2016-10-03T12:18:42.3940437Z MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. 2016-10-03T12:18:42.5453306Z Error parsing solution file at C:\a\1\s\Platform.sln: Exception has been thrown by the target of an invocation. 2016-10-03T12:18:42.5783371Z ##[error]Error: C:\a\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.17\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1 2016-10-03T12:18:42.5783371Z ##[error]Packages failed to install 2016-10-03T12:18:42.5833372Z ##[section]Finishing: NuGet restore Platform.sln

Most helpful comment

Solved it. It was an error in my solution file. After I disabled the nuget restore task and check "restore nuget" on the build solution task I got an error message that explained what was going on.

Platform.sln(1008,0): Error MSB5023: Error parsing the nested project section in solution file. A project with the GUID "{8F2B4ACA-F351-4ED0-866B-0BB56EA083A4}" is listed as being nested under project "{2AB87963-D7EA-431D-B3C5-14AEED135243}", but does not exist in the solution.

It would be nice if the nuget task would return better exception messages...

All 11 comments

I've seen there was an issue with this a month ago, and that it was solved then. But it seems to be back.
https://blogs.msdn.microsoft.com/vsoservice/?p=12025

Solved it. It was an error in my solution file. After I disabled the nuget restore task and check "restore nuget" on the build solution task I got an error message that explained what was going on.

Platform.sln(1008,0): Error MSB5023: Error parsing the nested project section in solution file. A project with the GUID "{8F2B4ACA-F351-4ED0-866B-0BB56EA083A4}" is listed as being nested under project "{2AB87963-D7EA-431D-B3C5-14AEED135243}", but does not exist in the solution.

It would be nice if the nuget task would return better exception messages...

I am having a similar issue but I don't see anything mentioned on their blog about thier service being down. Here is my exact error message:

Error: C:\Agent_work_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.17\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
Packages failed to install

I had a similar error. For me changing to have the build solution task do the nuget package restore did not work. Instead I had to update the NuGet Restore task to use the less stable 3.5.0 preview build, instead of the default 3.3.0 build.

@deadlydog Thanks for the suggestion! I selected the 3.5.0 preview build and still had errors, although different this time (seems to be related to NuGet and the latest version of Xamarin being to long when zipping). I will get back to you with additional information once I figure out more.

In my case it was caused by package(s)/version that can not be found by nuget. These packages are hosted in our corporate nuget server. To fix the issue I added our corporate nuget package source in my solution's NugGet.config.

I added this under packageSources element:

<add key="Corporate Package" value="http://mydomainOrIP/nuget" />

This will inform nuget to check the package in this source. This will fix warnings that causes the nuget to fail.

Example warning:
Unable to find version '1.1.31' of package 'Package name'.

Make sure you have a NuGet.config file with proper sources (could be your corporate NuGet feed source, the actual NuGet feed, etc.).

Landed here having issues for nested nuget.config in our project - seems this task doesn't support the inheritance approach of having multiple nuget.config and bringing in the parent.

Our scenario is that we have 60+ projects that we'd like to share nuget packages root so we used this approach at the child level:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="..\..\packages" />
  </config>
</configuration>

The nuget feeds are declared at the parent level - so the pipeline task outputs the following when using the child nuget.config:

##[warning]No package sources were found in the NuGet.config file

Our only resolution is to drop the inheritance chaining for feeds at the parent level (which is supported by VS IDE) and have each child duplicate the feeds.

Hi am having the following issue can someone look into it

Error: C:\hostedtoolcache\windows\NuGet\4.4.1\x64\nuget.exe failed with return code: 1

Change the Nuget version 4.4.1 to 5.5.1 latest version and run the build. It works for me

Hi am having the following issue can someone look into it

Error: C:\hostedtoolcache\windows\NuGet\4.4.1\x64\nuget.exe failed with return code: 1

Change it to 5.5.1 in the Build configuration.

Was this page helpful?
0 / 5 - 0 ratings