Cannot publishing a NuGet to TFS 2017 - tfs

When I try to publish a NuGet to my TFS 2017 on-premises using a build step, I get following error messages:
2016-12-21T09:33:58.3510841Z [command]C:\Windows\system32\chcp.com 65001
2016-12-21T09:33:58.3667084Z Active code page: 65001
2016-12-21T09:34:00.7730379Z Detected NuGet version 3.3.0.212 / 3.3.0
2016-12-21T09:34:00.7730379Z SYSTEMVSSCONNECTION exists true
2016-12-21T09:34:00.7886681Z [command]C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe push -NonInteractive C:\Agent\_work\1\s\Foo.1.4.3-build-20161221-1.nupkg -Source http://myServer:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
2016-12-21T09:34:01.4761938Z Please provide credentials for: http://myserver:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json
2016-12-21T09:34:01.4761938Z UserName: System.InvalidOperationException: Cannot prompt for input in non-interactive mode.
2016-12-21T09:34:01.5074440Z ##[error]Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe failed with return code: 1
2016-12-21T09:34:01.5074440Z ##[error]Packages failed to publish
I have also try to run the NuGet.exe push ... command from a PowerShell script as a build step, and that also failed.
When I run it manually in a ordinary PowerShell console, it works without problems.
What is the runtime difference between running it from console compared to running it in a build step? How do I make it works?
Edit 1
I have change to NuGet 3.5 and created a verbose log. Se below:
agent.workFolder=C:\Agent\_work
loading inputs and endpoints
loading ENDPOINT_AUTH_$/
loading ENDPOINT_AUTH_PARAMETER_$/_ACCESSTOKEN
loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
loading ENDPOINT_AUTH_SCHEME_$/
loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
loading INPUT_FEEDNAME
loading INPUT_NUGETFEEDTYPE
loading INPUT_NUGETVERSION
loading INPUT_SEARCHPATTERN
loading INPUT_VERBOSITY
loaded 11
check path : C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\task.json
set resource file to: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\task.json
system.culture=en-US
check path : C:\Windows\system32\chcp.com
C:\Windows\system32\chcp.com=C:\Windows\system32\chcp.com
C:\Windows\system32\chcp.com arg: ["65001"]
exec tool: C:\Windows\system32\chcp.com
Arguments:
65001
C:\Windows\system32\chcp.com 65001
Active code page: 65001
searchPattern=C:\Agent\_work\1\s\**\*.nupkg;-:**\packages\**\*.nupkg;-:**\*.symbols.nupkg
System.DefaultWorkingDirectory=C:\Agent\_work\1\s
pattern: C:\Agent\_work\1\s\**\*.nupkg, isNegative: false
Matching glob pattern: C:\Agent\_work\1\s\**\*.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
pattern: C:\Agent\_work\1\s\**\packages\**\*.nupkg, isNegative: true
Matching glob pattern: C:\Agent\_work\1\s\**\packages\**\*.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
pattern: C:\Agent\_work\1\s\**\*.symbols.nupkg, isNegative: true
Matching glob pattern: C:\Agent\_work\1\s\**\*.symbols.nupkg
Index of first wildcard: 19
find root dir: C:\Agent\_work\1
find C:\Agent\_work\1
4456 matches.
connectedServiceName=null
feedName=http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json
nuGetAdditionalArgs=null
verbosity=Detailed
nuGetFeedType=internal
nuGetPath=null
nuGetversion=3.5.0.1829
Agent.HomeDirectory=C:\Agent
looking for tool NuGet
looking for tool variant NuGet.exe
checking C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe
SYSTEMVSSCONNECTION=http://sag-s02:8080/tfs/SAG Team Projects/
Detected NuGet version 3.5.0.1938 / 3.5.0
Quirks for 3.5.0.1938:
NoTfsOnPremAuthConfig
NuGet.ForceEnableCredentialProvider=undefined
NuGetTasks.IsHostedTestEnvironment=undefined
System.TeamFoundationCollectionUri=http://sag-s02:8080/tfs/SAG%20Team%20Projects/
Credential provider is enabled.
NuGet.ForceEnableCredentialConfig=undefined
NuGetTasks.IsHostedTestEnvironment=undefined
System.TeamFoundationCollectionUri=http://sag-s02:8080/tfs/SAG%20Team%20Projects/
Credential config is disabled due to on-prem quirks.
Getting credentials for local feeds
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
Got auth token
discovered URL prefixes: http://sag-s02:8080/tfs/SAG Team Projects/
NuGetTasks.ExtraUrlPrefixesForTesting=undefined
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: push
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: -NonInteractive
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe pathArg: C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: ["-Source","http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json"]
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: ["-ApiKey","VSTS"]
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: -Verbosity
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe arg: Detailed
credProviderPath = C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet
exec tool: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe
Arguments:
push
-NonInteractive
C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg
-Source
http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json
-ApiKey
VSTS
-Verbosity
Detailed
C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe push -NonInteractive C:\Agent\_work\1\s\Foo.1.4.3-build-20161222-5.nupkg -Source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
NuGet Version: 3.5.0.1938
System.AggregateException: One or more errors occurred. ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0.<<GetAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpSource.<GetAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<TryCreate>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.PackageUpdateResourceV3Provider.<TryCreate>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__15`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.CommandRunnerUtility.<GetPackageUpdateResource>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.PushRunner.<Run>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)
---> (Inner Exception #0) NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source http://sag-s02:8080/tfs/SAG%20Team%20Projects/_packaging/sag-nuget/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0.<<GetAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.HttpSource.<GetAsync>d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of inner exception stack trace ---
at NuGet.Protocol.ServiceIndexResourceV3Provider.<GetServiceIndexResourceV3>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.ServiceIndexResourceV3Provider.<TryCreate>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.PackageUpdateResourceV3Provider.<TryCreate>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__16`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Protocol.Core.Types.SourceRepository.<GetResourceAsync>d__15`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.CommandRunnerUtility.<GetPackageUpdateResource>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.Commands.PushRunner.<Run>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NuGet.CommandLine.PushCommand.<ExecuteCommandAsync>d__28.MoveNext()<---
rc:1
success:false
Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
Processed: ##vso[task.issue type=error;]Error: C:\Agent\_work\_tasks\NuGetPublisher_333b11bd-d341-40d9-afcf-b32d5ce6f25b\0.2.21\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
task result: Failed
Packages failed to publish
Processed: ##vso[task.issue type=error;]Packages failed to publish
Processed: ##vso[task.complete result=Failed;]Packages failed to publish

The error below indicates you need to provide credential to push the package:
Please provide credentials for: http://myserver:8080/tfs/My%20Team%20Projects/_packaging/our-nuget/nuget/v3/index.json
UserName: System.InvalidOperationException: Cannot prompt for input in non-interactive mode.
Check the solution here: log in as the user which will be running the builds, and update the nuget source reference (which will be in a user-specific appdata config file) with the password:
nuget sources update -Name <whatever you called it> -source http://your.nuget.repo/authed/feed/ -User <your username> -pass <your pwd>
This will save an encrypted password in a user-specific config file on that computer, and should mean you don’t get prompted for that source anymore.
Several more options are detailed over here: http://www.xavierdecoster.com/nuget-package-restore-from-a-secured-feed

Find the reason: the user name or password includes quotes when add feed source. Solution to deal with that issue:
Download Nuget 3.5
Open Command Prompt and navigate to Nuget.exe folder (CD)
Update package source through this command (Do not include quotes to user name and password):
Command:
.\nugget.exe Sources update -name '[feedname]' -source "[feed address]" -username [user name] -password [password]
Queue build to publish package
Note: Do not include quotes to user name and password, for example: ‘user1’, ”user1”, just use user1.

Related

Docker Error: System.InvalidOperationException:

I installed docker and ran it, it was ok. but after a restart i have this problem:
System.InvalidOperationException:
job failed with message: 'DockerDesktopVM' failed to start. (Virtual machine ID 4160C5EC-02BD-46FA-99E3-3B99203D966A)
'DockerDesktopVM' Synthetic SCSI Controller (Instance ID 7DF00258-64CD-42EE-9C46-40C402778132): Failed to Power on with Error 'The file or directory is corrupted and unreadable.' (0x80070570). (Virtual machine ID 4160C5EC-02BD-46FA-99E3-3B99203D966A)
'DockerDesktopVM': Attachment 'F:\Docker_data\DockerDesktop\DockerDesktop.vhdx' failed to open because of error: 'The file or directory is corrupted and unreadable.' (0x80070570). (Virtual machine ID 4160C5EC-02BD-46FA-99E3-3B99203D966A)
at Docker.Backend.HyperVInfrastructure.HandleUpdatedJob(CIMConcreteJob updatedJob) in C:\workspaces\PR-18003\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 772
at Docker.Backend.HyperVInfrastructure.d__40.MoveNext() in C:\workspaces\PR-18003\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 706
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Backend.HyperVInfrastructure.d__32.MoveNext() in C:\workspaces\PR-18003\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 554
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HyperV.d__6.MoveNext() in C:\workspaces\PR-18003\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperV.cs:line 105
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpAPI.HyperVController.d__7.MoveNext() in C:\workspaces\PR-18003\src\github.com\docker\pinata\win\src\Docker.Backend\HttpAPI\HyperVController.cs:line 49
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.TaskHelpersExtensions.d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__15.MoveNext()
I reinstalled docker and again in first it was ok but after restart the problem reappeared.
My windows is serever 2019.
when i delete DockerDesktop.vhdx file, docker will run.

How to fix an error of Docker Desktop 'job failed with message: 'DockerDesktopVM' failed to start' on Window Server 2019?

When I try to run installed Docker Desktop I got an error. How can I fix it?
System.InvalidOperationException: job failed with message: 'DockerDesktopVM' failed to start. (Virtual machine ID 443C0D91-1225-4EBB-9782-9EE15C42F9C6)
The Virtual Machine Management Service failed to start the virtual machine 'DockerDesktopVM' because one of the Hyper-V components is not running (Virtual machine ID 443C0D91-1225-4EBB-9782-9EE15C42F9C6). at Docker.Backend.HyperVInfrastructure.HandleUpdatedJob(CIMConcreteJob updatedJob) in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 772 at Docker.Backend.HyperVInfrastructure.<HandleMaybeAsyncJob>d__40.MoveNext() in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 706
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Docker.Backend.HyperVInfrastructure.<StartVMAsync>d__32.MoveNext() in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperVInfrastructure.cs:line 554
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.Backend.HyperV.<StartAsync>d__6.MoveNext() in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperV.cs:line 105
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Docker.Backend.HttpAPI.HyperVController.<StartAsync>d__7.MoveNext() in C:\workspaces\PR-17739\src\github.com\docker\pinata\win\src\Docker.Backend\HttpAPI\HyperVController.cs:line 49
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__1`1.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()

Failed to create or configure Hyper-V VM: Sequence contains no elements

I'm trying to run Docker.
Allways I start Docker I get this error.
I couldn't upload image becouse my reputation is under 10. So images are connected via hypertext links.
Image showing an error from Docker after openning application.
https://ibb.co/rtCYsPp
Log:
Docker.Core.HttpBadResponseException:
Failed to create or configure Hyper-V VM: Sequence contains no elements..
One of the most common reasons is virtualization features not working properly, see https://docs.docker.com/docker-for-windows/troubleshoot/#virtualization.
at Docker.Core.Logging.HttpClientExceptionInterceptor.<InterceptResponseAsync>d__0.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Core\Logging\HttpClientExceptionInterceptor.cs:line 17
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Core.Logging.LoggingMessageHandler.<SendAsync>d__4.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Core\Logging\LoggingMessageHandler.cs:line 36
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.<FinishSendAsyncBuffered>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Core.BackendAPI.BackendAPIClient.<CreateHyperVVMAsync>d__10.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Core\BackendAPI\BackendAPIClient.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.LinuxHyperVEngine.<DoStartAsync>d__14.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\LinuxHyperVEngine.cs:line 59
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Docker.Engines.Engines.<WaitCurrentTransitionsAsync>d__30.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 358
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Engines.Engines.<RestartAsync>d__26.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\Engines.cs:line 250
Docker.Core.Backend.BackendQuitException:
Failed to create or configure Hyper-V VM: Sequence contains no elements..
One of the most common reasons is virtualization features not working properly, see https://docs.docker.com/docker-for-windows/troubleshoot/#virtualization.
at Docker.Backend.HyperV.<CreateOrConfigureAsync>d__8.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Backend\HyperV\HyperV.cs:line 122
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Docker.Backend.HttpAPI.HyperVController.<CreateVMAsync>d__7.MoveNext() in C:\workspaces\stable-2.5.x\src\github.com\docker\pinata\win\src\Docker.Backend\HttpAPI\HyperVController.cs:line 35
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()
Note:
My visualization is enabled.
I have Win 10 Pro
I have downloaded protocol for Hyper V - https://superuser.com/questions/1411967/hyper-v-generic-failure
I did uninstall Docker (with restart) and then installed it again
In Hyper V Manager when I try to create new Virtual Machine I always get a "Generic failure" error
Image of Generic error from Hyper-V Manager.
https://ibb.co/xD3GMmy
It's becouse your Windows 10 build is 18xxx you need to update it to 19xxx. That will fix your problem.

Intermittent TFS agent error

I am currently setting up TFS automatic builds and deployment at work and am getting a intermittent error.
I am using Visual Studio Team Services (VSTS) with an on premises TFS agent. This works perfectly fine some of the time and then randomly the agent appears idle in VSTS, even though the agent job is still running.
In the agent's log it has the following error:
[2016-10-24 23:50:42Z ERR MessageListener] System.Net.Http.HttpRequestException: Error while copying content to a stream. ---> System.IO.IOException: Unable to read data from the transport connection. The connection was closed before all data could be read. Expected 2251 bytes, read 0 bytes.
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.StreamToStreamCopy.<CopyAsyncToPreSizedLimitMemoryStream>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__48.MoveNext()
--- End of inner exception stack trace ---
at System.Net.Http.HttpContent.<LoadIntoBufferAsyncCore>d__48.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__42`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__27`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__26`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Extensions.<WithCancellation>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Any ideas what could be causing this?
When the agent is not working, the status will show Idle. That's excepted.
Check whether your agent is working when you queue builds. If the agent not work, try to download the latest version 2.108.0 and re-deploy it.

Running Vsts agent on nano server

I am looking to run vsts agent on docker image with nano server on it. The container already has .Net Core installed on it. I downloaded vsts agent using the Download Agent and config.cmd command. Got the following error
An error occurred while sending the request. Failed to connect. Try again or ctrl-c to quit
Here are the details
Windows Version: Microsoft Windows [Version 10.0.14393]
.Net Core Version : 1.0.1
.Net Core Build : cee57bf6c981237d80aa1631cfe83cb9ba329f12
Looking at Diagnostics log, I get the following error
[2016-10-18 07:29:46Z ERR Terminal] System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.Http.WinHttpException: The parameter is incorrect
at System.Net.Http.WinHttpAuthHelper.SetWinHttpCredential(SafeWinHttpHandle requestHandle, ICredentials credentials, Uri uri, UInt32 authScheme, UInt32 authTarget)
at System.Net.Http.WinHttpAuthHelper.CheckResponseForAuthentication(WinHttpRequestState state, UInt32& proxyAuthScheme, UInt32& serverAuthScheme)
at System.Net.Http.WinHttpHandler.d__101.MoveNext()
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Net.Http.HttpClient.d__58.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__421.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.AgentServer.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.d__7.MoveNext()
[2016-10-18 07:29:46Z ERR Terminal] WRITE ERROR: Failed to connect. Try again or ctrl-c to quit
Can anyone help please?
I had it raised as an issue with the product team.
https://github.com/Microsoft/vsts-agent/issues/483
The scenario is not supported as yet. I.e VSTS agents can't run Windows Nano Server. Following are excerpt from the response the team
"It's likely not just this issue. The Windows build of the agent currently makes an assumption that Full .NET is installed. It has validation checks that verify that .NET >= 4.5 is installed. It sounds like it's missing validation to distinguish between .NET Full and .NET Core.
My understanding is that Nano doesn't have .NET Full, and only has .NET Core. We'll need to take a pass through the agent, given Nano constraints, and figure out what it means for an agent running on Nano."

Resources