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

NullReferenceException in Akka.Persistence.Serialization.MessageSerializer.PersistentPayloadToProto #1235

Closed
LukeTillman opened this issue Aug 11, 2015 · 4 comments

Comments

@LukeTillman
Copy link
Contributor

I'm trying to run tests after Akka.Persistence.Cassandra was upgraded to use Akka 1.0.4 and I'm consistently getting a NRE like this:

System.NullReferenceException was unhandled by user code
  HResult=-2147467261
  Message=Object reference not set to an instance of an object.
  Source=Akka.Persistence
  StackTrace:
       at Akka.Persistence.Serialization.MessageSerializer.PersistentPayloadToProto(Object payload)
       at Akka.Persistence.Serialization.MessageSerializer.PersistentToProto(IPersistentRepresentation p)
       at Akka.Persistence.Serialization.MessageSerializer.ToBinary(Object obj)
       at Akka.Persistence.Cassandra.Journal.CassandraJournal.Serialize(IPersistentRepresentation message) in d:\DataStax\Akka.Persistence.Cassandra\src\Akka.Persistence.Cassandra\Journal\CassandraJournal.cs:line 361
       at Akka.Persistence.Cassandra.Journal.CassandraJournal.WriteConfigurationValue[T](String key, T value) in d:\DataStax\Akka.Persistence.Cassandra\src\Akka.Persistence.Cassandra\Journal\CassandraJournal.cs:line 349
       at Akka.Persistence.Cassandra.Journal.CassandraJournal.PreStart() in d:\DataStax\Akka.Persistence.Cassandra\src\Akka.Persistence.Cassandra\Journal\CassandraJournal.cs:line 85
       at Akka.Actor.ActorBase.AroundPreStart()
       at Akka.Actor.ActorCell.<>c__DisplayClass4c.<Create>b__4b()
       at Akka.Actor.ActorCell.UseThreadContext(Action action)
       at Akka.Actor.ActorCell.Create(Exception failure)
  InnerException: 

Looks like it's coming from this line here:

https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Persistence/Serialization/MessageSerializer.cs#L140

When TransportInformation is null. I'm guessing fb03e9d may have introduced the issue. Not sure if fixing this is as simple as just adding a null check on TransportInformation before calling the Address property or if that property shouldn't be null in this case indicating some other bug.

@Aaronontheweb
Copy link
Member

cc @Horusiath @rogeralsing any ideas why this was dependent on TransportInformation in the first place? Specific to this plugin to in general across Akka.Persistence?

trbngr pushed a commit to trbngr/akka.net that referenced this issue Aug 22, 2015
…here to the practice of including an addres with the serialized binary.
rogeralsing added a commit that referenced this issue Aug 22, 2015
Fixes the NullReferenceException in #1235
@Horusiath
Copy link
Contributor

As I remember, after a short discussion with Typesafe team they pointed us out, that things like actor refs and paths that are stored, may be recovered from persistence backend on the different machine, that they were saved on, so their base paths may be changed.

@rogeralsing
Copy link
Contributor

Is this still an issue? or did trbngr@3df119f fix it?

@Horusiath
Copy link
Contributor

Closing that one. No updates in the last 9 months.

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