NuGet: Cannot prompt for input in non-interactive mode

I figure I should create a new thread instead of jacking the old thread: http://devnet.jetbrains.com/message/5491334
I'm running TC:Pro 8.1.1 (build 29939), Nuget Version 2.8.2

I have the Build Feature configured and I've run the feed in Firefox and got the list of packages to show up on the agent machine.
Downgrading to 2.2.1 gave me an unknown command: 'restore' error instead.

Below is the my build log:

Build 'AmsWeb :: Dealers' #192
Started 'Tue Jul 01 11:35:29 CDT 2014' on 'WIN-CHR0M9GABIO' by 'automaster'
Finished 'Tue Jul 01 11:36:05 CDT 2014' with status 'FAILURE Exit code 1; error message is logged'
TeamCity URL http://10.10.0.215:8000/viewLog.html?buildId=224&buildTypeId=AmsWeb_Dealers
TeamCity server version is 8.1.1 (build 29939)

[11:35:28]E: bt5 (37s)
[11:35:28] : TeamCity server version is 8.1.1 (build 29939)
[11:35:28] : Checking for changes (running for 37s)
[11:35:28] : Will collect changes in 1 VCS roots
[11:35:28] : Waiting for completion of current operations for the VCS roots
[11:35:28] : Loading current repository state for VCS root 'Dealers'
[11:35:29] : Detecting changes in VCS root 'Dealers' (used in Dealers, Default)
[11:35:29] : Agent time zone: America/Chicago
[11:35:29] : Agent is running under JRE: 1.7.0_51-b13
[11:35:29] : Publishing internal artifacts
[11:35:29] :  [Publishing internal artifacts] Sending using ArtifactsCachePublisher
[11:35:29] :  [Publishing internal artifacts] Sending using WebPublisher
[11:35:29] : Clearing temporary directory: C:\AmsCI\TeamCity\buildAgent\temp\buildTmp
[11:35:29] : Checkout directory: C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716
[11:35:29] : Updating sources: server side checkout
[11:35:29] :  [Updating sources] Using vcs information from agent file: dbbf572a5acb6716.xml
[11:35:29] :  [Updating sources] Building incremental patch for VCS root: Dealers; checkout rules: =>; revision: e1b76434596f81d4b6e71aa61d7946b514c5151d --> e1b76434596f81d4b6e71aa61d7946b514c5151d
[11:35:29] :  [Updating sources] Repository sources transferred
[11:35:29] : ##teamcity[buildStatisticValue key='buildStageDuration:sourcesUpdate' value='160.0']
[11:35:29] : Build preparation done
[11:35:29]E: Step 1/3: NuGet Installer (35s)
[11:35:29] :  [Step 1/3] ##teamcity[buildStatisticValue key='buildStageDuration:firstStepPreparation' value='145.0']
[11:35:29] :  [Step 1/3] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_83' value='0.0']
[11:35:29] :  [Step 1/3] scan: Searching for nuget.config files
[11:35:29] :  [scan] Found packages folder: C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\packages
[11:35:29] :  [scan] Failed to find repositories.config at C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\packages\repositories.config
[11:35:29] :  [scan] Scanning projects in solution file: C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.sln
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.API\AMS.Dealers.API.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.CommandProcessor\AMS.Dealers.CommandProcessor.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.Domain\AMS.Dealers.Domain.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\.nuget
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.SagaProcessor\AMS.Dealers.SagaProcessor.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\processors
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\messages
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.EventProcessor\AMS.Dealers.EventProcessor.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.Commands\AMS.Dealers.Commands.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.Events\AMS.Dealers.Events.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.SagaEvents\AMS.Dealers.SagaEvents.csproj
[11:35:29] :  [scan] Found project C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.Rest\AMS.Dealers.Rest.csproj
[11:35:29]W:  [Step 1/3] restore: Restoring NuGet packages for AMS.Dealers.sln (35s)
[11:35:29] :  [restore] NuGet command: C:\AmsCI\TeamCity\buildAgent\plugins\nuget-agent\bin\JetBrains.TeamCity.NuGetRunner.exe C:\AmsCI\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe restore C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\AMS.Dealers.sln -NoCache -OutputDirectory C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716\packages -Source https://www.nuget.org/api/v2/ -Source http://localhost:80/httpAuth/app/nuget/v1/FeedService.svc
[11:35:29] :  [restore] Starting: C:\AmsCI\TeamCity\buildAgent\temp\agentTmp\custom_script3539055021599724552.cmd
[11:35:29] :  [restore] in directory: C:\AmsCI\TeamCity\buildAgent\work\dbbf572a5acb6716
[11:35:30] :  [restore] JetBrains TeamCity NuGet Runner 8.0.29939.9
[11:35:30] :  [restore] Registered additional extensions from paths: C:\AmsCI\TeamCity\buildAgent\plugins\nuget-agent\bin\plugins-2.8
[11:35:30] :  [restore] Starting NuGet.exe 2.8.50506.491 from C:\AmsCI\TeamCity\buildAgent\tools\NuGet.CommandLine.DEFAULT.nupkg\tools\NuGet.exe
[11:36:04] :  [restore] Installing 'AMS.Infrastructure.CQRS 0.176'.
[11:36:04] :  [restore] Installing 'AMS.Core.Common 0.176'.
[11:36:04] :  [restore] Installing 'AMS.Infrastructure.EventStore 0.176'.
[11:36:04] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Infrastructure/180:id/AMS.Infrastructure.CQRS.0.176.nupkg
[11:36:04] :  [restore] UserName: Installing 'AMS.Infrastructure.Common 0.176'.
[11:36:04] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Infrastructure/180:id/AMS.Infrastructure.Common.0.176.nupkg
[11:36:04] :  [restore] UserName: Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Infrastructure/180:id/AMS.Infrastructure.EventStore.0.176.nupkg
[11:36:04] :  [restore] UserName: Installing 'AMS.AccessControl.Events 0.175'.
[11:36:04] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_AccessControl/205:id/AMS.AccessControl.Events.0.175.nupkg
[11:36:04] :  [restore] UserName: Installing 'AMS.Core.ReadModels 0.176'.
[11:36:04] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Core/212:id/AMS.Core.ReadModels.0.176.nupkg
[11:36:05] :  [restore] UserName: Installing 'AMS.Core.Interfaces 0.176'.
[11:36:05] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Core/212:id/AMS.Core.Interfaces.0.176.nupkg
[11:36:05] :  [restore] UserName: Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Core/212:id/AMS.Core.Common.0.176.nupkg
[11:36:05] :  [restore] UserName: Installing 'AMS.Infrastructure.ReadModelRepository 0.176'.
[11:36:05] :  [restore] Installing 'AMS.AccessControl.Commands 0.175'.
[11:36:05] :  [restore] Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Infrastructure/180:id/AMS.Infrastructure.ReadModelRepository.0.176.nupkg
[11:36:05] :  [restore] UserName: Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_AccessControl/205:id/AMS.AccessControl.Commands.0.175.nupkg
[11:36:05]W:  [restore] Cannot prompt for input in non-interactive mode.
[11:36:05] :  [restore] UserName:
[11:36:05]W:  [restore] Process exited with code 1
[11:36:05] :  [Step 1/3] ##teamcity[buildStatisticValue key='buildStageDuration:buildStepRUNNER_83' value='35368.0']
[11:36:05]E:  [Step 1/3] Step NuGet Installer failed
[11:36:05]W: Step 2/3: Visual Studio (sln)
[11:36:05]W:  [Step 2/3] Build step Visual Studio (sln) is skipped because the previous step has failed
[11:36:05]W: Step 3/3: Pack Dealers (NuGet Pack)
[11:36:05]W:  [Step 3/3] Build step Pack Dealers (NuGet Pack) is skipped because the previous step has failed
[11:36:05] : ##teamcity[buildStatisticValue key='buildStageDuration:buildFinishing' value='15.0']
[11:36:05] : Publishing internal artifacts
[11:36:05] :  [Publishing internal artifacts] Sending using ArtifactsCachePublisher
[11:36:05] :  [Publishing internal artifacts] Sending using WebPublisher
[11:36:05] : Publishing artifacts
[11:36:05] :  [Publishing artifacts] Collecting files to publish: [Build\Release\** =>]
[11:36:05] :  [Publishing artifacts] Publishing using [ArtifactsCachePublisher]
[11:36:05] :  [Publishing artifacts] Publishing using [WebPublisher]
[11:36:05] : ##teamcity[buildStatisticValue key='buildStageDuration:artifactsPublishing' value='273.0']
[11:36:09] : Build finished

12 comments
Comment actions Permalink

Hi,

Have you configured 'NuGet Feed Credentials' build feature as described here?
Also please add Basic HTTP into the list of Authentication Modules in TeamCity Settings: Administration –> Authentication.

0
Comment actions Permalink

Yes, I've already added the build feature.
Basic Auth is setup.
Guest login is disabled.

I'm assuming the feed is setup correctly because I can access the feed over a browser as well as Visual Studio and it prompts for a username and password.

One thing to note in the build log: "Please provide credentials for: http://localhost/httpAuth/repository/download/AmsWeb_Infrastructure/180:id/AMS.Infrastructure.CQRS.0.176.nupkg"
You can see how the URL is actually for an individual package instead of for the feed itself.

This may be a bug in the way Team City is calling nuget.

0
Comment actions Permalink

I've created an issue http://youtrack.jetbrains.com/issue/TW-37148. Please watch and vote.
Can you please also try a workaround described here http://docs.myget.org/docs/how-to/consume-a-private-feed-in-teamcity

nuget sources add -Name <some name for the feed> -Source <feed URL> -Username <username> -Password <password>

nuget sources remove -Name <some name for the feed>

0
Comment actions Permalink

To avoid error "unknown command: 'restore'" when using NuGet versions less then 2.7 please change Restore mode (in NuGet Installer build step configurations) to Install.

0
Comment actions Permalink

Hi I am using Nuget 3.4.3 and teamcity version 10.0.3 .I am facing the same non interactive mode issue .Have added the credentials in build features.Any workaround or solution to this problem .

0
Comment actions Permalink

Hello,

Please describe your setup in more details. Please attach screenshot of the NuGet build step settings and full build log. Thank you!

0
Comment actions Permalink

Below are the configurations of my build steps:

1.Build configuration step 1 restore nuget packages

2.nuget installer build step

3.Nuget credentials added

4.Build log

please suggest why its is throwing errors like this

0
Comment actions Permalink

Could you please try to use https://teamcity....com/httpAuth/app/nuget/v1/FeedService.svc/ in NuGet step settings and Feed URI instead of URL with ip address?

Please let me know whether it helps or not. 

0
Comment actions Permalink

I Have tried with that aswell same issue i have faced.

0
Comment actions Permalink

The specified Package Source in NuGet step and Feed URI in NuGet Feed Credentials should be the same. Please make sure that you use https in both cases and there is no additional slashes at the end. If it does not help, please attach new full build log. Thank you!

0
Comment actions Permalink

I ran into the same problem. Part of my log:

[23:05:25] : [restore] JetBrains TeamCity NuGet Runner 8.0.42677.9
[23:05:25] : [restore] Registered additional extensions from paths: C:\BuildAgent\plugins\nuget-agent\bin\plugins-2.8
[23:05:25] : [restore] Starting NuGet.exe 2.8.50126.400 from C:\BuildAgent\tools\NuGet.CommandLine.2.8.0\tools\NuGet.exe
[23:05:26] : [restore] WARNING: Project file C:\BuildAgent\work\8d5ed2f598478c05\Source\Reports\DataEngine\DataEngine.csproj cannot be found.
[23:05:26] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2')
[23:05:26] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2')
[23:05:26] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2')
[23:05:26] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2')
[23:05:27] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2.0')
[23:05:27] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2.0')
[23:05:27] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2.0')
[23:05:27] : [restore] GET http://tc.ncgc.local/guestAuth/app/nuget/v1/FeedService.svc/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2.0')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2.0')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.VBFunctionLib',Version='1.0.2.0')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2.0')
[23:05:28] : [restore] GET https://www.nuget.org/api/v2/Packages(Id='Gcef.Data.DataEngine',Version='1.0.2.0')
[23:05:29] : [restore] Please provide credentials for: http://gcef-nuget.grapecitydev.com/nuget
[23:05:29] : [restore] UserName: WARNING: Cannot prompt for input in non-interactive mode.
[23:05:29] : [restore] WARNING: Cannot prompt for input in non-interactive mode.
[23:05:29]W: [restore] System.InvalidOperationException: Unable to find version '1.0.2' of package 'Gcef.Data.DataEngine'.
[23:05:29]W: [restore] at NuGet.PackageHelper.ResolvePackage(IPackageRepository repository, String packageId, SemanticVersion version)
[23:05:29]W: [restore] at NuGet.Commands.RestoreCommand.RestorePackage(IFileSystem packagesFolderFileSystem, String packageId, SemanticVersion version, Boolean packageRestoreConsent, ConcurrentQueue`1 satellitePackages)
[23:05:29]W: [restore] at NuGet.Commands.RestoreCommand.<>c__DisplayClass5.<>c__DisplayClass7.<ExecuteInParallel>b__2()
[23:05:29]W: [restore] at System.Threading.Tasks.Task`1.InnerInvoke()
[23:05:29]W: [restore] at System.Threading.Tasks.Task.Execute()

0
Comment actions Permalink

UPD: My TeamCity version is "TeamCity Enterprise 10.0.5 (build 42677)"

0

Please sign in to leave a comment.