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

JSonconverter can't deserialize Akka.Actor.Status.Failure #3490

Closed
AndreSteenbergen opened this issue Jun 5, 2018 · 8 comments
Closed

JSonconverter can't deserialize Akka.Actor.Status.Failure #3490

AndreSteenbergen opened this issue Jun 5, 2018 · 8 comments

Comments

@AndreSteenbergen
Copy link
Contributor

Akka 1.3.8
.Net Core 2.0

Create an object of type Akka.Actor.Status.Failure and serialize using JsonConverter. It will trhrow an exception about JObject not being to cast to JValue

This is probably caused by the Exception.

@Aaronontheweb
Copy link
Member

@AndreSteenbergen any idea what the underlying exception was?

@Aaronontheweb Aaronontheweb added this to the 1.3.9 milestone Jun 5, 2018
@AndreSteenbergen
Copy link
Contributor Author

AndreSteenbergen commented Jun 5, 2018

In my case it was Task.Cancelled Exception, inside AggregateException

@Aaronontheweb
Copy link
Member

Ok, that shouldn't be the end of the world. This should be easy enough to reproduce. Happened over an Akka.Remote connection between two .NET Core 2.0 nodes?

@AndreSteenbergen
Copy link
Contributor Author

Yes, in a webcrawler project modified from the examples

@AndreSteenbergen
Copy link
Contributor Author

Bug report is faulted, the deserialization gives errors, I don't know which part is at fault.

@Aaronontheweb Aaronontheweb modified the milestones: 1.3.9, 1.3.10 Sep 5, 2018
@Aaronontheweb Aaronontheweb modified the milestones: 1.3.10, 1.3.11, 1.3.12 Dec 14, 2018
@Zetanova
Copy link
Contributor

Zetanova commented Sep 4, 2019

Akka 1.3.14

I have currently a related problem with RemoteDeploy

An agent is remote deployed and make some work with Akka.Streams.
It throws an System.InvalidOperationException inside SelectAsync(1, ...) of the stream
The exception is handled with the default supervisor strategy and send back to the Deployer.

The deployer throws on receive.

[06:40:43 ERR] AssociationError [akka.tcp://system@controller-01.cluster:2552] <- akka.tcp://system@worker-01.cluster:2552: Error [Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JValue'.] [   at Akka.Remote.EndpointReader.<Reading>b__11_1(InboundPayload inbound)
   at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 )
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
   at Akka.Actor.UntypedActor.Receive(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)]

[06:40:43 ERR] Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JValue'.
System.InvalidCastException: Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JValue'.
   at Akka.Remote.EndpointReader.<Reading>b__11_1(InboundPayload inbound)
   at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 )
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
   at Akka.Actor.UntypedActor.Receive(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)

@Zetanova
Copy link
Contributor

Zetanova commented Sep 4, 2019

I made a separate topic #3903 on the problem

its not realy a problem with the json serializer.
If NodeA RemoteDeployes to NodeB work.
NobeB can use unknown assemblies to NodeA
like SQL-Client, EventStore-Client ...

@Aaronontheweb
Copy link
Member

Real issue here is #3903 - serialization of exceptions in Akka.Remote payloads. Going to address the issue there.

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

No branches or pull requests

4 participants