-
Notifications
You must be signed in to change notification settings - Fork 1k
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
"System.Runtime.Serialization.SerializationException: Failed to deserialize object of type [Akka.Actor.Status+Failure] from the stream. Cause: Index was outside the bounds of the array." After Akka Upgrade from 1.3.14 to 1.4.48 #6760
Comments
What version of Hyperion are you using? |
I am using Hyperion version 0.10.2 (I upgraded from Akka.Serialization.Hyperion 1.3.14-beta & Hyperion 0.9.12 to Akka.Serialization.Hyperion 1.4.2 &Hyperion 0.10.2) |
Yep, that's Hyperion's id alright: akka.net/src/contrib/serializers/Akka.Serialization.Hyperion/HyperionSerializer.cs Line 106 in fe2405d
|
Not sure why That's one issue, but the yours is simpler:
This is a configuration problem - Hyperion is missing from your system's configuration. Can you please provide your configuration and any |
|
That is the akka configuration |
Ah got it, sorry I missed that earlier in your post.
So given that strict binding, why would a What output do you get when you start your |
|
Not sure why this is an issue with your application, but I found the problem:
That section is missing the Hyperion serializer definition. If you add the following to your HOCON:
Then that work-around should alleviate the issue. |
Thank you for your support, I try it and let you know the outcome |
@ayooyeyipo did my work-around help solve the issue? |
I am trying it out in our staging environment, I will let know the outcome when I finished, maybe by tomorrow |
I have tired it, the work around did not solve the issue. |
Below is the akka configuration from akka.log-config-on-start = on |
|
The exception: |
This only happens when the copy application is running on more than one machine in the same cluster. |
serialization-identifiers : {
"Akka.Serialization.ByteArraySerializer, Akka" : 4
"Akka.Serialization.NewtonSoftJsonSerializer, Akka" : 1
"Akka.Remote.Serialization.ProtobufSerializer, Akka.Remote" : 2
"Akka.Remote.Serialization.DaemonMsgCreateSerializer, Akka.Remote" : 3
"Akka.Remote.Serialization.MessageContainerSerializer, Akka.Remote" : 6
"Akka.Remote.Serialization.MiscMessageSerializer, Akka.Remote" : 16
"Akka.Remote.Serialization.PrimitiveSerializers, Akka.Remote" : 17
"Akka.Remote.Serialization.SystemMessageSerializer, Akka.Remote" : 22
"Akka.Cluster.Serialization.ClusterMessageSerializer, Akka.Cluster" : 5
"Akka.Cluster.Tools.PublishSubscribe.Serialization.DistributedPubSubMessageSerializer, Akka.Cluster.Tools" : 9
"Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion" : -5
} Those settings are correct, so maybe that binding wasn't the issue (although the error message indicates as such) - looks like Hyperion really is being used here:
@ayooyeyipo are you using a blend of .NET Framework AND .NET Core inside your network? |
Yes |
The request is coming from .NET framework application which is not part of the cluster to this Service (.NET Core, F#, Giraffe) and from there it is forwarded to another application in the cluster. |
It was working fine before the upgrade |
Check 1 - Do This FirstAre you using the same version of Hyperion on all nodes? Because https://github.com/akkadotnet/Hyperion/releases/tag/0.10.0 introduced significant changes to how x-plat serialization works between .NET and .NET Framework in order to standardize differences between namespaces for primitive types. If you're running separate versions on one but not the other, you'll have this problem. Check 2If you are using the same versions of Hyperion in all applications and are still having this problem, you can disable the X-PLAT behavior we introduced in 0.10.0 ( akkadotnet/Hyperion#208) without downgrading To restore the older behavior, you might need to use the var setup = HyperionSerializerSetup.Create(preserveObjectReferences: true, versionTolerance:true,
knownTypesProvider: null,
packageNameOverrides: new List<Func<string, string>>()); // empty package overrides list
var myOtherHocon = ConfigurationFactory.ParseString("akka.actor.provider = remote"); // rest of HOCON
var bootstrapSetup = BootstrapSetup.Create().WithConfig(myOtherHocon).And(setup);
var actorSystem = ActorSystem.Create("MySys", bootstrapSetup); This should disable that new feature introduced in Hyperion 0.10.0 - am I correct about that @Arkatufus ? |
Can I downgrade only Hyperion and Akka.Serialization.Hyperion, leave the other packages? |
I think so - the Akka.Serialization.Hyperion package doesn't use much of the Akka.NET APIs (just serialization, which we haven't changed.) |
@ayooyeyipo please let us know if you do this and it works successfully. |
Ok |
I downgraded to the Hyperion version before the upgrade which was 0.9.12 and `Akka.Serialization.Hyperion (1.3.14-beta). Index was outside the bounds of the array. |
|
Can I upgrade to Akka 1.4.46 and the akka version of the other services in the cluster are below 1.4.46 |
@ayooyeyipo I think that is the best course of action for now, 1.4.46 would be the most updated version that has the closest serialization model with 1.3.14 |
Closing this issue for now. |
Version Information
Version of Akka.NET?
1.4.48
Which Akka.NET Modules?
Akka, Akka.Cluster, Akka.Remote, Akka.Cluster.Tools, Akka.Serialization.Hyperion, Hyperion
Describe the bug
After Akka upgrade from
To
Service is getting this:
Deserialization failed for message with serializer id [-5] and manifest [:]. Transient association error (association remains live). Failed to deserialize object of type [Akka.Actor.Status+Failure] from the stream. Cause: Index was outside the bounds of the array. Could not find any internal Akka.NET serializer with Id [-5]. Please create an issue in our GitHub at [https://github.com/akkadotnet/akka.net]
System.Runtime.Serialization.SerializationException: Failed to deserialize object of type [Akka.Actor.Status+Failure] from the stream. Cause: Index was outside the bounds of the array.
---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at lambda_method(Closure , Stream , DeserializerSession )
at Hyperion.ValueSerializers.ObjectSerializer.ReadValue(Stream stream, DeserializerSession session)
--- End of inner exception stack trace ---
at Hyperion.ValueSerializers.ObjectSerializer.ReadValue(Stream stream, DeserializerSession session)
at Hyperion.Serializer.Deserialize[T](Stream stream)
at Akka.Serialization.HyperionSerializer.FromBinary(Byte[] bytes, Type type)
at Akka.Serialization.Serialization.Deserialize(Byte[] bytes, Int32 serializerId, String manifest)
at Akka.Remote.MessageSerializer.Deserialize(ExtendedActorSystem system, Payload messageProtocol)
at Akka.Remote.DefaultMessageDispatcher.Dispatch(IInternalActorRef recipient, Address recipientAddress, Payload message, IActorRef senderOption)
at Akka.Remote.EndpointReader.b__11_0(InboundPayload inbound)
To Reproduce
Steps to reproduce the behavior:
The service is in a cluster with another service, below is the second service Akka version
The service is sending request to the second service Via Ask
Expected behavior
When the service send request to the second service it should get back a result
Actual behavior
it get back results 80% of the time, 25% of the time its ask timeout and the exception above("System.Runtime.Serialization.SerializationException: Failed to deserialize object of type [Akka.Actor.Status+Failure] from the stream. Cause: Index was outside the bounds of the array."). Before the upgrade it was getting the back result 99% of the time and the exception above is new
Environment
Docker, .NET Core 3.1
Additional context
Akka Configuration of the service
The text was updated successfully, but these errors were encountered: