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

ClusterSharding.Get(ActorSystem system) fails with TestKit ActorSystem #3051

Closed
newmancodes opened this issue Aug 30, 2017 · 3 comments
Closed

Comments

@newmancodes
Copy link

newmancodes commented Aug 30, 2017

.net framework v4.6.1
Akka.Net v1.3.0
Akka.Cluster.Sharding v1.3.0-beta50
Akka.TestKit v1.3.0

Executing on Windows

TestKit is being created with this HOCON - via constructor on TestKit that accepts a Config object.

akka {
loglevel = INFO
actor {
serialize-creators = off
serialize-messages = on
serializers {
hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
}
serialization-bindings {
"System.Object" = hyperion
}
serialization-settings {
hyperion {
version-tolerance = true
}
}
}
persistence {
snapshot-store {
plugin = "akka.persistence.no-snapshot-store"
}
}
}

When the call to ClusterSharding.Get(ActorSystem system) is performed a NullReferenceException is thrown with the following call stack.

System.NullReferenceException : Object reference not set to an instance of an object.
at Akka.Cluster.ClusterSettings..ctor(Config config, String systemName)
at Akka.Cluster.Cluster..ctor(ActorSystemImpl system)
at Akka.Cluster.ClusterExtension.CreateExtension(ExtendedActorSystem system)
at Akka.Actor.ExtensionIdProvider1.Akka.Actor.IExtensionId.CreateExtension(ExtendedActorSystem system) at Akka.Actor.Internal.ActorSystemImpl.<>c__DisplayClass56_0.<RegisterExtension>b__1() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value()
at Akka.Actor.Internal.ActorSystemImpl.TryGetExtension(Type extensionType, Object& extension)
at Akka.Actor.Internal.ActorSystemImpl.GetExtension(IExtensionId extensionId)
at Akka.Actor.ExtensionIdProvider1.Get(ActorSystem system) at Akka.Actor.ExtensionIdProvider1.Akka.Actor.IExtensionId.Get(ActorSystem system)
at Akka.Actor.Internal.ActorSystemImpl.RegisterExtension(IExtensionId extension)
at Akka.Actor.ActorSystemWithExtensions.WithExtension[T,TI](ActorSystem system)
at Akka.Cluster.Sharding.ClusterSharding..ctor(ExtendedActorSystem system)
at Akka.Cluster.Sharding.ClusterShardingExtensionProvider.CreateExtension(ExtendedActorSystem system)
at Akka.Actor.ExtensionIdProvider1.Akka.Actor.IExtensionId.CreateExtension(ExtendedActorSystem system) at Akka.Actor.Internal.ActorSystemImpl.<>c__DisplayClass56_0.<RegisterExtension>b__1() at System.Lazy1.CreateValue()
at System.Lazy1.LazyInitValue() at System.Lazy1.get_Value()
at Akka.Actor.Internal.ActorSystemImpl.TryGetExtension(Type extensionType, Object& extension)
at Akka.Actor.Internal.ActorSystemImpl.GetExtension(IExtensionId extensionId)
at Akka.Actor.ExtensionIdProvider1.Get(ActorSystem system) at Akka.Actor.ExtensionIdProvider1.Akka.Actor.IExtensionId.Get(ActorSystem system)
at Akka.Actor.Internal.ActorSystemImpl.RegisterExtension(IExtensionId extension)
at Akka.Actor.ActorSystemWithExtensions.WithExtension[T,TI](ActorSystem system)
at Akka.Cluster.Sharding.ClusterSharding.Get(ActorSystem system)

@Horusiath
Copy link
Contributor

Have you used ClusterSharding.DefaultConfig() as a configuration fallback?

@newmancodes
Copy link
Author

I just tried it, and receive the same issue, but thanks for the suggestion.

@newmancodes
Copy link
Author

I've removed the fallback and updated my config to use the cluster actor ref provider and this seems to have cleaned up a lot of the issues.

provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"

A nicer error message might be handy but it's a step forward.

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

2 participants