Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet restore failing in VSTS task #5265

Closed
livarcocc opened this issue May 22, 2017 · 6 comments
Closed

dotnet restore failing in VSTS task #5265

livarcocc opened this issue May 22, 2017 · 6 comments

Comments

@livarcocc
Copy link

From @singharun1990 on May 22, 2017 18:9

Steps to reproduce

In VSTS Build definition we have a task to restore one of the dotnet core project before building it so that we are able to resolve all the dependencies and it fails with following error:
"C:\Program Files\dotnet\dotnet.exe" restore d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj -v diag
C:\Program Files\dotnet\sdk\1.0.3\MSBuild.dll /NoLogo /ConsoleLoggerParameters:Verbosity=Minimal /m /t:Restore /v:m /verbosity:diag d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj
Restoring packages for d:\a\1\s\UserDataStoreService.Core\UserDataStoreService.Core.csproj...
Restoring packages for d:\a\1\s\UserDataStoreService.Persistance\UserDataStoreService.Persistance.csproj...
C:\Program Files\dotnet\sdk\1.0.3\NuGet.targets(97,5): error : Unable to load the service index for source https://microsoftxxxx.pkgs.visualstudio.com/_packaging/xxxxxxxxxxx.. [d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj]
C:\Program Files\dotnet\sdk\1.0.3\NuGet.targets(97,5): error : Response status code does not indicate success: 401 (Unauthorized). [d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj]

We are using a custom package as well

getting same error from running dotnet restore locally as well

PS C:\Repos\UserDataStoreService\UserDataStoreService> dotnet restore .\UserDataStoreService.csproj
Restoring packages for C:\Repos\UserDataStoreService\UserDataStoreService\UserDataStoreService.csproj...
Restoring packages for C:\Repos\UserDataStoreService\UserDataStoreService.Core\UserDataStoreService.Core.csproj...
Restoring packages for C:\Repos\UserDataStoreService\UserDataStoreService.Persistance\UserDataStoreService.Persistance.csproj...
Restoring packages for C:\Repos\UserDataStoreService\UserDataStoreService\UserDataStoreService.csproj...
Lock file has not changed. Skipping lock file write. Path: C:\Repos\UserDataStoreService\UserDataStoreService.Persistance\obj\project.assets.json
Lock file has not changed. Skipping lock file write. Path: C:\Repos\UserDataStoreService\UserDataStoreService.Core\obj\project.assets.json
Restore completed in 1.28 sec for C:\Repos\UserDataStoreService\UserDataStoreService.Core\UserDataStoreService.Core.csproj.
Restore completed in 1.28 sec for C:\Repos\UserDataStoreService\UserDataStoreService.Persistance\UserDataStoreService.Persistance.csproj.
Restore completed in 3.65 sec for C:\Repos\UserDataStoreService\UserDataStoreService\UserDataStoreService.csproj.
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Unable to load the service index for source https://microsoftxxxx.pkgs.visualstudio.com/_packaging/xxxxxxxxxxx.\r [C:\Repos\UserDataStoreService\UserDataStoreService\UserDataStoreService.csproj]
C:\Program Files\dotnet\sdk\1.0.4\NuGet.targets(97,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Repos\UserDataStoreService\UserDataStoreService\UserDataStoreService.csproj]

Expected behavior

Actual behavior

"C:\Program Files\dotnet\dotnet.exe" restore d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj -v diag
C:\Program Files\dotnet\sdk\1.0.3\MSBuild.dll /NoLogo /ConsoleLoggerParameters:Verbosity=Minimal /m /t:Restore /v:m /verbosity:diag d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj
Restoring packages for d:\a\1\s\UserDataStoreService.Core\UserDataStoreService.Core.csproj...
Restoring packages for d:\a\1\s\UserDataStoreService.Persistance\UserDataStoreService.Persistance.csproj...
C:\Program Files\dotnet\sdk\1.0.3\NuGet.targets(97,5): error : Unable to load the service index for source https://microsoftxxxx.pkgs.visualstudio.com/_packaging/xxxxxxxxxxx.. [d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj]
C:\Program Files\dotnet\sdk\1.0.3\NuGet.targets(97,5): error : Response status code does not indicate success: 401 (Unauthorized). [d:\a\1\s\UserDataStoreService\UserDataStoreService.csproj]

Environment data

dotnet --info output:

Copied from original issue: dotnet/cli#6659

@dalestone
Copy link

dalestone commented Jun 16, 2017

Is there a work around for this? I am getting the same error when trying to restore packages.

I tried setting the permissions on feed to the following:
Contributors: Project Collection Build Service
Readers: Project Collection Valid Users

The error persists.

I am using the Hosted VS2017 Queue.

@Igorbek
Copy link

Igorbek commented Jun 20, 2017

I've faced this issue as well, without any workaround found so far. Trying to access the feed via dotnet restore from a build that definitely has access.

@dalestone
Copy link

dalestone commented Jun 21, 2017

I manged to work around this by targeting VS2017 host agent and using nuget restore and pointing it at a nuget.config which has the VSTS feed URL in. I also left permissions to what i mentioned above and it now restores with no issues.
vsts

@gforceg
Copy link

gforceg commented Sep 2, 2017

@dalestone, do you have tests? Are they working?
This was our work around until I noticed that nuget doesn't seem to care about DotNetCliToolReference tags in my project's solution. So 'dotnet xunit' fails because the command cannot be found.

@mishra14 mishra14 added this to the Backlog milestone Nov 9, 2017
@phil-hodgson
Copy link

Restoring NuGet packages for .NET Core projects is supported by VSTS build tasks. See https://docs.microsoft.com/en-us/vsts/build-release/tasks/build/dotnet-core for details.

@nkolev92
Copy link
Member

In 2.1.400 of the dotnet SDK support for a cross platform authentication plugin was added.
#6486

The ADO's build tasks have since then been updated to use that plugin.

I think all the concern raised in this thread should have already been addressed.

@nkolev92 nkolev92 modified the milestones: Backlog, 4.8 Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants