-
Notifications
You must be signed in to change notification settings - Fork 109
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
Randomly occurring NullReferenceException #165
Comments
Hmm. That's a really weird one. Looks like it's happening deep in MVC code. Forunately, the It has a precondition which asserts that 🤔 |
And the code for |
Hmm, could it be that the requests have a wildcard Accept header and it's the exception message that fails? It tries to get the In any case, this is probably an issue for dotnet/aspnetcore 😄 |
Nope, that's not it. When generating methods for strings containing formatting arguments for the |
I think that's not the case. However we are still investigating and trying to reproduce the issue. Thanks for the time. |
We experienced the same problem but we figured out it was caused by being on an old version of ProblemDetails. What worries me is that the OP reports using a version that, according to my investigation, should have this problem fixed. We haven't had time to thoroughly check the issue no longer occurs but early results look promising. Maybe some information about the problem will be helpful: The ProblemDetails 5.4.0 provided the Once a null element ends up in But this appears to have been fixed by ProblemDetails v5.4.1: the middleware no longer passes the original singleton collection to the Executor but it passes its clone instead. Therefore I'm interested to know, is the OP definitely on 6.4.0 and not 5.4.0? Is it possible the race condition on I will post again on how we fare with the newer version of the NuGet. |
Thanks for the excellent analysis @kamilk! 🙏🏻 The fact that the executor actually mutates the |
Hi! All of our webservices use ProblemDetails middleware. However, going through the logs we found out that in some cases (but not always) when an exception occurs during the execution of the application another exception occurs in the ProblemDetails middleware. Here's the stack trace:
What's really odd is that we couldn't find a pattern. We couldn't reproduce the issue by executing some of the failing requests in debug or when the app is deployed. All we can see is that sometimes the beforementioned NullReference exception is thrown.
Any help or guidance will be much appreciated!
Target runtime: NET6.0
Hellang.Middleware.ProblemDetails version: 6.4.0
The text was updated successfully, but these errors were encountered: