-
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
Null reference exception due to RemoteActorRefProvider.RemoteInternals being null #4579
Null reference exception due to RemoteActorRefProvider.RemoteInternals being null #4579
Comments
Problem only occurs when I use a logger. If I comment out the following line in my configuration file the error doesn't occur:
I'm going to assume I'm doing something wrong here and the problem is on my end, so I'll be closing the issue. |
@crasshacker we had another user report this issue when running with the Serilog logger enabled. My guess is that it has to do with the logger plugins not being up to date. We're going to try pushing updates to each of them and see if that resolves the issue. |
Serilog upgrade to Akka.NET v1.4.10 did not fix this. Going to create a reproduction spec and try again. |
added reproduction for akkadotnet/akka.net#4579
So this NRE that is thrown - it's still caught internally here right? akka.net/src/core/Akka/Event/Logging.cs Lines 106 to 116 in 3705c8c
In which case, this exception shouldn't be getting propagated to any of your own code even though it might get picked up when the debugger is attached. Is that the case or am I missing something? |
I figured out why this exception is thrown inside Akka.Logger.Serilog: That I am 99% sure that the NLog logger does the same thing. But the important thing is that both of these exceptions are handled. There's no crashing / issues to worry about it. The loggers tried to grab ahold of the Akka.Remote bound address before it was populated, which can happen when lots of things are starting up asynchronously during That being said, we can rewrite the way these loggers are initialized so this error doesn't come up - but it's something you can typically only see when SourceLink is enabled and Just My Code is disabled since the exception does get handled by Akka.NET's own code by the looks of it. |
Based on the feedback we've received from our Serliog user - looks like this is indeed a first chance exception. I'll apply the same patch I just applied to Akka.Logger.Serilog to the NLog logger and that should resolve this issue. |
I'll close this out with a patch to https://github.com/AkkaNetContrib/Akka.Logger.NLog |
* Recreating Akka.Remote LogSource race condition added reproduction for akkadotnet/akka.net#4579 * close #4579 for Serliog only - need to make a similar change for NLog * minor fixup
avoid first-chance exception with NLog logger when it launches
Going to do a push of Akka.Logger.NLog v1.4.10 in a few moments which should resolve this - thanks for your report @crasshacker |
* Resolved Akka.Remote LogSource race condition (#118) * Recreating Akka.Remote LogSource race condition added reproduction for akkadotnet/akka.net#4579 * close #4579 for Serliog only - need to make a similar change for NLog * minor fixup * Bump AkkaVersion from 1.4.10 to 1.4.11 (#119) Bumps `AkkaVersion` from 1.4.10 to 1.4.11. Updates `Akka` from 1.4.10 to 1.4.11 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md) - [Commits](akkadotnet/akka.net@1.4.10...1.4.11) Updates `Akka.TestKit.Xunit2` from 1.4.10 to 1.4.11 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md) - [Commits](akkadotnet/akka.net@1.4.10...1.4.11) Updates `Akka.Cluster` from 1.4.10 to 1.4.11 - [Release notes](https://github.com/akkadotnet/akka.net/releases) - [Changelog](https://github.com/akkadotnet/akka.net/blob/dev/RELEASE_NOTES.md) - [Commits](akkadotnet/akka.net@1.4.10...1.4.11) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> * Update Release Notes for Release 1.4.11 Co-authored-by: Aaron Stannard <aaron@petabridge.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
I have a .NET 5 WPF application using Akka and Akka.Remote v1.4.10. The application crashes in a manner that looks similar to the situation described in issue #4530, when I add a remote provider to the app's HOCON config file. (This is the first time I've done this; until now all actors have been in-process.) In particular, the exception is thrown on line 156 of RemoteActorRefProvider:
A null reference exception is thrown here because RemoteInternals is null. Stack trace:
Akka.Remote.dll!Akka.Remote.RemoteActorRefProvider.Transport.get() Line 156
Akka.Remote.dll!Akka.Remote.RemoteActorRefProvider.DefaultAddress.get() Line 190
Akka.dll!Akka.Event.LogSource.FromActorRef(Akka.Actor.IActorRef a, Akka.Actor.ActorSystem system) Line 110
Akka.dll!Akka.Event.LogSource.FromActor(Akka.Actor.IActorContext actor, Akka.Actor.ActorSystem system) Line 103
Akka.dll!Akka.Event.LogSource.Create(object o, Akka.Actor.ActorSystem system) Line 62
Akka.dll!Akka.Event.Logging.GetLogger(Akka.Actor.IActorContext context, Akka.Event.ILogMessageFormatter logMessageFormatter) Line 212
Akka.Logger.NLog.dll!Akka.Logger.NLog.NLogLogger.NLogLogger() Unknown
[Native to Managed Transition]
[Managed to Native Transition]
System.Private.CoreLib.dll!System.RuntimeType.CreateInstanceDefaultCtorSlow(bool publicOnly, bool wrapExceptions, bool fillCache) Line 4005
System.Private.CoreLib.dll!System.Activator.CreateInstance(System.Type type, bool nonPublic, bool wrapExceptions) Line 97
System.Private.CoreLib.dll!System.RuntimeType.CreateInstanceImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture) Line 3935
System.Private.CoreLib.dll!System.Activator.CreateInstance(System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, object[] args, System.Globalization.CultureInfo culture, object[] activationAttributes) Line 38
Akka.dll!Akka.Actor.Props.ActivatorProducer.Produce() Line 639
Akka.dll!Akka.Actor.Props.NewActor() Line 575
Akka.dll!Akka.Actor.ActorCell.CreateNewActorInstance() Line 350
Akka.dll!Akka.Actor.ActorCell.NewActor.AnonymousMethod__0() Line 335
Akka.dll!Akka.Actor.ActorCell.UseThreadContext(System.Action action) Line 374
Akka.dll!Akka.Actor.ActorCell.NewActor() Line 341
Akka.dll!Akka.Actor.ActorCell.Create(System.Exception failure) Line 446
Akka.dll!Akka.Actor.ActorCell.SysMsgInvokeAll(Akka.Dispatch.SysMsg.EarliestFirstSystemMessageList messages, int currentState) Line 267
Akka.dll!Akka.Actor.ActorCell.SystemInvoke(Akka.Dispatch.SysMsg.ISystemMessage envelope) Line 335
Akka.dll!Akka.Dispatch.Mailbox.ProcessAllSystemMessages() Line 409
Akka.dll!Akka.Dispatch.Mailbox.Run.AnonymousMethod__36_0() Line 358
Akka.dll!Akka.Actor.ActorCell.UseThreadContext(System.Action action) Line 374
Akka.dll!Akka.Dispatch.Mailbox.Run() Line 355
Akka.dll!Akka.Dispatch.ThreadPoolExecutorService..cctor.AnonymousMethod__3_0(object t) Line 28
System.Private.CoreLib.dll!System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() Line 856
System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() Line 655
System.Private.CoreLib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() Line 29
The text was updated successfully, but these errors were encountered: