We are trying to develop custom Intershop Managed Service following cookbook: https://support.intershop.com/kb/index.php/Display/2329T4
But when trying to enable service in Operations for our Organization, it is not listed there and there is a warning log message:
WARN localhost ES1 appserver0 [Test-Site] com.intershop.component.service.internal.service.ORMServiceConfigurationBORepositoryImpl [] [Storefront] [8ocH1vmRUp4E1qKOZQQC5FFRtQai9r4QV6dAV1yx] [oBlLAFsfl5kFMqjA-0-00] "oBlLAFsfl5kFMqjA-0-00" Can't load implementation for service definition: cartridge='service_esb', service definition id='ESBServiceDefinition'.
Here is services.compoment:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010">
<!-- Adapter interface -->
<contract name="ESBService" class="com.test.service.capi.ESBService" />
<!-- ServiceDefintion implementation -->
<implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
<!-- ServiceDefintion instance that has already one adapter added -->
<instance name="ESBServiceDefinition" with="ESBServiceDefinitionImpl" />
<!-- Registering the ServiceDefintion instance to the (global) ServiceDefinitionRegistry -->
<fulfill requirement="serviceDefinition" of="serviceDefinitionRegistry">
<instance with="ServiceDefinitionRegistry.Entry">
<fulfill requirement="cartridgeID" value="service_esb" />
<fulfill requirement="groupID" value="service.group.name.test" />
<fulfill requirement="parameterGroupID" value="ESBParameters" />
<fulfill requirement="serviceDefinitionID" value="esbService" />
<fulfill requirement="localizationKeyForName" value="service.definition.name.esbService" />
<fulfill requirement="serviceDefinition" with="ESBServiceDefinition" />
<fulfill requirement="ChainElementID" value="LogHandler" />
<fulfill requirement="ChainElementID" value="MonitorHandler" />
</instance>
</fulfill>
</components>
All required classes (AdapterInterface, Adapter, ExecutorService, ServiceDefinition - extending AbstractServiceDefinition) are implemented and compiled successfully. Does anybody knows why Intershop can't load implementation?
Also, in Intershop Studio in component editor following error is displayed when services.component is opened:
With 'Implementation - ESBServiceDefinitionImpl (unresolved)' cannot be resolved
But when clicking CTRL+left mouse button on "ESBServiceDefinitionImpl" implementation is found and
<implementation name="ESBServiceDefinitionImpl" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
is highlighted.
Of course it was typo :) I named folder with service.component "component", and not "components".
Thank you all for your help!
Maybe the ServiceDefinitionID does not match:
esbService vs. ESBServiceDefinition
Can you try the following component settings:
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.intershop.de/component/2010" scope="global">
<!-- Adapter interface -->
<contract name="ESBService" class="com.test.service.capi.ESBService" />
<!-- ServiceDefintion implementation -->
<implementation name="com.test.service.internal.ESBServiceDefinition" class="com.test.service.internal.ESBServiceDefinition" implements="ServiceDefinition" />
<!-- Registering the ServiceDefintion instance to the (global) ServiceDefinitionRegistry -->
<fulfill requirement="serviceDefinition" of="serviceDefinitionRegistry">
<instance with="ServiceDefinitionRegistry.Entry">
<fulfill requirement="cartridgeID" value="service_esb" />
<fulfill requirement="groupID" value="service.group.name.test" />
<fulfill requirement="parameterGroupID" value="ESBParameters" />
<fulfill requirement="serviceDefinitionID" value="esbService" />
<fulfill requirement="localizationKeyForName" value="service.definition.name.esbService" />
<fulfill requirement="serviceDefinition">
<instance with="com.test.service.internal.ESBServiceDefinition" />
</fulfill>
<fulfill requirement="ChainElementID" value="LogHandler" />
<fulfill requirement="ChainElementID" value="MonitorHandler" />
</instance>
</fulfill>
</components>
This is a long shot but did you try to redeploy the server after creating the custom managed service?
Stop the server.
Run gradlew deployServer
Start the server
Related
The node in my partition keeps switching between Health State = OK and Health State = unknown.
Sometimes the node disappears.
I have tried deleting the service, the app and unprovisioning the type, then redeploying, however I get the same problem.
It is a Service Fabric stateful service, and it's running fine locally, the issue I'm having is only in my dev environment.
I'm using 5 nodes.
ServiceManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="Integration.Optical.ServicePkg"
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>
<!-- This is the name of your ServiceType.
This name must match the string used in the RegisterServiceAsync call in Program.cs. -->
<StatefulServiceType ServiceTypeName="Integration.Optical.ServiceType" />
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>Integration.Optical.Service.exe</Program>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
<EnvironmentVariables>
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value=""/>
<EnvironmentVariable Name="KEYVAULT_ENDPOINT" Value=""/>
</EnvironmentVariables>
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Name="ServiceEndpoint" />
<!-- This endpoint is used by the replicator for replicating the state of your service.
This endpoint is configured through a ReplicatorSettings config section in the Settings.xml
file under the ConfigPackage. -->
<Endpoint Name="ReplicatorEndpoint" />
</Endpoints>
</Resources>
</ServiceManifest>
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="Integration.OpticalType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Integration.Optical.Service_ASPNETCORE_ENVIRONMENT" DefaultValue="" />
<Parameter Name="Integration.Optical.Service_KEYVAULT_ENDPOINT" DefaultValue="" />
<Parameter Name="Integration.Optical.Service_MinReplicaSetSize" DefaultValue="3" />
<Parameter Name="Integration.Optical.Service_PartitionCount" DefaultValue="1" />
<Parameter Name="Integration.Optical.Service_TargetReplicaSetSize" DefaultValue="3" />
</Parameters>
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Integration.Optical.ServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<EnvironmentOverrides CodePackageRef="code">
<EnvironmentVariable Name="ASPNETCORE_ENVIRONMENT" Value="[Integration.Optical.Service_ASPNETCORE_ENVIRONMENT]" />
<EnvironmentVariable Name="KEYVAULT_ENDPOINT" Value="[Integration.Optical.Service_KEYVAULT_ENDPOINT]" />
</EnvironmentOverrides>
</ServiceManifestImport>
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="Integration.Optical.Service" ServicePackageActivationMode="ExclusiveProcess">
<StatefulService ServiceTypeName="Integration.Optical.ServiceType" TargetReplicaSetSize="[Integration.Optical.Service_TargetReplicaSetSize]" MinReplicaSetSize="[Integration.Optical.Service_MinReplicaSetSize]">
<UniformInt64Partition PartitionCount="[Integration.Optical.Service_PartitionCount]" LowKey="-9223372036854775808" HighKey="9223372036854775807" />
</StatefulService>
</Service>
</DefaultServices>
</ApplicationManifest>
ApplicationParameters/Cloud.xml:
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/Integration.Optical" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="Integration.Optical.Service_ASPNETCORE_ENVIRONMENT" Value="" />
<Parameter Name="Integration.Optical.Service_KEYVAULT_ENDPOINT" Value="" />
<Parameter Name="Integration.Optical.Service_PartitionCount" Value="1" />
<Parameter Name="Integration.Optical.Service_MinReplicaSetSize" Value="1" />
<Parameter Name="Integration.Optical.Service_TargetReplicaSetSize" Value="1" />
</Parameters>
</Application>
Not sure what part of this fixed it. But this is what I did and it's now working:
In ServiceManifest.xml I added HasPersistedState = true:
<StatefulServiceType ServiceTypeName="Integration.Optical.ServiceType" HasPersistedState="true" />
I moved the app configuration code
ServiceRuntime.RegisterServiceAsync...
from Service.RunAsync() to Program.Main()
I have deployed trafeik in secured service fabric cluster , and i have made settings in servicemanifest of one of my application to use trafeik, eventhough trafeik is able to identify service but backend in trafeik is always red and my service is unreachable, if i use direct endpoint to my service it is reachable, need help in resolving same.
below is the toml of trafeik -
debug = true
logLevel = "INFO"
defaultEntryPoints = ["https"]
[entryPoints]
[entryPoints.https]
address = ":16080"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = "certs/servicefabric.crt"
keyFile = "certs/servicefabric.key"
[entryPoints.traefik]
address = ":16081"
[api]
entryPoint = "traefik"
dashboard = true
debug = true
[servicefabric]
clustermanagementurl = "https://localhost:19080"
apiversion = "3.0"
[serviceFabric.tls]
cert = "certs/servicefabric.crt"
key = "certs/servicefabric.key"
insecureskipverify = true
Service manifest of trafik service -
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="TraefikPkg" 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>
<!-- This is the name of your ServiceType.
The UseImplicitHost attribute indicates this is a guest executable service. -->
<StatelessServiceType ServiceTypeName="TraefikType" UseImplicitHost="true" />
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<!-- The SetupEntryPoint is an optional element used to specify a
program to be executed before the service's code is launched. -->
<EntryPoint>
<ExeHost>
<Program>traefik.exe</Program>
<Arguments>--configfile=traefik.toml</Arguments>
<WorkingFolder>CodePackage</WorkingFolder>
<!-- Uncomment to log console output (both stdout and stderr) to one of the
service's working directories. Do not use in production. -->
<!--<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048" />-->
</ExeHost>
</EntryPoint>
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Protocol="https" Name="TraefikTypeEndpoint" Type="Input" Port="16080" CertificateRef="ClusterThumbprint"/>
<Endpoint Protocol="https" Name="TraefikTypeAPIEndpoint" Type="Input" Port="16081" CertificateRef="ClusterThumbprint"/>
</Endpoints>
</Resources>
</ServiceManifest>
Application manifest of trafeik service -
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="TraefikType" ApplicationTypeVersion="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">
<Parameters>
<Parameter Name="Traefik_InstanceCount" DefaultValue="-1" />
<Parameter Name="Stateless1_PlacementConstraints" DefaultValue="(NodeTypeName==fntensvcp)" />
</Parameters>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="TraefikPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<RunAsPolicy CodePackageRef="Code" UserRef="AdminUser" EntryPointType="All" />
</Policies>
</ServiceManifestImport>
<DefaultServices>
<Service Name="Traefik" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="TraefikType" InstanceCount="[Traefik_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
</DefaultServices>
<Principals>
<Users>
<User Name="AdminUser">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
</Principals>
<Certificates>
<EndpointCertificate X509FindValue="b22bb9d3e74da3339e5f6709798107443553ae48" Name="ClusterThumbprint" />
</Certificates>
</ApplicationManifest>
For my application below is service manifest -
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="CSM.IE.SMA.C360.RevenueServicePkg" 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" ManifestId="25bba1ad-7380-4cbf-b9ed-9a90ee3dd086">
<ServiceTypes>
<!-- This is the name of your ServiceType.
This name must match the string used in RegisterServiceType call in Program.cs. -->
<StatelessServiceType ServiceTypeName="CSM.IE.SMA.C360.RevenueServiceType">
<Extensions>
<Extension Name="Traefik">
<Labels xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
<Label Key="traefik.frontend.rule.c360Revenue">PathPrefixStrip: /C360/RevenueService</Label>
<Label Key="traefik.enable">true</Label>
<Label Key="traefik.frontend.passHostHeader">true</Label>
</Labels>
</Extension>
</Extensions>
</StatelessServiceType>
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>CSM.IE.SMA.C360.RevenueService.exe</Program>
</ExeHost>
</EntryPoint>
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<!--<Endpoint Name="ServiceEndpoint" Protocol="http" Port="8082"/>-->
<Endpoint Protocol="https" Name="ServiceEndpoint" Type="Input" Port="19616" CertificateRef="ClusterThumbprint" />
</Endpoints>
</Resources>
</ServiceManifest>
for my application below is application manifest file -
<?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="IE_SmartAssistance" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric" ManifestId="1ff9d8a9-ecbc-4d55-931e-eb59eb229f15">
<Parameters>
<Parameter Name="MultiTPIDConsumptionService_InstanceCount" DefaultValue="2" />
<Parameter Name="SupportService_InstanceCount" DefaultValue="2" />
<Parameter Name="ConsumptionService_InstanceCount" DefaultValue="2" />
<Parameter Name="AgreementService_InstanceCount" DefaultValue="2" />
<Parameter Name="RevenueService_InstanceCount" DefaultValue="2" />
<Parameter Name="ProfileProxyService_InstanceCount" DefaultValue="2" />
<Parameter Name="Stateless1_PlacementConstraints" DefaultValue="(NodeTypeName==fntensvcp)" />
</Parameters>
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.MultiTPIDConsumptionServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.AgreementServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.RevenueServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.ProfileProxyServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.ConsumptionServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="CSM.IE.SMA.C360.SupportServicePkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<EndpointBindingPolicy EndpointRef="ServiceEndpoint" CertificateRef="ClusterThumbprint" />
<RunAsPolicy CodePackageRef="Code" UserRef="LocalAdmin" />
</Policies>
</ServiceManifestImport>
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="CSM.IE.SMA.C360.MultiTPIDConsumptionService" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.MultiTPIDConsumptionServiceType" InstanceCount="[MultiTPIDConsumptionService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
<Service Name="IE_SmartAssistance_Customer360Service_AgreementService-Microservice_API">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.AgreementServiceType" InstanceCount="[AgreementService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
<Service Name="RevenueService-Microservice_API" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.RevenueServiceType" InstanceCount="[RevenueService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
<Service Name="CSM.IE.SMA.C360.ProfileProxyService" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.ProfileProxyServiceType" InstanceCount="[ProfileProxyService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
<Service Name="CSM.IE.SMA.C360.ConsumptionService" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.ConsumptionServiceType" InstanceCount="[ConsumptionService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
<Service Name="CSM.IE.SMA.C360.SupportService" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="CSM.IE.SMA.C360.SupportServiceType" InstanceCount="[SupportService_InstanceCount]">
<SingletonPartition />
<PlacementConstraints>[Stateless1_PlacementConstraints]</PlacementConstraints>
</StatelessService>
</Service>
</DefaultServices>
<Principals>
<Users>
<User Name="LocalAdmin" AccountType="NetworkService">
<MemberOf>
<SystemGroup Name="Administrators" />
</MemberOf>
</User>
</Users>
</Principals>
<Certificates>
<EndpointCertificate X509FindValue="b22bb9d3e74da3339e5f6709798107443553ae48" Name="ClusterThumbprint" />
</Certificates>
</ApplicationManifest>
I have a local Service Fabric cluster of 5 nodes and I have a problem deploying my application on all nodes. When set to "1 Node", the cluster works fine. When set to "5 Nodes" it gives an error on all nodes but one. This is the error/warning message:
Error event: SourceId='System.Hosting', Property='CodePackageActivation:Code:EntryPoint:131919316927686034'.
There was an error during CodePackage activation.System.Fabric.FabricException (-2147017731)
Failed to start Container. ContainerName=sf-0-28e0002f-fd7d-412c-81b8-b78ca5339ce4_865991cc-9c36-493f-9b3d-95f6eba43851, ApplicationId=Proton.SFType_App0, ApplicationName=fabric:/Proton.SF.
DockerRequest returned StatusCode=InternalServerError with ResponseBody={"message":"failed to create endpoint sf-0-28e0002f-fd7d-412c-81b8-b78ca5339ce4_865991cc-9c36-493f-9b3d-95f6eba43851 on network nat: HNS failed with error : You were not connected because a duplicate name
The error message looks truncated. The application loads up fine, but on one node only. Am I missing something in 5-node configuration? The application we are deploying is a container which runs a .NET Core app. I've attached a screenshot of the error in Service Fabric Explorer.
Error Screenshot
ServiceManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="Proton.TestingPkg"
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>
<!-- This is the name of your ServiceType.
The UseImplicitHost attribute indicates this is a guest service. -->
<StatelessServiceType ServiceTypeName="Proton.TestingType" UseImplicitHost="true" />
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<!-- Follow this link for more information about deploying Windows containers to Service Fabric: https://aka.ms/sfguestcontainers -->
<ContainerHost>
<ImageName>proton.azurecr.io/protontesting:latest</ImageName>
</ContainerHost>
</EntryPoint>
<!-- Pass environment variables to your container: -->
<!--
<EnvironmentVariables>
<EnvironmentVariable Name="VariableName" Value="VariableValue"/>
</EnvironmentVariables>
-->
</CodePackage>
<!-- Config package is the contents of the Config directoy under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="1.0.0" />
<Resources>
<Endpoints>
<!-- This endpoint is used by the communication listener to obtain the port on which to
listen. Please note that if your service is partitioned, this port is shared with
replicas of different partitions that are placed in your code. -->
<Endpoint Name="Proton.TestingTypeEndpoint" Port="8001" />
</Endpoints>
</Resources>
</ServiceManifest>
ApplicationManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="Proton.SFType"
ApplicationTypeVersion="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">
<Parameters>
<Parameter Name="Proton.Testing_InstanceCount" DefaultValue="-1" />
</Parameters>
<!-- Import the ServiceManifest from the ServicePackage. The ServiceManifestName and ServiceManifestVersion
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Proton.TestingPkg" ServiceManifestVersion="1.0.0" />
<ConfigOverrides />
<Policies>
<ContainerHostPolicies CodePackageRef="Code">
<!-- See https://aka.ms/I7z0p9 for how to encrypt your repository password -->
<RepositoryCredentials AccountName="ProtonCluster" Password="XXX" PasswordEncrypted="false" />
<PortBinding ContainerPort="80" EndpointRef="Proton.TestingTypeEndpoint" />
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="Proton.Testing" ServicePackageActivationMode="ExclusiveProcess">
<StatelessService ServiceTypeName="Proton.TestingType" InstanceCount="[Proton.Testing_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
I am trying to publish an application to Azure Service Fabric cluster. The moment I click publish from VS2015, I get those following errors:
"An error occurred reading the file xxx\publishprofiles\cloud.xml. There is an error in XML document (7, 6)"
"Object reference not set to an instance of an object"
This is the content of the Cloud.xml file:
<?xml version="1.0" encoding="utf-8"?>
<PublishProfile xmlns="http://schemas.microsoft.com/2015/05/fabrictools">
<ClusterConnectionParameters ConnectionEndpoint=... />
<ApplicationParameterFile Path="xxx\ApplicationParameters\Cloud.xml" />
<UpgradeDeployment Mode="Monitored" Enabled="true">
<Parameters FailureAction="Rollback" Force="True" />
<Parameters UpgradeReplicaSetCheckTimeoutSec="1" Force="True" />
</UpgradeDeployment>
</PublishProfile>
It seems that I can have only one of the parameters (FailureAction OR UpgradeReplicaSetCheckTimeoutSec) for VS2015 to successfully load the file.
I wonder if anyone has some insights into this issue?
There can only be one Parameters element. Combine all your parameters into just one Parameters element.
Example:
<?xml version="1.0" encoding="utf-8"?>
<PublishProfile xmlns="http://schemas.microsoft.com/2015/05/fabrictools">
<ClusterConnectionParameters ConnectionEndpoint=... />
<ApplicationParameterFile Path="xxx\ApplicationParameters\Cloud.xml" />
<UpgradeDeployment Mode="Monitored" Enabled="true">
<Parameters FailureAction="Rollback" Force="True" UpgradeReplicaSetCheckTimeoutSec="1" />
</UpgradeDeployment>
</PublishProfile>
I'm having issues trying to log in to a CRM Online organization through the use of the latest version of the Xrm Tooling nuget package using the connection string constructor from a custom powershell cmdlet.
I'm receiving a rather unhelpful "Unable to Login to Dynamics CRM" error message and am attempting to enable tracing to troubleshoot but have not been able to enable it by modifying the .dll.config file like the below (taken from an XrmToolbox issue on GitHub):
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
switchName="Microsoft.Xrm.Tooling.Connector.CrmServiceClient"
switchType="System.Diagnostics.SourceSwitch">
<listeners>
<add name="console" type="System.Diagnostics.DefaultTraceListener" />
<remove name="Default" />
<add name ="fileListener" />
</listeners>
</source>
<source name="Microsoft.Xrm.Tooling.CrmConnectControl"
switchName="Microsoft.Xrm.Tooling.CrmConnectControl"
switchType="System.Diagnostics.SourceSwitch">
<listeners>
<add name="console" type="System.Diagnostics.DefaultTraceListener" />
<remove name="Default" />
<add name ="fileListener" />
</listeners>
</source>
</sources>
<switches>
<!--
Possible values for switches: Off, Error, Warning, Info, Verbose
Verbose: includes Error, Warning, Info, Trace levels
Info: includes Error, Warning, Info levels
Warning: includes Error, Warning levels
Error: includes Error level
-->
<add name="Microsoft.Xrm.Tooling.Connector.CrmServiceClient" value="Verbose" />
<add name="Microsoft.Xrm.Tooling.CrmConnectControl" value="Verbose" />
<add name="Microsoft.Xrm.Tooling.WebResourceUtility" value="Verbose" />
</switches>
<sharedListeners>
<add name="fileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="XRMToolingLogs.log" />
<!--<add name="eventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="XRMTooling" />-->
</sharedListeners>
</system.diagnostics>
</configuration>
I was able to work around this by configuring the listener programmatically through:
Microsoft.Xrm.Tooling.Connector.TraceControlSettings.TraceLevel = System.Diagnostics.SourceLevels.All;
Microsoft.Xrm.Tooling.Connector.TraceControlSettings.AddTraceListener(new TextWriterTraceListener("log.txt"));
Which pointed me to the actual error which was that the CrmServiceClient was expecting a URL with the organization unique name instead of the URL name.