ServiceFabric / IFabricSecretStoreClient / COM Exception

1

I'm not finding much on this, and after spending most of the day...I'm looking for help..

The exception I get is this:

Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricSecretStoreClient'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{38C4C723-3815-49D8-BDF2-68BFB536B8C9}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

I'm able to instantiate the proxy to the Stateful Service with this code:

var servicekey = new ServicePartitionKey(0);
  var queryserviceUri = new Uri("fabric:/XXXX/xxxxxxxxxx");
  var proxyHandle = ServiceProxy.Create<IAnInterfaceName>(queryserviceUri, servicekey, TargetReplicaSelector.PrimaryReplica);

Then I use the proxy:

var result = await proxyHandle.OperationOnServiceContract(dataPackage);

At this point I get the error...

Stacktrace...

at System.Fabric.FabricClient.CreateNativeClient(IEnumerable1 connectionStringsLocal) at System.Fabric.Interop.Utility.<>c__DisplayClass27_0.<WrapNativeSyncInvoke>b__0() at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func1 func, String functionTag, String functionArgs) at System.Fabric.Interop.Utility.WrapNativeSyncInvoke(Action action, String functionTag, String functionArgs) at System.Fabric.Interop.Utility.RunInMTA(Action action) at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credentialArg, FabricClientSettings newSettings, String[] hostEndpointsArg) at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.<>c.b__21_0() at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.GetClient() at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.ResolveHelperAsync(Func5 resolveFunc, ResolvedServicePartition previousRsp, TimeSpan resolveTimeout, TimeSpan maxRetryInterval, CancellationToken cancellationToken, Uri serviceUri) at Microsoft.ServiceFabric.Services.Communication.Client.CommunicationClientFactoryBase1.GetClientAsync(Uri serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings, CancellationToken cancellationToken) at Microsoft.ServiceFabric.Services.Remoting.V2.FabricTransport.Client.FabricTransportServiceRemotingClientFactory.GetClientAsync(Uri serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings, CancellationToken cancellationToken) at Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient1.GetCommunicationClientAsync(CancellationToken cancellationToken) at Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient1.InvokeWithRetryAsync[TResult](Func2 func, CancellationToken cancellationToken, Type[] doNotRetryExceptionTypes) at Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceRemotingPartitionClient.InvokeAsync(IServiceRemotingRequestMessage remotingRequestMessage, String methodName, CancellationToken cancellationToken) at Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.InvokeAsyncV2(Int32 interfaceId, Int32 methodId, String methodName, IServiceRemotingRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken) at Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.ContinueWithResultV2[TRetval](Int32 interfaceId, Int32 methodId, Task1 task) at XXXXWeb.Controllers.XXXController.OperationOnServiceContract(XXXRequest xxxRequest) in C:\Users\codputer\Source\Repos\xxxxxx\xxxx.Web\Controllers\XXXController.cs:line 44

oh I'm using this for a listener:

protected override IEnumerable<ServiceReplicaListener> CreateServiceReplicaListeners()
{
  return this.CreateServiceRemotingReplicaListeners();
}
azure-service-fabric
visual-studio-2019
asked on Stack Overflow Dec 8, 2018 by codeputer

1 Answer

3

As noted on these issues:

These COM issues happens whenever you use newer Nuget packages targeting older version of service fabric runtime, this kind of error occurs.

You should always use the packages targeted to the same version of your cluster runtime, on last case, use package older than the cluster version.

answered on Stack Overflow Dec 11, 2018 by Diego Mendes

User contributions licensed under CC BY-SA 3.0