部署 Service Fabric 应用程序失败 - 找不到 EntryPoint Xyz.exe

问题描述 投票:0回答:2

使用 Visual Studio Team Services 通过构建和发布定义来实现我们的 CI/CD 管道。我们的一个项目可以正确构建,但在部署到远程 Service Fabric 集群时失败,并出现以下错误:

2017-01-24T21:57:57.7395575Z ##[error]The EntryPoint mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapter.exe is not found.
2017-01-24T21:57:57.7395575Z ##[error]FileName: C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\TestApplicationPackage_356048141954\10xqzk0s.1m1\applicationpackage\mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapterPkg\ServiceManifest.xml

查看应用程序包,我们看到

mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapter.exe
已正确生成并且没有丢失。

可以使用 Visual Studio Enterprise 生成的

Deploy-FabricApplication.ps1
脚本将相同的应用程序包(从 VSTS 中的 Artifacts 选项卡下载)部署在本地集群或我们的开发集群上。

查看任务源代码here,我们发现任务在调用

Test-ServiceFabricApplicationPackage
后在第146行失败。但是,在下载的应用程序包上手动运行此命令似乎返回 true。

似乎没有任何方法可以使日志更加详细。我们还有其他项目的 CI/CD 管道可以正常工作。

编辑

构建日志超过 2MB,我无法将它们发布在这里。

发布日志:http://pastebin.com/BgVJX4mw

ApplicationManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="mycompany.VariableLibrary.App" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="QuestionnaireDefinitionEventAdapter_InstanceCount" DefaultValue="-1" />
    <Parameter Name="FillOutEventAdapter_InstanceCount" DefaultValue="-1" />
    <Parameter Name="RestAdapter_InstanceCount" DefaultValue="-1" />
    <Parameter Name="VariableLibraryService_MinReplicaSetSize" DefaultValue="3" />
    <Parameter Name="VariableLibraryService_PartitionCount" DefaultValue="1" />
    <Parameter Name="VariableLibraryService_TargetReplicaSetSize" DefaultValue="3" />
    <Parameter Name="VariableLibraryServiceUri" DefaultValue="" />
    <Parameter Name="EnvironmentName" DefaultValue="" />
    <Parameter Name="InstrumentationKey" DefaultValue="" />
    <Parameter Name="DiagEnableErrorPage" DefaultValue="" />
    <Parameter Name="JwtDomain" DefaultValue="" />
    <Parameter Name="JwtAudience" DefaultValue="" />
    <Parameter Name="JwtClientSecret" DefaultValue="" />
    <Parameter Name="DomainEventBusServiceBusTopicPath" DefaultValue="DomainEvents" />
    <Parameter Name="DomainEventBusServiceBusConnectionString" DefaultValue="" />
    <Parameter Name="QuestionnaireDefinitionSurveyServiceUri" DefaultValue="" />
    <Parameter Name="QuestionnaireDefinitionQuestionnaireServiceUri" DefaultValue="" />
    <Parameter Name="QuestionnaireDefinitionSampleServiceUri" DefaultValue="" />
    <Parameter Name="FillOutServiceUri" DefaultValue="" />
  </Parameters>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapterPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides>
      <ConfigOverride Name="Config">
        <Settings>
          <Section Name="AppSettings">
            <Parameter Name="EnvironmentName" Value="[EnvironmentName]" />
            <Parameter Name="InstrumentationKey" Value="[InstrumentationKey]" />
            <Parameter Name="DomainEventBusServiceBusConnectionString" Value="[DomainEventBusServiceBusConnectionString]" />
            <Parameter Name="DomainEventBusServiceBusTopicPath" Value="[DomainEventBusServiceBusTopicPath]" />
            <Parameter Name="VariableLibraryServiceUri" Value="[VariableLibraryServiceUri]" />
          </Section>
        </Settings>
      </ConfigOverride>
    </ConfigOverrides>
  </ServiceManifestImport>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="mycompany.VariableLibrary.FillOutEventAdapterPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides>
      <ConfigOverride Name="Config">
        <Settings>
          <Section Name="AppSettings">
            <Parameter Name="EnvironmentName" Value="[EnvironmentName]" />
            <Parameter Name="InstrumentationKey" Value="[InstrumentationKey]" />
            <Parameter Name="DomainEventBusServiceBusConnectionString" Value="[DomainEventBusServiceBusConnectionString]" />
            <Parameter Name="DomainEventBusServiceBusTopicPath" Value="[DomainEventBusServiceBusTopicPath]" />
            <Parameter Name="VariableLibraryServiceUri" Value="[VariableLibraryServiceUri]" />
          </Section>
        </Settings>
      </ConfigOverride>
    </ConfigOverrides>
  </ServiceManifestImport>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="mycompany.VariableLibrary.RestAdapterPkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides>
      <ConfigOverride Name="Config">
        <Settings>
          <Section Name="AppSettings">
            <Parameter Name="EnvironmentName" Value="[EnvironmentName]" />
            <Parameter Name="InstrumentationKey" Value="[InstrumentationKey]" />
            <Parameter Name="DiagEnableErrorPage" Value="[DiagEnableErrorPage]" />
            <Parameter Name="JwtDomain" Value="[JwtDomain]" />
            <Parameter Name="JwtAudience" Value="[JwtAudience]" />
            <Parameter Name="JwtClientSecret" Value="[JwtClientSecret]" />
            <Parameter Name="VariableLibraryServiceUri" Value="[VariableLibraryServiceUri]" />
          </Section>
        </Settings>
      </ConfigOverride>
    </ConfigOverrides>
  </ServiceManifestImport>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="mycompany.VariableLibrary.VariableLibraryServicePkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides>
      <ConfigOverride Name="Config">
        <Settings>
          <Section Name="AppSettings">
            <Parameter Name="EnvironmentName" Value="[EnvironmentName]" />
            <Parameter Name="InstrumentationKey" Value="[InstrumentationKey]" />
            <Parameter Name="DomainEventBusServiceBusConnectionString" Value="[DomainEventBusServiceBusConnectionString]" />
            <Parameter Name="DomainEventBusServiceBusTopicPath" Value="[DomainEventBusServiceBusTopicPath]" />
            <Parameter Name="QuestionnaireDefinitionSurveyServiceUri" Value="[QuestionnaireDefinitionSurveyServiceUri]" />
            <Parameter Name="QuestionnaireDefinitionQuestionnaireServiceUri" Value="[QuestionnaireDefinitionQuestionnaireServiceUri]" />
            <Parameter Name="QuestionnaireDefinitionSampleServiceUri" Value="[QuestionnaireDefinitionSampleServiceUri]" />
            <Parameter Name="FillOutServiceUri" Value="[FillOutServiceUri]" />
          </Section>
        </Settings>
      </ConfigOverride>
    </ConfigOverrides>
  </ServiceManifestImport>
  <DefaultServices>
    <Service Name="QuestionnaireDefinitionEventAdapter">
      <StatelessService ServiceTypeName="QuestionnaireDefinitionEventAdapter" InstanceCount="[QuestionnaireDefinitionEventAdapter_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
    <Service Name="FillOutEventAdapter">
      <StatelessService ServiceTypeName="FillOutEventAdapter" InstanceCount="[FillOutEventAdapter_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
    <Service Name="RestAdapter">
      <StatelessService ServiceTypeName="RestAdapter" InstanceCount="[RestAdapter_InstanceCount]">
        <SingletonPartition />
      </StatelessService>
    </Service>
    <Service Name="VariableLibraryService">
      <StatefulService ServiceTypeName="VariableLibraryService" TargetReplicaSetSize="[VariableLibraryService_TargetReplicaSetSize]" MinReplicaSetSize="[VariableLibraryService_MinReplicaSetSize]">
        <UniformInt64Partition PartitionCount="[VariableLibraryService_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
      </StatefulService>
    </Service>
  </DefaultServices>
</ApplicationManifest>

ServiceManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapterPkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <StatelessServiceType ServiceTypeName="QuestionnaireDefinitionEventAdapter" />
  </ServiceTypes>

  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>mycompany.VariableLibrary.QuestionnaireDefinitionEventAdapter.exe</Program>
      </ExeHost>
    </EntryPoint>
  </CodePackage>

  <ConfigPackage Name="Config" Version="1.0.0" />

  <Resources>
    <Endpoints>
      <Endpoint Name="ServiceEndpoint" />
    </Endpoints>
  </Resources>
</ServiceManifest>

有什么想法吗?

visual-studio azure-service-fabric
2个回答
2
投票

既然你说这在本地工作,但在真正的天蓝色集群中不起作用,我想知道你是否在某个地方遇到了路径太长的错误,这要么导致文件无法正确复制到图像存储,或导致其他问题。部署中的各种名称也可能会导致长路径(>260 个字符),不幸的是,这在 Windows 中会失败。要尝试查看这是否是原因,请尝试将可执行文件重命名为 A.exe 之类的名称,然后再次尝试部署。 您可能还需要缩短应用程序和服务类型名称。

该错误通常意味着您的某个服务包引用了一个可执行文件(在本例中,它看起来像

QuestionnaireDefinitionEventAdapter.exe
),但您正在生成并尝试向集群注册的实际包缺少该可执行文件。  您还可以检查作为构建的一部分生成的实际包,并确保它存在于集群中。如果您想探索实际推送到图像存储中的内容只是为了检查,您可以使用
Get-ServiceFabricImageStoreContent


0
投票

我可以通过从服务末尾删除“.exe”来做到这一点 服务清单文件

它对我有用。 您的情况不需要参数 useSFC

[例如,参见此图片] [1] [1]:https://i.sstatic.net/fSRih76t.png

© www.soinside.com 2019 - 2024. All rights reserved.