2015-06-08 88 views
1

我当前正在使用vNext模板设置TFS发布管理,并在重新部署应用程序时运行时出现错误。如果我从服务器上删除应用程序,它将毫无错误地部署。使用TFS Release Managment部署Web应用程序时出错

经过一番调查,我已经缩小到导致它的xWebApplication,但我无法解决问题。

我已经简化我的部署脚本仅复制文件和创建Web应用程序:

Configuration AddressServiceWebsite 
{ 
Import-DscResource -Module xWebAdministration 
Import-DscResource -ModuleName xReleaseManagement 

Node $AllNodes.NodeName 
{ 
    File CopyDeploymentBits 
    { 
     Ensure = "Present" 
     Type = "Directory" 
     Recurse = $true 
     SourcePath = $applicationPath 
     DestinationPath = $Node.DeploymentPath 
    } 

    xWebApplication WebApplication { 
     Website = $Node.WebsiteName 
     Name = $Node.ApplicationName 
     WebAppPool = $Node.ApplicationPool 
     PhysicalPath = $Node.DeploymentPath 
     Ensure = "Present" 
    } 
} 
} 

AddressServiceWebsite -ConfigurationData $ConfigData -Verbose -Force 

,并正在以下错误:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.Release.Common.Helpers.OperationFailedException: Copying recursively from \\whds001\tfs\Builds\Direct\SOA\AddressService\PR000081 to C:\Windows\DtlDownloads\AddressService succeeded. 

System.AggregateException: Failed to apply configuration in the DSC script to the computer. Consult the Logs below for details of the error. 

Destination element already exists, please use "force" parameter to override. 
CategoryInfo :InvalidArgument: (:) [], CimException 
FullyQualifiedErrorId :Destination element already exists, please use "force" parameter to override.,Microsoft.IIs.PowerShell.Provider.NewWebApplicationCommand 

The PowerShell provider MSFT_xWebApplication threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details. 
CategoryInfo :InvalidOperation: (:) [], CimException 
FullyQualifiedErrorId :NonTerminatingErrorFromProvider 

The SendConfigurationApply function did not succeed. 
CategoryInfo :NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException 
FullyQualifiedErrorId :MI RESULT 1 
---> Microsoft.Management.Infrastructure.CimException: Destination element already exists, please use "force" parameter to override. 
    --- End of inner exception stack trace --- 
    at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable) 
    at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action) 
    at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession) 
---> (Inner Exception #0) Microsoft.Management.Infrastructure.CimException: Destination element already exists, please use "force" parameter to override.<--- 

---> (Inner Exception #1) Microsoft.Management.Infrastructure.CimException: The PowerShell provider MSFT_xWebApplication threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.<--- 

---> (Inner Exception #2) Microsoft.Management.Infrastructure.CimException: The SendConfigurationApply function did not succeed. 
    at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext, T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)<--- 
Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'. 

An LCM method call arrived from computer WHWA041 with user sid S-1-5-21-12480674-1100442233-928725530-45419. 

[WHWA041]: LCM: [ Start Set  ] 

[WHWA041]: LCM: [ Start Resource ] [[File]CopyDeploymentBits] 

[WHWA041]: LCM: [ Start Test  ] [[File]CopyDeploymentBits] 

[WHWA041]:       [[File]CopyDeploymentBits] Building file list from cache. 

[WHWA041]: LCM: [ End Test  ] [[File]CopyDeploymentBits] in 0.0460 seconds. 

[WHWA041]: LCM: [ Start Set  ] [[File]CopyDeploymentBits] 

[WHWA041]:       [[File]CopyDeploymentBits] Building file list from cache. 

[WHWA041]:       [[File]CopyDeploymentBits] The destination object was found and no action is required. 

[WHWA041]: LCM: [ End Set  ] [[File]CopyDeploymentBits] in 0.0470 seconds. 

[WHWA041]: LCM: [ End Resource ] [[File]CopyDeploymentBits] 

[WHWA041]: LCM: [ Start Resource ] [[xWebApplication]WebApplication] 

[WHWA041]: LCM: [ Start Test  ] [[xWebApplication]WebApplication] 

[WHWA041]:       [[xWebApplication]WebApplication] Checking whether WebAdministration is there in the machine or not. 

[WHWA041]: LCM: [ End Test  ] [[xWebApplication]WebApplication] in 0.9980 seconds. 

[WHWA041]: LCM: [ Start Set  ] [[xWebApplication]WebApplication] 

[WHWA041]:       [[xWebApplication]WebApplication] Checking whether WebAdministration is there in the machine or not. 

[WHWA041]: LCM: [ End Set  ] [[xWebApplication]WebApplication] in 0.9990 seconds. 

[WHWA041]: LCM: [ End Set  ] 

Operation 'Invoke CimMethod' complete. 

Time taken for configuration job to complete is 2.292 seconds 


    at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.ReadDeploymentResponse(DeploymentResponse response) 
    at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunPowerShellScript>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 Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunScript>d__0.MoveNext() 
    --- End of inner exception stack trace --- 
    at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) 
    at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.InvokePlatform(String activityId, MachineSpecification machineSpecification, StorageSpecification storageSpecification, String scriptPath, String configurationPath, Dictionary`2 configurationVariables) 
    at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.RunScript(DscComponent dscComponentParameters, String serverName, String userName, String password, String componentName, String scriptPath, String configurationPath, String useCredSecuritySupportProvider, String useHttps, String skipCACheck) 
    --- End of inner exception stack trace --- 
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 
    at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.Dsc.DscComponentInstaller.InvokeMethodByReflection(String methodArguments) 

回答

1

您将无法部署在使用xWebApplication作为它尝试创建相同的Web应用程序。在尝试再次部署之前,应该删除Web应用程序,即使您保留了这些文件。

+0

有没有办法在vNext模板中删除Web应用程序? –

+1

您可以运行PowerShell脚本来删除该Web应用程序: 'Remove-WebApplication -Name TestApp -Site“默认Web站点” – ds19

相关问题