升级已部署的程序包时,VSTS Deploy Service Fabric应用程序任务超时

时间:2018-09-06 15:16:53

标签: azure-devops azure-service-fabric azure-pipelines-release-pipeline

我们正在使用“部署服务结构应用程序”任务来自动将服务结构应用程序发布到集群。

我们遇到的第一个问题是PublishProfile中的ReplicaQuorumTimeoutSec选项。我们一直在发布日志中收到此消息:

ReplicaQuorumTimeoutSec is deprecated - use UpgradeReplicaSetCheckTimeoutSec

该版本将发布到群集中,但不会升级。

我删除了该选项,但不再出现上述错误,但是升级仍然会失败。这是日志:

Register application type succeeded
Start upgrading application...
##[debug]System.TimeoutException: Operation timed out. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071BFF
##[debug]   at System.Fabric.Interop.NativeClient.IFabricApplicationManagementClient8.EndUpgradeApplication(IFabricAsyncOperationContext context)
##[debug]   at System.Fabric.Interop.Utility.<>c__DisplayClassa.<WrapNativeAsyncInvoke>b__9(IFabricAsyncOperationContext context)
##[debug]   at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
##[debug]   --- End of inner exception stack trace ---
##[debug]System.Management.Automation.PipelineStoppedException: The pipeline has been stopped.
##[debug]   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
##[debug]   at System.Management.Automation.Cmdlet.ThrowTerminatingError(ErrorRecord errorRecord)
##[debug]   at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.<>c__DisplayClass19.<UpgradeApplication>b__17(Exception ae)
##[debug]   at System.AggregateException.Handle(Func`2 predicate)
##[debug]   at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.UpgradeApplication(ApplicationUpgradeDescription upgradeDescription)
##[debug]   at Microsoft.ServiceFabric.Powershell.StartApplicationUpgrade.ProcessRecord()
Current Upgrade State: RollingForwardInProgress
Current Upgrade State: RollingForwardCompleted
Upgrade completed successfully.

尽管日志表明更新成功,但实际上并没有发生。

最后,我尝试将PublishProfile中的超时从1秒更改为120秒。此版本完全失败,并带有以下日志行:

Registering application type...
Register application type succeeded
Start upgrading application...
##[debug]System.Fabric.FabricException: aka.ms/upgrade-defaultservices ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071BDF
##[debug]   at System.Fabric.Interop.NativeClient.IFabricApplicationManagementClient8.EndUpgradeApplication(IFabricAsyncOperationContext context)
##[debug]   at System.Fabric.Interop.Utility.<>c__DisplayClassa.<WrapNativeAsyncInvoke>b__9(IFabricAsyncOperationContext context)
##[debug]   at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
##[debug]   --- End of inner exception stack trace ---
##[debug]System.Management.Automation.PipelineStoppedException: The pipeline has been stopped.
##[debug]   at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
##[debug]   at System.Management.Automation.Cmdlet.ThrowTerminatingError(ErrorRecord errorRecord)
##[debug]   at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.<>c__DisplayClass19.<UpgradeApplication>b__17(Exception ae)
##[debug]   at System.AggregateException.Handle(Func`2 predicate)
##[debug]   at Microsoft.ServiceFabric.Powershell.ApplicationCmdletBase.UpgradeApplication(ApplicationUpgradeDescription upgradeDescription)
##[debug]   at Microsoft.ServiceFabric.Powershell.StartApplicationUpgrade.ProcessRecord()
Getting application health:


ApplicationName                 : fabric:/NetScribe.Hangfire.ServiceFabric.Dev
AggregatedHealthState           : Ok
ServiceHealthStates             : 
                                  ServiceName           : fabric:/NetScribe.Hangfire.ServiceFabric.Dev/HangFire
                                  AggregatedHealthState : Ok

DeployedApplicationHealthStates : 
                                  ApplicationName       : fabric:/NetScribe.Hangfire.ServiceFabric.Dev
                                  NodeName              : _nswjobs_0
                                  AggregatedHealthState : Ok

HealthEvents                    : 
                                  SourceId              : System.CM
                                  Property              : State
                                  HealthState           : Ok
                                  SequenceNumber        : 2852
                                  SentAt                : 8/28/2018 5:10:27 PM
                                  ReceivedAt            : 8/28/2018 5:10:27 PM
                                  TTL                   : Infinite
                                  Description           : Application health policy has been updated.
                                  RemoveWhenExpired     : False
                                  IsExpired             : False
                                  Transitions           : Warning->Ok = 8/28/2018 5:05:08 PM, LastError = 1/1/0001 
                                  12:00:00 AM


Failed to start application upgrade. Error aka.ms/upgrade-defaultservices.
Could not start upgrade successfully. Unregistering application type 'NetScribe.Hangfire.ServiceFabricType' and version '2.0.0.18249.06'.
Unregister application type started (query application types for status).

这是PublishProfile的更新部分:

<UpgradeDeployment Mode="UnmonitoredAuto" Enabled="true">
    <Parameters UpgradeReplicaSetCheckTimeoutSec="120" TimeoutSec="120" Force="True" ForceRestart="True"/>
</UpgradeDeployment>

任何帮助使此工作正常进行的工作,将不胜感激。

1 个答案:

答案 0 :(得分:0)

根据我的经验,升级失败的原因有两个:

  • a)如果您更改了有状态服务中的任何数据模型(在可靠的词典中),而新数据模型与旧版本不兼容,请参阅wcf数据合同版本控制,升级将失败。

  • b)如果您不遵守“ Runasync”中的“ cancellationtoken”退出,则升级将超时。

如果不是以上2个问题,则很可能是您在新版本中引入的新代码引起的。确保使用代码的生产副本创建本地开发集群,并尝试在升级时注入新代码,然后看看会发生什么。