Cannot start Nuget package recovery from Team City Nuget personal server

Current discussion topic: http://devnet.jetbrains.com/message/5519081#5519081

Bug Report: http://youtrack.jetbrains.com/issue/TW-37148

Error: cannot request input in non-interactive mode.

It should be noted that the credential prompt is triggered every time the package is downloaded, not at the beginning. I think this may be a mistake in how Team City calls NuGet, but I'm not sure.

I have the NuGet Feed Credentials credential collection function installed, the basic authorization configuration, and I launched the feed in Firefox and got a list of packages that will be displayed on the agent machine (with the necessary credentials).

My build log: https://gist.github.com/tonyeung/517597ca2312dad85f62

+4
source share
5 answers

The following is a workaround that may help you, although I had the impression that the NuGet Feed Credentials credential collection feature was designed to fix the problem. I had a similar problem with the TeamCity NuGet internal feed without guest access (in this example it is called Local).

Initial build step (command line - user script)

del /F %env.APPDATA%\NuGet\NuGet.Config
%teamcity.agent.tools.dir%\NuGet.CommandLine.DEFAULT.nupkg\tools\nuget.exe sources add -name Local -source %env.NuGetFeed%
%teamcity.agent.tools.dir%\NuGet.CommandLine.DEFAULT.nupkg\tools\nuget.exe sources update -Name Local -User %env.BuildServiceUser% -pass %env.BuildServicePassword%

As I said, this is a workaround, but not too much to support when using templates. Hope it makes you work.

+3
source

, , TeamCity 9.1.7.

, Server URL, Administration > Global Settings. .

+2

http://localhost:80/httpAuth/app/nuget/v1/FeedService.svc: V2 'http://localhost/httpAuth/app/nuget/v1/FeedService.svc/ (Id =' *** ', Version =' 1.0.0 ')' "401 Unauthorized".

, :

  • net user tcbagent password123 /add
    net localgroup administrators tcbagent /add
    
  • " " ​​( Carbon PS)

    Grant-CAPrivilege -Identity tcbagent "SeServiceLogonRight"
    
  • TeamCity
  • cmd

    runas /user:tcbagent cmd
    
  • nuget

    nuget sources add -name local -source http://localhost/httpAuth/app/nuget/v1/FeedService.svc -UserName tcbagent -Password password123 
    

    localhost ,

teamcity-build.log, - :

Starting NuGet.exe 3.5.0.1284 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT\tools\NuGet.exe
...
Restoring NuGet package xxxx.
...
Using credentials from config. UserName: tcbagent

TeamCity v9.1.7, NuGet v3.5.0-beta​​p >

2 , , TeamCity CI. , .

+1

TeamCity 8.1.2 ( 29993), , NuGet . 2.8.0 (TeamCity v.2.8.2). Nuget Install NuGet. , TeamCity, .

0

Source: https://habr.com/ru/post/1546880/


All Articles