-
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
Failed to deserialize payload object when deserializing ActorSelectionMessage with payload ... #5383
Comments
Do you have a copy of the serialization exception error message that was thrown? This would be very helpful to diagnose this error. |
This is the full message
And here is the call stack
|
If you try doing the following:
I think that should resolve this issue. This is something I want to fix with automatic loading in the future. |
@Aaronontheweb Thanks! |
I thought it might be helpful to post here the configuration var defaultAkkaConfiguration = ConfigurationFactory.ParseString($@"
akka {{
log-config-on-start = on
loglevel = {akkaSettings.AkkaLogLevel},
loggers = [ ""Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"" ]
suppress-json-serializer-warning = on
actor {{
ask-timeout = 15s
serializers {{
hyperion = ""Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion""
}}
serialization-bindings {{
""System.Object"" = hyperion
}}
serialize-messages = {(akkaSettings.ForceMessagesSerialization ? "on" : "off")}
serialize-creators = {(akkaSettings.ForceCreatorsSerialization ? "on" : "off")}
}}
}}"); var akkaPersistenceConfiguration = ConfigurationFactory.ParseString($@"
akka.persistence {{
journal {{
plugin = ""akka.persistence.journal.sql-server""
sql-server {{
class = ""Akka.Persistence.SqlServer.Journal.{(akkaSettings.Persistence.Journal.UseBatchingJournal ? "Batching" : string.Empty)}SqlServerJournal, Akka.Persistence.SqlServer""
schema-name = dbo
auto-initialize = on
connection-string = ""{GetDbConnectionString()}""
metadata-table-name = AkkaPersistenceMetadata
table-name = AkkaPersistenceEventJournal
circuit-breaker {{
call-timeout = 50s
}}
event-adapters = {{
{GetConfigFromDictionary(akkaSettings.Persistence.Journal.EventAdapters)}
}}
event-adapter-bindings = {{
{GetConfigFromDictionary(akkaSettings.Persistence.Journal.EventAdapterBindings)}
}}
}}
}}
snapshot-store {{
plugin = ""akka.persistence.snapshot-store.sql-server""
sql-server {{
class = ""Akka.Persistence.SqlServer.Snapshot.SqlServerSnapshotStore, Akka.Persistence.SqlServer""
schema-name = dbo
auto-initialize = on
connection-string = ""{GetDbConnectionString()}""
table-name = AkkaPersistenceSnapshotStore
circuit-breaker {{
call-timeout = 50s
}}
}}
}}
query {{
journal {{
sql-server {{
class = ""Akka.Persistence.Query.Sql.SqlReadJournalProvider, Akka.Persistence.Query.Sql""
max-buffer-size = {akkaSettings.Persistence.Query.MaxBufferSize}
refresh-interval = {akkaSettings.Persistence.Query.RefreshInterval}
}}
}}
}}
}}"); private string GetClusterConfig()
{
var clusterInfo = clusterResolver.GetClusterInfo();
var nodes = string.Join(",", clusterInfo.Seeds.Select(t => $@"""akka.tcp://{platformSettings.Name}@{t.Host}:{t.Port}"""));
return $@"
akka {{
actor.provider = cluster
extensions = [""Akka.Cluster.Tools.PublishSubscribe.DistributedPubSubExtensionProvider,Akka.Cluster.Tools""]
remote {{
dot-netty.tcp {{
public-hostname = {clusterInfo.CurrentHost.Host}
public-port = {clusterInfo.CurrentHost.Port}
hostname = 0.0.0.0
port = {platformSettings.ClusterPort}
maximum-frame-size = 2MB
send-buffer-size = 2MB
receive-buffer-size = 2MB
}}
}}
cluster {{
seed-nodes = [{nodes}]
downing-provider-class = ""Akka.Cluster.SBR.SplitBrainResolverProvider, Akka.Cluster""
down-removal-margin = 20s # Keep the same as stable-after
split-brain-resolver {{
active-strategy = keep-majority
stable-after = 20s
down-all-when-unstable = off
}}
failure-detector {{
acceptable-heartbeat-pause = 15s
}}
min-nr-of-members = {akkaSettings.MinNumberOfNodesInCluster}
sharding {{
state-store-mode = persistence
least-shard-allocation-strategy {{
rebalance-threshold = 2
max-simultaneous-rebalance = 3
}}
}}
log-info = on
log-info-verbose = off
pub-sub = {{
role = ""service""
}}
roles = [""service""]
role.[""service""].min-nr-of-members = {akkaSettings.MinNumberOfNodesInCluster}
singleton = {{
role = ""service""
}}
singleton-proxy = {{
role = ""service""
}}
}}
}}";
} var config = configurationProviders
.OrderByDescending(c => c.Priority)
.Where(c => c.Get() != null)
.Aggregate(Config.Empty, (config, provider) =>
{
logger.LogInformation("Using additional Akka configuration from {Provider}: {Config}", provider.GetType().Name, provider.Get().ToString());
return config.WithFallback(provider.Get());
})
.WithFallback(GetDispatcherConfig());
if (akkaSettings.EnableCluster)
{
config = config.WithFallback(ConfigurationFactory.ParseString(GetClusterConfig()));
}
return config
.WithFallback(akkaPersistenceConfiguration)
.WithFallback(defaultAkkaConfiguration); |
So the issue here is that unless this method gets called: akka.net/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManagerSettings.cs Lines 28 to 37 in e27220a
By default the Akka.Cluster.Singleton serializer is not loaded, which you can see is
So in those cases, to solve these serialization errors, you need to manually load the |
I think this has solved the issue. |
Tagging this on akkadotnet/HOCON#48 |
Version Information
Version of Akka.NET? 1.4.24
Which Akka.NET Modules? Akka.Cluster
Describe the bug
Our services throws SerizalizationException when sending a message to a singleton actor.
The text was updated successfully, but these errors were encountered: