-
Notifications
You must be signed in to change notification settings - Fork 132
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
AspNetCore OutputCacheMiddleware throws NullReferenceException from BlockingMIddleware #5440
Comments
Hi there, We can't seem to reproduce the issue with the Could you try running the application without the tracer and see if the exception is still happening? |
Hey Anna, thanks for replying! |
Hi again, |
I added OutputCache attributes to a few controllers in my service, and I see this issue occurs a lot since then -
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.OutputCaching.OutputCacheMiddleware.TryServeCachedResponseAsync(OutputCacheContext context, OutputCacheEntry cacheEntry, IReadOnlyList
1 policies) at Microsoft.AspNetCore.OutputCaching.OutputCacheMiddleware.InvokeAwaited(HttpContext httpContext, IReadOnlyList
1 policies)at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 140
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 140
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
To Reproduce
Add OutputCache attribute to an endpoint
example - [OutputCache(PolicyName = "DefaultCachePolicy", Duration = 300, VaryByQueryKeys = new[] { "*" }, VaryByHeaderNames = new[] { "Accept-Language" })]
Expected behavior
I will not see this issue appear.
Runtime environment (please complete the following information):
The text was updated successfully, but these errors were encountered: