When trying to use Hyperion as the default serializer in Akka 1.3, I get the error below:
=================================================================
System.Reflection.TargetInvocationException occurred
HResult=0x80131604
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
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.Serialization.Serialization..ctor(ExtendedActorSystem system)
at Akka.Actor.Internal.ActorSystemImpl..ctor(String name, Config config)
at Akka.Actor.ActorSystem.Create(String name, Config config)
at HyperionIssueTestApp.Program.Main(String[] args) in c:\users\b025423\documents\visual studio 2017\Projects\HyperionIssueTestApp\HyperionIssueTestApp\Program.cs:line 31
Inner Exception 1:
1<Hyperion.Surrogate>, System.Collections.Generic.IEnumerable1I've attached a simplified project that demonstrates the issue. If I leave the serializer as default, it works fine. Also, Using this same project with 1.2.3 Akka was working fine.
Check if you are not referencing older version of hyperion somewhere. Had the same error referencing v0.9.2 instead of v0.9.5.
The example project i gave above was a brand new project that had never referenced the previous versions
I had the same issue with my project. I also tried a brand new but same error still appeared.
Seems there is something strange. There are two different packages for Hyperion v0.9.5.
I had one cached with
public SerializerOptions(bool versionTolerance = false, bool preserveObjectReferences = false, IEnumerable<Surrogate> surrogates = null, IEnumerable<ValueSerializerFactory> serializerFactories = null, IEnumerable<Type> knownTypes = null)
and when I forced downloading it again, it has
public SerializerOptions(bool versionTolerance = false, bool preserveObjectReferences = false, IEnumerable<Surrogate> surrogates = null, IEnumerable<ValueSerializerFactory> serializerFactories = null, IEnumerable<Type> knownTypes = null, bool ignoreISerializable = false)
Notice the additional ignoreISerializable parameter at the end.
So i seem Akka.Serialization.Hyperion was compiled against the one without ignoreISerializable parameter
Edit:
Also package hawing ignoreISerializable parameter has no debug symbols and the other one has them
I just created a new project. .Net 4.5.2
Akka 1.3
Akka.Serialization.Hyperion 1.3.0-beta46
Hyperion 0.9.5
Works as expected.
Please note we had some issues with our versioning scheme of the pre-releases/beta's. It turns out nuget/myget did not support the scheme which we where using. We didn't noticed this, until very recently.
This might be the reason why you downloaded the wrong version.
I've cleaned up all nuget caches and all packages but still the same error.
I've check the Akka.Serialization.Hyperion.dll (1.3.0-beta46), and in IL, it's using the wrong constructor
IL_0071: newobj instance void [Hyperion]Hyperion.SerializerOptions::.ctor(bool, bool, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Hyperion]Hyperion.Surrogate>, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Hyperion]Hyperion.SerializerFactories.ValueSerializerFactory>, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [mscorlib]System.Type>)
@zbynek001 so this is a Hyperion bug then?
No, it's in Akka.Serialization.Hyperion package
Hi, I am getting the same error with Hyperion 0.9.5, Akka.Serialization.Hyperion v1.3.0-beta47 and Akka 1.3.0
Just asked for the error on gitter...
Problem here is that the new optional parameter was introduced but forces all usages (here Akka.Serialization.Hyperion) to be recompiled because the default value will be compiled at the caller site
Would it be an overloaded ctor there would be no problem.
A recompile of "Akka.Serialization.Hyperion" with latest Hyperion package should fix this
Related issue: https://github.com/akkadotnet/Hyperion/issues/71
I can reproduce the error with @mithril52 's sample
@Aaronontheweb
check https://github.com/akkadotnet/Hyperion/issues/71#issuecomment-323092529

Props to https://github.com/bitdiffer/bitdiffer
Issue is you have two different versions of Hyperion in your respective projects. I have no idea how that's possible, but we're nuking it from orbit and going to stage a new release of Hyperion 0.9.6 immediately and update the serializer as well.
There are two issues:
There are two version of Hyperion v0.9.5 package.
ignoreISerializable parameterignoreISerializable parameterand Akka.Serialization.Hyperion was compiled against the older one
Since the older Hyperion package can be already cached, best would be to release a new package version of it first and the recompile Akka.Serialization.Hyperion against it
Ok. The reason it works in my comp. Was because of multiple nuget caches.nuget locals all -clear did the trick for me.
And it fails for me now as well. :P never been so glad to have something fail :P
Meanwhile we also know why this didn't showed up on our test suite. And we are working to push a new version of Akka.Serialization.Hyperion
Issue was that we were compiling against the Hyperion 0.9.5 instance on our MyGet feed instead of the one uploaded to NuGet.org. For whatever reason, they had different versions of the binary.

Verified that this is now fixed. Hyperion.dll referenced from src is the same as what's on NuGet.org now.
Please install the latest beta of Akka.Serialization.Hyperion, v1.3.0-beta48. This fixes the issue and is compiled with the right binary.
still getting exception with latest "Akka.Serialization.Hyperion 1.3.0-beta48".
what did I miss?
@Ralf1108 can you throw a copy of the package you just downloaded here and do a bin compare like I showed how to do earlier? I'm out of time today to fix this issue, but literally anyone off the street can send a pull request into Akka.NET. I've pointed you in the right direction. Please follow through and send in a PR yourself if this continues to be an issue.
yes, i am already trying to do that
BitDiffer is not able to load the Akka.Serialization.Hyperion.dll correctly because it cant find the missing ctor in Hyperion.
Seems for me that the latest commit didn't work like expected

The shortened line is:
Method not found: 'Void Hyperion.SerializerOptions..ctor(Boolean, Boolean, System.Collections.Generic.IEnumerable1<Hyperion.Surrogate>, System.Collections.Generic.IEnumerable1
there still seems to be a cache in the build system which holds the old/broken Hyperion.dll which is used for compilation of the "Akka.Serialization.Hyperion.dll"
Shouldn't be, since we tear down the build server VM after 30 minutes of idle time.
@Ralf1108 can you link the exacty CTOR change diff? I'm just going to call that directly so the build server will blow up on compilation if it's wrong.
as said, BitDiffer is not able to show me the diff. I can fiddle it out in the IL code.
You could try to provide the default value for the ctor parameter "ignoreISerializable" in the "Akka.Serialization.Hyperion.dll". If the broken hyperion is used the build should fail.
offending line in ctors is:
IKnownTypesProvider knownTypesProvider = this.CreateKnownTypesProvider(cDisplayClass40.system, settings.KnownTypesProvider);
bool objectReferences = settings.PreserveObjectReferences;
this._serializer = new Hyperion.Serializer(new SerializerOptions((settings.VersionTolerance ? 1 : 0) != 0, (objectReferences ? 1 : 0) != 0, (IEnumerable
{
surrogate
}, (IEnumerable
IL code shows:
// IL_004b: call instance class Akka.Serialization.IKnownTypesProvider Akka.Serialization.HyperionSerializer::CreateKnownTypesProvider(class [Akka]Akka.Actor.ExtendedActorSystem, class [mscorlib]System.Type)
// IL_0050: stloc.2 // 'knownTypesProvider [Range(Instruction(IL_0050 stloc.2)-Instruction(IL_006b ldloc.2))]'
// IL_0051: ldarg.0 // this
// IL_0052: ldarg.2 // settings
// IL_0053: ldfld bool Akka.Serialization.HyperionSerializerSettings::PreserveObjectReferences
// IL_0058: stloc.3 // 'objectReferences [Range(Instruction(IL_0058 stloc.3)-Instruction(IL_005f ldloc.3))]'
// IL_0059: ldarg.2 // settings
// IL_005a: ldfld bool Akka.Serialization.HyperionSerializerSettings::VersionTolerance
// IL_005f: ldloc.3 // 'objectReferences [Range(Instruction(IL_0058 stloc.3)-Instruction(IL_005f ldloc.3))]'
// IL_0060: ldc.i4.1
// IL_0061: newarr [Hyperion]Hyperion.Surrogate
// IL_0066: dup
// IL_0067: ldc.i4.0
// IL_0068: ldloc.1 // 'surrogate [Range(Instruction(IL_003d stloc.1)-Instruction(IL_0068 ldloc.1))]'
// IL_0069: stelem.ref
// IL_006a: ldnull
// IL_006b: ldloc.2 // 'knownTypesProvider [Range(Instruction(IL_0050 stloc.2)-Instruction(IL_006b ldloc.2))]'
// IL_006c: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1<class [mscorlib]System.Type> Akka.Serialization.IKnownTypesProvider::GetKnownTypes()
// IL_0071: newobj instance void [Hyperion]Hyperion.SerializerOptions::.ctor(bool, bool, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Hyperion]Hyperion.Surrogate>, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [Hyperion]Hyperion.SerializerFactories.ValueSerializerFactory>, class [mscorlib]System.Collections.Generic.IEnumerable`1<class [mscorlib]System.Type>)
// IL_0076: newobj instance void [Hyperion]Hyperion.Serializer::.ctor(class [Hyperion]Hyperion.SerializerOptions)
For me it looks like the default value for the optional parameter was not compiled in, but I am no IL code expert.
and it actually failed :)
HyperionSerializer.cs(74,21): error CS1739: The best overload for 'SerializerOptions' does not have a parameter named 'ignoreISerializable'
time for explicit Hyperion 0.9.6 ? ;-)
did you execute the "nuget clean cache" on the build controller?
or is the build vm resetted everytime?
yep, it failed only on the Windows machines that run on bare metal (.4.5)
Reason is... wait for it... The machine was imaged with the old NuGet packaged cached locally.
I'm going to just publish 0.9.6 and move past the issue that way.
then we need a new "Akka.Serialization.Hyperion" as well ;-)
https://github.com/akkadotnet/Hyperion/pull/73 - waiting for another member of @akkadotnet/core to go merge that one :p
Hey guys,
sorry but this issue is not fixed yet, exception still thrown.
The "Akka.Serialization.Hyperion" has to be recompiled and released with the latest Hyperion "0.9.6". Without recompilation the default value for the ctor with the optional parameter is not included in the caller site (here Akka.Serialization.Hyperion).
Releasing a new Hyperion version only fixed the mess with cached older Hyperion versions.
Please check comment from zbynek001: https://github.com/akkadotnet/akka.net/issues/2976#issuecomment-323094050
@Ralf1108 yep, we're on it: https://github.com/akkadotnet/akka.net/pull/3003/commits/059b58acfb631a914c13353abeaedbdbb4ac2f95
ups, didn't see that :-)
@Aaronontheweb a recompiled "Akka.Serialization.Hyperion" is also on its way?
Akka.Serialization.Hyperion beta-50 was just published. That will resolve the issue.
I just tried the upgrade on @mithril52's reproduction sample and verified that this issue is indeed resolved by v1.3.0-beta50. Please upgrade.
Yes, can verify that issue is resolved 馃憤
After upgrading to v1.3, I'm trying to run Lighthouse. I noticed that the LighthouseHostFactory never "reads" the "serialization" config from HOCON.
Topshelf.HostFactory: Configuration Result:
[Success] Name Lighthouse
[Success] Description Lighthouse Akka.NET Service Discovery
[Success] ServiceName Lighthouse
Topshelf.HostConfigurators.HostConfiguratorImpl: Topshelf v4.0.0.0, .NET Framework v4.0.30319.42000
Topshelf.Hosts.ConsoleRunHost: An exception occurred 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.IEnumerable11<Hyperion.SerializerFactories.ValueSerializerFactory>, System.Collections.Generic.IEnumerable1
at Akka.Serialization.WireSerializer..ctor(ExtendedActorSystem system)
--- 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.Serialization.Serialization..ctor(ExtendedActorSystem system)
at Akka.Actor.Internal.ActorSystemImpl..ctor(String name, Config config)
at Akka.Actor.ActorSystem.Create(String name, Config config)
at Lighthouse.LighthouseHostFactory.LaunchLighthouse(String ipAddress, Nullable1 specifiedPort) in C:\Code\Archive\lib\Lighthouse\LighthouseHostFactory.cs:line 80
at Lighthouse.LighthouseService.InitializeCluster() in C:\Code\Archive\lib\Lighthouse\LighthouseService.cs:line 92
at Lighthouse.LighthouseService.Start(HostControl hostControl) in C:\Code\Archive\lib\Lighthouse\LighthouseService.cs:line 46
at Topshelf.Builders.ControlServiceBuilder1.ControlServiceHandle.Start(HostControl hostControl)
at Topshelf.Hosts.ConsoleRunHost.Run()`
I tried to uninstall it ... got this:
Severity Code Description Project File Line Suppression State
Error Unable to uninstall 'Hyperion.0.9.6' because 'Akka.Serialization.Wire.1.2.3.407-beta' depends on it. 0
@jalchr seems to be the same issue. Try recompile Lighthouse library with latest Hyperion
@jalchr is it possible, that Lighthouse use latest Akka.Serialization.Hyperion?
https://www.nuget.org/packages/Akka.Serialization.Hyperion/1.3.0-beta50
Lighthouse still needs to be updated afaik.
@Ralf1108 I'm already compiling it against all latest packages. Still getting that error.
What surprised me what that Wire is calling Hyperion O_o
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 Akka.Serialization.**WireSerializer**..ctor(ExtendedActorSystem system)
WireSerializer targets Hyperion.
I am running into the same issue. Currently I am referencing 1.3.3-beta56 for Akka.Serialization.Hyperion and 0.9.8 for Hyperion. If it helps, I have my own custom HyperionSerializer implementing Akka.Serialization.Serializer. Anything I am doing wrong?
The error I get is
Unhandled Exception: System.MissingMethodException: Constructor on type 'SPGMI.D
ata.MTS.Serialization.Hyperion.AkkaHyperionSerializer' not found.
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder bin
der, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCra
wlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binde
r binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Akka.Serialization.Serialization..ctor(ExtendedActorSystem system)
at Akka.Actor.Internal.ActorSystemImpl..ctor(String name, Config config)
at Akka.Actor.ActorSystem.Create(String name, Config config)
at SPGMI.Services.Data.MTS.SeedNode.LighthouseHostFactory.LaunchLighthouse(St
ring ipAddress, Nullable`1 specifiedPort) in C:\Projects\ContentSystems\Developm
ent\MTS\SPGMI.Data.MTS\SPGMI.Services.Data.MTS.SeedNode\LighthouseHostFactory.cs
:line 56
at SPGMI.Services.Data.MTS.SeedNode.LighthouseService.Start() in C:\Projects\
ContentSystems\Development\MTS\SPGMI.Data.MTS\SPGMI.Services.Data.MTS.SeedNode\L
ighthouseService.cs:line 26
at SPGMI.Services.Data.MTS.SeedNode.Program.Main(String[] args) in C:\Project
s\ContentSystems\Development\MTS\SPGMI.Data.MTS\SPGMI.Services.Data.MTS.SeedNode
\Program.cs:line 10
@leo12chandu have you specified assembly along with the type in your HOCON serializer config? Or have you defined a public constructor for it? It clearly cannot find the valid constructor.
That was it, our constructor was not public. Thank You.
Most helpful comment
Yes, can verify that issue is resolved 馃憤