Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Getting System.InvalidCastException after updating SDK to 7.1.1951 and Runtime to 10.1.1951 #1495

Open
hedinaili opened this issue Apr 19, 2024 · 4 comments
Labels
type-code-defect Something isn't working

Comments

@hedinaili
Copy link

Getting this exception after updating the SDK and runtime to versions 7.1.1951 to 10.1.1951 respectively

System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricServiceManagementClient8'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{27309DB9-61A7-AE11-967A-BBFF7D5A5460}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

part of the stack trace

"System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'IFabricServiceManagementClient8'. 
This operation failed because the QueryInterface call on the COM component for the interface with IID '
{27309DB9-61A7-AE11-967A-BBFF7D5A5460}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).\r\n  
 at System.Fabric.FabricClient.CreateNativeClient(IEnumerable`1 connectionStringsLocal)\r\n   at System.Fabric.Interop.Utility.<>c__DisplayClass28_0.<WrapNativeSyncInvoke>b__0()\r\n  
 at System.Fabric.Interop.Utility.WrapNativeSyncInvoke[TResult](Func`1 func, String functionTag, String functionArgs)\r\n   
 at System.Fabric.Interop.Utility.RunInMTA(Action action)\r\n 
 at System.Fabric.FabricClient.InitializeFabricClient(SecurityCredentials credentialArg, FabricClientSettings newSettings, String[] hostEndpointsArg)\r\n  
 at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.<>c.<GetDefault>b__22_0()\r\n  
 at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.GetClient()\r\n 
 at Microsoft.ServiceFabric.Services.Client.ServicePartitionResolver.<ResolveHelperAsync>d__30.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.Communication.Client.CommunicationClientFactoryBase`1.<GetClientAsync>d__24.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.Communication.Client.ServicePartitionClient`1.<GetCommunicationClientAsync>d__28.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.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.Communication.Client.ServicePartitionClient`1.<InvokeWithRetryAsync>d__25.MoveNext()


The code invoking this was not changed

@hedinaili hedinaili added the type-code-defect Something isn't working label Apr 19, 2024
@tuhland
Copy link

tuhland commented Apr 19, 2024

This usually occurs when the SF nuget packages are way too old, or ahead of the installed sdk / runtime version.

@hedinaili
Copy link
Author

@tuhland I mentioned the versions used, they are the current ones

@tuhland
Copy link

tuhland commented Apr 19, 2024

Yes I know.

What I meant is, that this error usually occurs when the nuget packages your application uses differ too much from the installed cluster version. Updating the nuget packages and not the cluster runtime (either local or in the cloud) is a sure fire way to get this error.

We run into this frequently when we update the nuget packages and some of the devs did not update their local development cluster to the latest version Which most if them don't do, because it's a tedious manual process.

So make sure you not only updated the packages to the latest version, but also downloaded and installed the SDK / Runtime from here:
https://github.com/microsoft/service-fabric/blob/master/release_notes/Service_Fabric_ReleaseNotes_101CU2.md

If you did both, this might be a different issue.

@hedinaili
Copy link
Author

@tuhland SDK and runtime versions are 7.1.1951 to 10.1.1951 respectively
which are the current ones..

@hedinaili hedinaili changed the title Getting System.InvalidCastException after updating SDK to 7.1.1951 and Runtime to 10.1.1951 [BUG] Getting System.InvalidCastException after updating SDK to 7.1.1951 and Runtime to 10.1.1951 May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-code-defect Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants