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

Got "Could not load type 'k8s.Models.V1ObjectMeta' from assembly KubernetesClient" exception if using in FSharp Orleans Project #66

Open
clement128 opened this issue May 3, 2023 · 3 comments

Comments

@clement128
Copy link

clement128 commented May 3, 2023

Hi there,

I was just tried to use version 2.1.0 in my fsharp project with orleans 3.7, but I got Could not load type 'k8s.Models.V1ObjectMeta' from assembly KubernetesClient exception when the application startup. Does anyone encountered similar issue? thanks

[02:05:40 ERR] Lifecycle start canceled due to errors at stage 8000: System.TypeLoadException: Could not load type 'k8s.Models.V1ObjectMeta' from assembly 'KubernetesClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()
   at Orleans.Clustering.Kubernetes.KubeMembershipTable.InitializeMembershipTable(Boolean tryInitTableVersion)
   at Orleans.Runtime.MembershipService.MembershipTableManager.Start() in /_/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs:line 164
   at Orleans.Runtime.MembershipService.MembershipTableManager.<>c__DisplayClass54_0.<<Orleans-ILifecycleParticipant<Orleans-Runtime-ISiloLifecycle>-Participate>g__OnRuntimeGrainServicesStart|0>d.MoveNext() in /_/src/Orleans.Runtime/MembershipService/MembershipTableManager.cs:line 859
@clement128 clement128 changed the title Got "Could not load type 'k8s.Models.V1ObjectMeta' from assembly KubernetesClient" exception if using in FSharp Got "Could not load type 'k8s.Models.V1ObjectMeta' from assembly KubernetesClient" exception if using in FSharp Orleans Project May 3, 2023
@tobbin2
Copy link

tobbin2 commented Jul 10, 2023

Have the same issue, it feels like it has to do with using the correct versions on orleans and kubernetes client. But i can't find any docs regarding that

@slonopotamus
Copy link

slonopotamus commented Jul 10, 2023

You need to downgrade KubernetesClient to 6.x.

If your app uses Microsoft.Orleans.Hosting.Kubernetes, it can pull in a newer KubernetesClient. So, downgrade Microsoft.Orleans.Hosting.Kubernetes to <= 3.5.1.

@tobbin2
Copy link

tobbin2 commented Jul 10, 2023

Aah nice thanks, had to add kubernetesClient nuget also manually with that version. For some reason did it decide to use v7.2.0. Got another error so hopefully it will work soon 👍


EDIT

Never mind, it didn't work, well i got this error when upgrading kubernetes to 1.25, i get the feeling that the configuration error other packages has had regarding getting kubernetes container ID is the main issue for me.
I however don't use F-Sharp, i use .net 5.0 so this might be another thread for this question?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants