Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricKeyValueStoreReplica8'

KrishnaSai Polanki 1 Reputation point
2022-03-15T07:29:45.117+00:00
Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricKeyValueStoreReplica8'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{FB87EC27-FFF9-4C03-820E-41A7EF38E732}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"   at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)\r\n   at System.Fabric.Interop.NativeRuntime.IFabricKeyValueStoreReplica8.CreateTransaction()\r\n   at System.Fabric.KeyValueStoreReplica.CreateTransactionHelper(KeyValueStoreTransactionSettings settings)\r\n   at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.KvsActorStateProviderBase.<SaveStateAtomicallyAsync>d__119.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorStateProviderHelper.<>c__DisplayClass18_0.<<ExecuteWithRetriesAsync>b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorStateProviderHelper.<ExecuteWithRetriesAsync>d__19`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorStateManager.<SaveStateAsync>d__16.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.Actor.<DoSaveStateAsync>d__9.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorManager.<OnPostInvokeAsync>d__52.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorManager.<DispatchToActorConcurrencyLockHeldAsync>d__60`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorManager.<DispatchToActorAsync>d__33`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at Microsoft.ServiceFabric.Actors.Runtime.ActorManager.<DispatchToActorAsync>d__33`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Services.Remoting.Runtime.ServiceRemotingCancellationHelper.<DispatchRequest>d__5`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Actors.Remoting.V2.Runtime.ActorServiceRemotingDispatcher.<HandleActorMethodDispatchAsync>d__7.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Services.Remoting.V2.FabricTransport.Runtime.FabricTransportMessageHandler.<RequestResponseAsync>d__7.MoveNext()","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467262,"Source":"mscorlib","WatsonBuckets":null},"HelpURL":null,"StackTraceString":"   at Microsoft.ServiceFabric.Services.Communication.Client.ServicePartitionClient`1.<InvokeWithRetryAsync>d__23`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Services.Remoting.V2.Client.ServiceRemotingPartitionClient.<InvokeAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.<InvokeAsyncV2>d__21.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.ServiceFabric.Services.Remoting.Builder.ProxyBase.<ContinueWithResultV2>d__20`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  • Service Fabric is deployed on-premise
  • The above error is getting intermittently when we are trying to access a particular actor.
  • All the actors are hosted on a single host and have a single replica.
  • Service Fabric Version - 8.2.1486
  • Actor NuGet version - 5.2.1486
  • Remoting Nuget Version - 5.2.1486
Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
252 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 18,522 Reputation points Microsoft Employee
    2022-03-17T01:20:19.95+00:00

    Issue description:
    I see that you are seeing an error when trying to access an actor for service fabric deployed on-premise.

    Recommendation:
    This issue can happen due to the older version of Service fabric SDK. Please try updating the local service fabric SDK and try again.
    You can find the download link here : https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started#install-the-sdk-and-tools

    Let me know if you are still seeing issues and I can investigate further. Thanks.


  2. KrishnaSai Polanki 1 Reputation point
    2022-04-22T04:23:50.8+00:00

    Thanks for the solution @KarishmaTiwari-MSFT , the issue got resolved after making the DTOs Serializable.

    0 comments No comments