使用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>
有什么想法吗?
答案 0 :(得分:2)
既然你说这是在本地运行但不是在真正的天蓝色群集中,我想知道你是否以某种方式在某个地方遇到路径太长的错误,导致文件无法复制到图像存储正确,或导致其他问题。部署中的各种名称也可以导致长路径(> 260个字符),遗憾的是在Windows中失败。要尝试查看这是否是原因,请尝试将可执行文件重命名为A.exe之类的内容并再次尝试部署。您可能还需要缩短应用程序和服务类型名称。
错误通常意味着您的某个服务包引用了一个可执行文件(在这种情况下它看起来像dbname
),但是您生成并尝试向群集注册的实际包缺少该可执行文件。您还可以检查作为构建的一部分生成的实际包,并确保它在群集中存在。如果您想要探索实际被推入图像存储区的内容以进行检查,您可以使用QuestionnaireDefinitionEventAdapter.exe
。