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

Problems connecting to host when latest hyperion serializer is used (Akka 1.3.0) #11

Closed
Ralf1108 opened this issue Aug 21, 2017 · 6 comments
Milestone

Comments

@Ralf1108
Copy link

Hi,

some days ago an issue with "Akka.Serialization.Hyperion" and latest Hyperion serializer was resolved:
akkadotnet/akka.net#2976

Now i want to try out Petabridge.Cmd.
When i connect to the host the client hangs.
In server log I see following stack trace:

Akka: (InfoLevel) - [INFO][21.08.2017 09:24:15][Thread 0014][[akka://So3ClusterServer/user/petabridge.cmd#521606962]] Received petabridge.cmd connection from client [127.0.0.1:14549] Petabridge.Cmd.Host.AkkaCmdListener: [15] INFO - 2017-08-21 11:24:15,055: Received petabridge.cmd connection from client [127.0.0.1:14549] Akka.Actor.OneForOneStrategy: [8] ERROR - 2017-08-21 11:24:15,080: Error while creating actor instance of type Petabridge.Cmd.Host.AkkaCmdController with 3 args: ([akka://So3ClusterServer/system/IO-TCP/$a/$b#2038589342],System.Collections.Generic.Dictionary2[System.String,Petabridge.Cmd.Host.CommandPaletteHandler],127.0.0.1:14549)
[akka://So3ClusterServer/user/petabridge.cmd/127.0.0.1%3A14549#1125075362]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Petabridge.Cmd.Host.AkkaCmdController with 3 args: ([akka://So3ClusterServer/system/IO-TCP/$a/$b#2038589342],System.Collections.Generic.Dictionary2[System.String,Petabridge.Cmd.Host.CommandPaletteHandler],127.0.0.1:14549) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Hyperion.SerializerOptions..ctor(Boolean, Boolean, System.Collections.Generic.IEnumerable1<Hyperion.Surrogate>, System.Collections.Generic.IEnumerable1<Hyperion.SerializerFactories.ValueSerializerFactory>, System.Collections.Generic.IEnumerable1<System.Type>)'.
at Petabridge.Cmd.Serialization.CommandSerializer..ctor()
at Petabridge.Cmd.Host.AkkaCmdController..ctor(IActorRef connection, IReadOnlyDictionary2 palettes, IPEndPoint clientEndpoint) --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, Object[] args) at Akka.Actor.Props.ActivatorProducer.Produce() at Akka.Actor.Props.NewActor() --- End of inner exception stack trace --- at Akka.Actor.Props.NewActor() at Akka.Actor.ActorCell.CreateNewActorInstance() at Akka.Actor.ActorCell.<>c__DisplayClass109_0.<NewActor>b__0() at Akka.Actor.ActorCell.UseThreadContext(Action action) at Akka.Actor.ActorCell.NewActor() at Akka.Actor.ActorCell.Create(Exception failure) --- End of inner exception stack trace --- at Akka.Actor.ActorCell.Create(Exception failure) at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState) Akka: (ErrorLevel) - [ERROR][21.08.2017 09:24:15][Thread 0014][akka://So3ClusterServer/user/petabridge.cmd/127.0.0.1%3A14549] Error while creating actor instance of type Petabridge.Cmd.Host.AkkaCmdController with 3 args: ([akka://So3ClusterServer/system/IO-TCP/$a/$b#2038589342],System.Collections.Generic.Dictionary2[System.String,Petabridge.Cmd.Host.CommandPaletteHandler],127.0.0.1:14549)
Cause: [akka://So3ClusterServer/user/petabridge.cmd/127.0.0.1%3A14549#1125075362]: Akka.Actor.ActorInitializationException: Exception during creation ---> System.TypeLoadException: Error while creating actor instance of type Petabridge.Cmd.Host.AkkaCmdController with 3 args: ([akka://So3ClusterServer/system/IO-TCP/$a/$b#2038589342],System.Collections.Generic.Dictionary2[System.String,Petabridge.Cmd.Host.CommandPaletteHandler],127.0.0.1:14549) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Hyperion.SerializerOptions..ctor(Boolean, Boolean, System.Collections.Generic.IEnumerable1<Hyperion.Surrogate>, System.Collections.Generic.IEnumerable1<Hyperion.SerializerFactories.ValueSerializerFactory>, System.Collections.Generic.IEnumerable1<System.Type>)'.
at Petabridge.Cmd.Serialization.CommandSerializer..ctor()
at Petabridge.Cmd.Host.AkkaCmdController..ctor(IActorRef connection, IReadOnlyDictionary`2 palettes, IPEndPoint clientEndpoint)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Actor.Props.ActivatorProducer.Produce()
at Akka.Actor.Props.NewActor()
--- End of inner exception stack trace ---
at Akka.Actor.Props.NewActor()
at Akka.Actor.ActorCell.CreateNewActorInstance()
at Akka.Actor.ActorCell.<>c__DisplayClass109_0.b__0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Actor.ActorCell.NewActor()
at Akka.Actor.ActorCell.Create(Exception failure)
--- End of inner exception stack trace ---
at Akka.Actor.ActorCell.Create(Exception failure)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
FullException:
Exception: Akka.Actor.ActorInitializationException
Message:
Exception during creation
Stacktrace:
at Akka.Actor.ActorCell.Create(Exception failure)
at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)


InnerException:
Exception: System.TypeLoadException
Message:
Error while creating actor instance of type Petabridge.Cmd.Host.AkkaCmdController with 3 args: ([akka://So3ClusterServer/system/IO-TCP/$a/$b#2038589342],System.Collections.Generic.Dictionary`2[System.String,Petabridge.Cmd.Host.CommandPaletteHandler],127.0.0.1:14549)
Stacktrace:
at Akka.Actor.Props.NewActor()
at Akka.Actor.ActorCell.CreateNewActorInstance()
at Akka.Actor.ActorCell.<>c__DisplayClass109_0.b__0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Actor.ActorCell.NewActor()
at Akka.Actor.ActorCell.Create(Exception failure)

 ------------------------------------------------------------
 InnerException:
      Exception: System.Reflection.TargetInvocationException
      Message:
      Exception has been thrown by the target of an invocation.
      Stacktrace:
         at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Actor.Props.ActivatorProducer.Produce()
at Akka.Actor.Props.NewActor()

      ------------------------------------------------------------
      InnerException:
           Exception: System.MissingMethodException
           Message:
           Method not found: 'Void Hyperion.SerializerOptions..ctor(Boolean, Boolean, System.Collections.Generic.IEnumerable`1<Hyperion.Surrogate>, System.Collections.Generic.IEnumerable`1<Hyperion.SerializerFactories.ValueSerializerFactory>, System.Collections.Generic.IEnumerable`1<System.Type>)'.
           Stacktrace:
              at Petabridge.Cmd.Serialization.CommandSerializer..ctor()

at Petabridge.Cmd.Host.AkkaCmdController..ctor(IActorRef connection, IReadOnlyDictionary`2 palettes, IPEndPoint clientEndpoint)

Akka: (InfoLevel) - [INFO][21.08.2017 09:24:15][Thread 0008][akka://So3ClusterServer/system/IO-TCP/$a/$b] Message SocketReceived from akka://So3ClusterServer/deadLetters to akka://So3ClusterServer/system/IO-TCP/$a/$b was not delivered. 1 dead letters encountered.
Akka.Actor.LocalActorRef: [26] INFO - 2017-08-21 11:24:15,086: Message SocketReceived from akka://So3ClusterServer/deadLetters to akka://So3ClusterServer/system/IO-TCP/$a/$b was not delivered. 1 dead letters encountered.`


As there are no sources for Petabridge.Cmd are available i cannot check whats happening there.
But for me it looks like it is the same issue already solved in Akka 1.3.0.

Hyperion.SerializerOptions ctor was extended by an optional parameter. So Petabridge.Cmd would have to be recompiled against latest Hyperion.

@Ralf1108
Copy link
Author

Ralf1108 commented Aug 21, 2017

Investigating the Petabridge.Cmd assemblies gave following results:

  • They are compiled old Akka (1.1.3.31)
  • Petabridge.Cmd.Common is compiled against "Hyperion 0.9.2.2)
  • Exception occurs in ctor of "Petabridge.Cmd.Serialization.CommandSerializer" because it instantiates Hyperion SerializerOptions with missing last argument, at least in IL code the last argument was not compiled in)

So all in all... recompilation with latest Hyperion packages should fix the issue again :-)

Btw: Never thought about that optional arguments creates this amount of troubles... but for backward compatibility they can break stuff. Overloading ctor is more backward compatible.

@Aaronontheweb Aaronontheweb modified the milestone: 0.3.0 Aug 23, 2017
@Aaronontheweb
Copy link
Member

@Ralf1108 we are dumping Hyperion in its entirety for the 0.3.0 milestone. Necessary for #13 to be implemented. See the milestone link for timeframe.

@boca
Copy link

boca commented Sep 14, 2017

I might be having a related issue. I have updated to Hyperion 0.96 and Akka.Serialization.Hyperion.1.3.1-beta52. When I try to connect the client throws a
serialization error: Object reference not set to an instance of an object.
the host only shows
2017-09-14 12:56:44 [Information] Received petabridge.cmd connection from client ["127.0.0.1:4261"]
2017-09-14 12:56:44 [Information] "petabridge.cmd client disconnected. Shutting down..."
2017-09-14 12:56:44 [Information] "Terminating petabridge.cmd connection to client."
image

@Aaronontheweb
Copy link
Member

@boca we just released Petabridge.Cmd v0.3.0 last night,, which supports Akka.NET 1.3.1 and no longer uses Hyperion for serialization. We've migrated over to Google Protobuf instead.

We'll be publishing a blog post today or tomorrow, but for time being you can read the release notes here: https://cmd.petabridge.com/RELEASE_NOTES.html#v030-september-13-2017

@boca
Copy link

boca commented Sep 14, 2017

I was using the v0.3.0 host package but my client was 0.2.0. After updating the client it worked.
Thanks a lot Aaron.

@Aaronontheweb
Copy link
Member

@boca ah got it, yep that would do it. We broke wire compatibility between the pbm client and the Petabridge.Cmd.Host in order to migrate to Protobuf3 from Hyperion... Which we did in order to ensure that we only needed one pbm binary in order to communicate with both .NET and .NET Core applications (since the namespaces for primitive types like int and string are different in .NET core and .NET 4.*)

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

No branches or pull requests

3 participants