WebOptimizer icon indicating copy to clipboard operation
WebOptimizer copied to clipboard

NullReferenceException in AssetPipeline.TryGetAssetFromRoute()?

Open oculys-andrew opened this issue 6 years ago • 1 comments

Starting around 11:20pm EST on Feb 10, a web site of ours started throwing NullReferenceExceptions, apparently from AssetPipeline.TryGetAssetFromRoute(), on (it seems) every request. There were no new deployments or changes on the server for the previous week, so we're not sure what precipitated this; the web site is deployed on Azure, so some kind of transient issue within the cloud or in the underlying VM is possible. We restarted the web site, and since then everything seems to be working normally.

The stack trace on the errors seems to have been the same every time, and I'm pasting it below. This obviously isn't a lot to go on, so please let me know if there's anything I can do to investigate further, or if you can suggest things to try that might replicate it. The deployed site was running v1.0.201 of LigerShark.WebOptimizer.Core and v1.0.34-beta of LigerShark.WebOptimizer.Sass, and is an ASP.NET Core 2 website running on .NET Framework 4.6.1.

System.NullReferenceException: Object reference not set to an instance of an object.
   at WebOptimizer.AssetPipeline.TryGetAssetFromRoute(String route, IAsset& asset)
   at WebOptimizer.AssetMiddleware.InvokeAsync(HttpContext context, IOptionsSnapshot`1 options)
   at lambda_method(Closure , Object , HttpContext , IServiceProvider )
   at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass4_1.<UseMiddleware>b__2(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.<Invoke>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at XXXXX.XXXXX.Web.Simplified.Startup.<>c.<<Configure>b__10_2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.<Invoke>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at XXXXX.XXXXX.Web.Simplified.Middleware.ExceptionResponseMiddleware.<InvokeAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Diagnostics.StatusCodePagesMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at XXXXX.XXXXX.Web.Simplified.Middleware.SerilogMiddleware.<Invoke>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.<Invoke>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.<Invoke>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Frame`1.<ProcessRequestsAsync>d__2.MoveNext()```

oculys-andrew avatar Feb 11 '19 19:02 oculys-andrew

I restarted the server and everything went well..., this is very curious.

rosdi avatar Oct 27 '20 07:10 rosdi