FabricClient error on version 2.8.211

Category: azure service fabric

Question

marvs perez on Mon, 25 Sep 2017 10:56:16


Hi,
I update my service fabric service project reference to the latest version
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="2.8.211" />
But now I'm getting exception when I try to use fabric client, e.g.
var fc = new FabricClient("localhost:19000")

I'm getting this error:

`Unhandled Exception: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricClusterManagementClient10'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A4ACEB4F-2E2B-4BE1-9D12-44FE8CB5FB20}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
   at System.Fabric.FabricClient.CreateNativeClient(IEnumerable`1 connectionStringsLocal)
   at System.Fabric.Interop.Utility.<>c__DisplayClass27_0.<WrapNativeSyncInvoke>b__0()
   at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)
   at System.Fabric.Interop.Utility.RunInMTA(Action action)
   at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credentialArg, FabricClientSettings newSettings, String[] hostEndpointsArg)
   at ASFClusterMaintenance.ASFClusterManager.CreateFabricClient()
   at ASFClusterMaintenance.ASFClusterManager..ctor(String clusterConnectionString, String sslThumbprint, String username, String password)
   at ASFClusterMaintenance.Program.Main(String[] args)`

Replies

Wayne Munro on Mon, 25 Sep 2017 11:48:33


Have the same problem after applying nugget package updates. Is there a updated SDK and runtime that can be downloaded as I can't see to find anything related?

marvs perez on Tue, 26 Sep 2017 02:47:03


I send this link to azure support twitter. Hope to hear from them soon.

rktect on Tue, 26 Sep 2017 03:08:24


I'm having similar error on update to 2.8.111 - it's very easy to reproduce:

  1. Create new SF application - select ASP.NET Core Stateless Service (creates with 2.7.198 packages)
  2. Deploy and run application (works fine)
  3. Upgrade solution packages to 2.8.111
  4. Deploy and run application (results in error below)

"Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricNodeContextResult2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{472BF2E1-D617-4B5C-A91D-FABED9FF3550}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))."

Mikkel Mørk Hegnhøj on Tue, 26 Sep 2017 04:17:08


I've commented on the GitHub issue here: https://github.com/Azure/service-fabric-issues/issues/476

In most scenarios, you will need the 6.0 runtime for the 2.8 NuGet packages to work. You can get the new runtime through Web Platform Installer.

/Mikkel

marvs perez on Tue, 26 Sep 2017 04:30:41


Yeah, I found it this morning I have not update the runtime and SDK as it was not yet available yesterday.

marvs perez on Tue, 26 Sep 2017 04:32:45


@rktect You can update your SDK and runtime now. Installer is now available.  https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started


rktect on Tue, 26 Sep 2017 14:47:19


New runtime fixes the issue - will note this for future updates.

Thanks for following up :)

Gertjan van Montfoort on Thu, 28 Sep 2017 10:05:15


In our case the client worked just fine. However when publishing to our Azure service fabric cloud cluster we got the "InvalidCastException".

In Azure in the service fabric portal there is a "Fabric upgrades" page that was set to "Automatic". However the version still was 5.7.217.9494 so our cluster was not up to date. We set it to manual and initiated the upgrade process by hand in the same screen. This worked for us.

Mikkel Mørk Hegnhøj on Sun, 01 Oct 2017 02:51:32


Hi Gertjan,In the 6.0 release we didn't upgrade clusters - but just made the version available in Azure. This is now in the release post to explain this behavior.

/Mikkel