【问题标题】:Deploy Service Fabric Application through VSTS release pipeline using Hosted Agent使用托管代理通过 VSTS 发布管道部署 Service Fabric 应用程序
【发布时间】:2016-12-07 10:25:03
【问题描述】:

我已按照此文档https://azure.microsoft.com/en-us/documentation/articles/service-fabric-set-up-continuous-integration/ 为服务结构使用托管代理设置持续集成

在导入证书后的发布管道中,我收到以下错误并且部署失败。我无法确定问题出在哪里

[error]此操作过程中发生错误。请查看跟踪日志以获取更多详细信息。

完成任务:ServiceFabricDeploy

[错误]System.Exception: 任务 ServiceFabricDeploy 失败。

这导致作业失败。查看任务的日志以获取更多详细信息。

[错误]在 Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)

在部署服务结构任务下,它显示以下错误

带有指纹“A6B32E70CFE715F608A247C1ED94AB3D0164A58E”的导入集群客户端证书。

指纹主题

A6B32E70CFE715F608A247C1ED94AB3D0164A58E >CN=clusternamedns.eastus.cloudapp.azure.com

[error]此操作过程中发生错误。请查看跟踪日志以获取更多详细信息。

更新

在变量中将system.debug设置为true后,我得到了以下日志

    2016-08-03T05:44:31.6556865Z ##[debug]System.Fabric.FabricException: An error occurred during this operation.  Please check the trace logs for more details. ---> System.Runtime.InteropServices.COMException: No credentials are available in the security package (Exception from HRESULT: 0x8009030E)

2016-08-03T05:44:31.6566887Z ##[debug]   at System.Fabric.Interop.NativeClient.IFabricClientSettings2.SetSecurityCredentials(FABRIC_SECURITY_CREDENTIALS credentials)

2016-08-03T05:44:31.6577063Z ##[debug]   at System.Fabric.FabricClient.SetSecurityCredentialsInternal(SecurityCredentials credentials)

2016-08-03T05:44:31.6587072Z ##[debug]   at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)

2016-08-03T05:44:31.6597111Z ##[debug]   --- End of inner exception stack trace ---

2016-08-03T05:44:31.6606871Z ##[debug]   at System.Fabric.Interop.Utility.RunInMTA[TResult](Func`1 func)

2016-08-03T05:44:31.6647953Z ##[debug]   at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credentialArg, FabricClientSettings newSettings, String[] hostEndpointsArg)

2016-08-03T05:44:31.6656886Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ClusterConnection.FabricClientBuilder.Build()

2016-08-03T05:44:31.6666879Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ClusterConnection..ctor(FabricClientBuilder fabricClientBuilder, Boolean getMetadata)

2016-08-03T05:44:31.6676869Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ConnectCluster.ProcessRecord()

2016-08-03T05:44:31.6770225Z ##[debug]Leaving C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.103.1\tasks\ServiceFabricDeploy\1.0.1\deploy.ps1.

2016-08-03T05:44:31.6850322Z ##[debug]Caught exception from task script.

2016-08-03T05:44:31.6890370Z ##[debug]Error record:

2016-08-03T05:44:31.7380329Z ##[debug]Connect-ServiceFabricCluster : An error occurred during this operation.  Please check the trace logs for more details.

2016-08-03T05:44:31.7390333Z ##[debug]At C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.103.1\tasks\ServiceFabricDeploy\1.0.1\deploy.ps1:73 char:12

2016-08-03T05:44:31.7410325Z ##[debug]+     [void](Connect-ServiceFabricCluster @clusterConnectionParameters)

2016-08-03T05:44:31.7420325Z ##[debug]+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2016-08-03T05:44:31.7430323Z ##[debug]    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException

2016-08-03T05:44:31.7440363Z ##[debug]    + FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster

2016-08-03T05:44:31.7450426Z ##[debug] 

2016-08-03T05:44:31.7470318Z ##[debug]Script stack trace:

2016-08-03T05:44:31.7500512Z ##[debug]at <ScriptBlock>, C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.103.1\tasks\ServiceFabricDeploy\1.0.1\deploy.ps1: line 73

2016-08-03T05:44:31.7910331Z ##[debug]at <ScriptBlock>, <No file>: line 1

2016-08-03T05:44:31.7920318Z ##[debug]at <ScriptBlock>, <No file>: line 22

2016-08-03T05:44:31.7930364Z ##[debug]at <ScriptBlock>, <No file>: line 18

2016-08-03T05:44:31.7940315Z ##[debug]at <ScriptBlock>, <No file>: line 1

2016-08-03T05:44:31.7960349Z ##[debug]Exception:

2016-08-03T05:44:31.8000522Z ##[debug]System.Fabric.FabricException: An error occurred during this operation.  Please check the trace logs for more details. ---> System.Runtime.InteropServices.COMException: No credentials are available in the security package (Exception from HRESULT: 0x8009030E)

2016-08-03T05:44:31.8010571Z ##[debug]   at System.Fabric.Interop.NativeClient.IFabricClientSettings2.SetSecurityCredentials(FABRIC_SECURITY_CREDENTIALS credentials)

2016-08-03T05:44:31.8020684Z ##[debug]   at System.Fabric.FabricClient.SetSecurityCredentialsInternal(SecurityCredentials credentials)

2016-08-03T05:44:31.8030335Z ##[debug]   at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)

2016-08-03T05:44:31.8040334Z ##[debug]   --- End of inner exception stack trace ---

2016-08-03T05:44:31.8060326Z ##[debug]   at System.Fabric.Interop.Utility.RunInMTA[TResult](Func`1 func)

2016-08-03T05:44:31.8070343Z ##[debug]   at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credentialArg, FabricClientSettings newSettings, String[] hostEndpointsArg)

2016-08-03T05:44:31.8080330Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ClusterConnection.FabricClientBuilder.Build()

2016-08-03T05:44:31.8090325Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ClusterConnection..ctor(FabricClientBuilder fabricClientBuilder, Boolean getMetadata)

2016-08-03T05:44:31.8100358Z ##[debug]   at Microsoft.ServiceFabric.Powershell.ConnectCluster.ProcessRecord()

2016-08-03T05:44:31.8340330Z ##[error]An error occurred during this operation.  Please check the trace logs for more details.

【问题讨论】:

  • 将名为“system.debug”的变量添加到发布定义的“变量”选项卡并将其设置为 true。然后尝试创建另一个版本。日志中应该提供更多的调试信息。请分享。
  • 另外,您是在托管代理上运行它还是设置了自己的自定义代理?
  • 你能像马特提到的那样将“system.debug”变量设置为“true”运行构建,然后提供详细的日志吗?
  • 感谢您的回复,我用调试信息更新了我的问题。请立即检查。
  • 我正在使用托管代理。

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


【解决方案1】:

以下 PowerShell 脚本有助于将 PFX 文件转换为 Base64 字符串。它将字符串输出到文本文件。

$fileContentBytes = get-content 'C:\<your-certificate>.pfx' -Encoding Byte

[System.Convert]::ToBase64String($fileContentBytes) | Out-File 'C:\pfx-bytes.txt'

但是,当您在记事本中打开文件(包含 Base64 字符串)并执行全选 (CTRL + A) 操作时,会复制文件末尾的额外行(中断)。在为任务 Service Fabric 应用程序部署创建集群服务连接期间添加客户端证书时,会粘贴此额外行。

删除多余的行,它应该可以工作。我希望这个答案也有帮助。

【讨论】:

    【解决方案2】:

    纳伦德拉马查

    我认为这里的问题可能是您在 SF 端点上使用 cer 证书文件的 Base64,而不是 PFX 文件的 Base64(通常受密码保护)。

    【讨论】:

      猜你喜欢
      • 2016-06-13
      • 2016-07-24
      • 1970-01-01
      • 2017-07-03
      • 2020-08-14
      • 2018-08-31
      • 2016-08-31
      • 1970-01-01
      • 2021-07-08
      相关资源
      最近更新 更多