question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v7 fails with Microsoft.Orleans.Hosting.Kubernetes

See original GitHub issue

When v7 is used with Microsoft.Orleans.Hosting.Kubernetes 7.0.0 it fails to interact with ClusterVersion CRD (see logs below). The hosting library is using KubernetesClient 7.0.7 while v7 clustering us using 6.0.19. The root cause is that KubernetesClient 7.0.7 library is used at runtime and it changes object returned by ListNamespacedCustomObjectAsync, GetNamespacedCustomObjectAsync, etc. from Newtonsoft.Json.Linq.JObject (assumed in 6.0.19) to System.Text.Json.JsonElement.

{"EventId":0,"LogLevel":"Warning","Category":"Orleans.Clustering.Kubernetes.KubeMembershipTable","Message":"We tried to Initialize ClusterVersion but fail. Ignoring for now...","Exception":"System.InvalidCastException: Unable to cast object of type \u0027System.Text.Json.JsonElement\u0027 to type \u0027Newtonsoft.Json.Linq.JObject\u0027.    at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()","State":{"Message":"We tried to Initialize ClusterVersion but fail. Ignoring for now...","{OriginalFormat}":"We tried to Initialize ClusterVersion but fail. Ignoring for now..."},"Scopes":[]}
{"EventId":0,"LogLevel":"Warning","Category":"Orleans.Clustering.Kubernetes.KubeMembershipTable","Message":"Failure reading all silo entries for cluster id actors-silo","Exception":"System.InvalidCastException: Unable to cast object of type \u0027System.Text.Json.JsonElement\u0027 to type \u0027Newtonsoft.Json.Linq.JObject\u0027.    at Orleans.Clustering.Kubernetes.KubeMembershipTable.GetClusterVersion()    at Orleans.Clustering.Kubernetes.KubeMembershipTable.ReadAll()","State":{"Message":"Failure reading all silo entries for cluster id actors-silo","ClusterId":"actors-silo","{OriginalFormat}":"Failure reading all silo entries for cluster id {ClusterId}"},"Scopes":[]}

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rsirnycommented, Jan 20, 2023

I can try to fix it by upgrading KubernetesClient to 7.x.y version and switching from NewtonsoftJson to System.Text.Json. The officially supported Kubernetes version would go from 1.22 to 1.23.

Would that be ok with @galvesribeiro ?

cc @SamEmber

Read more comments on GitHub >

github_iconTop Results From Across the Web

Microsoft.Orleans.Hosting.Kubernetes 7.2.1
Microsoft Orleans hosting support for Kubernetes. ... NET 7.0 .NET CLI; Package Manager; PackageReference; Paket CLI; Script & Interactive; Cake.
Read more >
Orleans Clustering Provider for Kubernetes
This provider behaves like any regular application being hosted on Kubernetes. That means it doesn't care about the underlying kubernetes security model. In ......
Read more >
Orleans Voting sample app on Kubernetes
This is an Orleans sample application that demonstrates deployment to Kubernetes. The application is a simplistic Web app for voting on a ...
Read more >
Server configuration - Orleans
Learn how to configure .NET Orleans server settings.
Read more >
Microsoft Orleans documentation
Learn to use the Orleans SDK for .NET. Browse API reference, sample code, tutorials, quickstarts, conceptual articles and more.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found