dotnet restore failing - Unable to load the service index for source [package name]
Asked Answered
C

2

7

I have a build in VSTS which is failing with the following error:

error :   Unable to load the service index for source [source name] 2018-02-28T09:04:12.1080070Z /usr/share/dotnet/sdk/1.1.4/NuGet.targets(102,5)
error :   Response status code does not indicate success: 402 (Payment Required - The user does not have a license for the extension ms.feed. 

This happened after reducing the access level of the user who created the Package from Basic to Stakeholder in VSTS, which in turn removed the Package Management extension from that user also. Putting the access level back to Basic and giving them the Package Management extension resolves the issue, although this is not a long term fix as they've left the company now.

I've ensured that there are users that with the Package Management extension, and also with a PAT that has permissions for Packages. I then updated the password in the nuget.config file to be the aforementioned PAT token, however the build still fails with the above error if the user who set the Package is at Stakeholder level.

I'm guessing that the user set up something with their PAT which in some way links them to the package, but I'm struggling to find what this is/where it might be.

I'm running the build on a build agent hosted in Docker.

Any help would be much appreciated - thanks!

Chancroid answered 5/3, 2018 at 10:22 Comment(0)
W
0

The 402 Payment Required status code means that the private feed/package is locked because the feed owner's subscription has expired.

If the owner of a private feed downgrades a paid subscription to a free one or if the subscription expires, any private feeds on the account will become read-only for a period of days. After this period, the feed will become locked, meaning private feeds cannot be accessed until the subscription is renewed or the feed is made public.

As a workaround, you could abandon the package and use a new user with the Package Management extension license to create a new package on same setting.

Whimwham answered 5/3, 2018 at 14:53 Comment(4)
Thanks so much for your reply Patrick. I have the login details to the previous user's VSTS account, is there any way I can transfer ownership of the feed? Thanks.Chancroid
@Chancroid You could give a try with editing permissions for a feed Choose to make the person an Owner permission with full access, also updat the password in the nuget.config file.Whimwham
Hi @PatrickLu-MSFT. I'm afraid not - I tried adding another person with full access as an Owner and saw the same error. Unfortunately it looks like I'm going to have to create a new package!Chancroid
My solution is as follow: go to your account root: myaccount.visualstudio.com/_projects then Click the 3 dot menu and select Users. then on "Package Management" on the left side, Click "+Assign" to add a new user or assign package management extension to an existing user. This is based on the read on developercommunity.visualstudio.com/content/problem/96138/…Dey
P
0

Here was solution for the same issue. For the developer having the issue, go to

  1. nav to https://{YourOrgName1}.visualstudio.com/_settings/users
  2. Click "Three dots" next to user Name > Manage Extensions
  3. Click tab "Extensions" and enable "Package Management"

Have developer retry build.

Piaffe answered 5/4, 2019 at 19:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.