2017-09-11 18 views
0

我正在使用VSTS WindowsMachineFileCopy任务在本地环境中进行部署。在此内部环境中,它只能连接到目标计算机。我无法弄清楚为什么不......我尝试使用主机名和机器IP。VSTS WindowsMachineFileCopy无法连接到我的服务器

什么是更奇怪的是它是在当我试图连接到一个10 *的地址错误信息报告“23.102.153.83:443” ......

这是从部署的异常日志:

2017-09-11T12:00:07.5928347Z Executing the powershell script: 
C:\agent\_work\_tasks\WindowsMachineFileCopy_731004d4-1d66-4f70-8c05-638018b22210\1.0.41\WindowsMachineFileCopy.ps1 
2017-09-11T12:03:56.2892363Z ##[error]System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.102.153.83:443 
2017-09-11T12:03:56.2892363Z at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) 
2017-09-11T12:03:56.2892363Z at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) 
2017-09-11T12:03:56.2892363Z --- End of inner exception stack trace --- 
2017-09-11T12:03:56.2892363Z at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 
2017-09-11T12:03:56.2892363Z at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) 
2017-09-11T12:03:56.2892363Z --- End of inner exception stack trace --- 
2017-09-11T12:03:56.2892363Z at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__4.MoveNext() 
2017-09-11T12:03:56.2892363Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:03:56.2892363Z at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__49.MoveNext() 
2017-09-11T12:03:56.2892363Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:03:56.2892363Z at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__46`1.MoveNext() 
2017-09-11T12:03:56.2892363Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:03:56.2892363Z at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext() 
2017-09-11T12:03:56.2892363Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:03:56.2892363Z at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<ConnectAsync>d__41.MoveNext() 
2017-09-11T12:03:56.2892363Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:03:56.2892363Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:03:56.3048364Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:03:56.3048364Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.TaskContextHelper.GetConnection(Uri serverUri, VssCredentials credentials) 
2017-09-11T12:03:56.3048364Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.Core.TaskContextHelper.GetVssConnection(ITaskContext context) 
2017-09-11T12:03:56.3048364Z at Microsoft.TeamFoundation.DistributedTask.Task.Internal.GetVssConnectionCmdlet.ProcessRecord() 
2017-09-11T12:03:56.3048364Z at System.Management.Automation.CommandProcessor.ProcessRecord() 
2017-09-11T12:10:29.3339268Z ##[error]System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 23.102.153.83:443 
2017-09-11T12:10:29.3339268Z at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) 
2017-09-11T12:10:29.3339268Z at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) 
2017-09-11T12:10:29.3339268Z --- End of inner exception stack trace --- 
2017-09-11T12:10:29.3339268Z at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 
2017-09-11T12:10:29.3339268Z at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) 
2017-09-11T12:10:29.3339268Z --- End of inner exception stack trace --- 
2017-09-11T12:10:29.3339268Z at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__4.MoveNext() 
2017-09-11T12:10:29.3339268Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:10:29.3339268Z at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__49.MoveNext() 
2017-09-11T12:10:29.3339268Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:10:29.3339268Z at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__46`1.MoveNext() 
2017-09-11T12:10:29.3339268Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:10:29.3339268Z at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext() 
2017-09-11T12:10:29.3339268Z --- End of stack trace from previous location where exception was thrown --- 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
2017-09-11T12:10:29.3339268Z at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult() 
2017-09-11T12:10:29.3339268Z at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.<ConnectAsync>d__41.MoveNext() 
2017-09-11T12:10:29.3339268Z ##[error]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Environment' because it is null. 
2017-09-11T12:10:29.3339268Z at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) 
2017-09-11T12:10:29.3339268Z at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) 
2017-09-11T12:10:29.3339268Z at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) 
2017-09-11T12:10:29.3339268Z at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 
2017-09-11T12:10:29.3339268Z at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) 
2017-09-11T12:10:29.3651269Z ##[error]System.Management.Automation.RuntimeException: No machine exists under environment: '10.XXXXXXXXXX' for deployment ---> System.Management.Automation.RuntimeException: No machine exists under environment: '10.XXXXXXXXXX' for deployment 
2017-09-11T12:10:29.3651269Z --- End of inner exception stack trace --- 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings) 
2017-09-11T12:10:29.3651269Z at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList`1 output, PSInvocationSettings settings) 
2017-09-11T12:10:29.3651269Z at Microsoft.TeamFoundation.DistributedTask.Handlers.LegacyVSTSPowerShellHost.VSTSPowerShellHost.Main(String[] args) 
2017-09-11T12:10:29.3807269Z ##[error]LegacyVSTSPowerShellHost.exe completed with return code: -1. 

任何人有任何想法,可能是什么或我可以看看?

+1

您使用的是部署组吗? –

+0

编号部署组选项卡为空。另外,我在使用ping与服务器地址的文件副本之前立即执行命令行任务。 ping成功。这让我如此难倒。 – dayneo

+0

新信息已经曝光: 我发现这个错误也发生在Remote Powershell任务中。所以我认为目标上的WinRM设置存在问题。它曾经在目标机器上安装,所以我怀疑证书可能已过期....将检查并回复其他调查结果。 – dayneo

回答

0

托管代理不支持Windows计算机文件复制任务(您也可以查找相关问题here)。

解决方法是使用private agent进行部署。对于Windows机器设置文件,如下副本任务:

机:IP,如10.168.170.111

管理员登录:domain\username

密码:输入您的密码,或使用可变

目标文件夹:完全远程机器上的路径。如C:\Users\username\Desktop\1

+0

感谢Marina,此代理商在本地托管。 – dayneo

+0

所以你使用私人代理来建立?如果设置正确并且远程计算机能够访问,Windows计算机文件复制可以由私人代理运行成功。按照上面列出的设置,您是否建立了成功? –

+0

谢谢玛丽娜。它是一个私人(内部部署)代理。我发现目前服务器上需要执行远程PowerShell的所有任务都有问题。我怀疑我的证书已经在目标服务器上过期,因此无法连接winrm。我需要重新验证我的winrm设置,然后重试。 – dayneo