question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InvalidProgramException in 1.9.0 on .NET Core 2.2

See original GitHub issue

Describe the bug API throws an exception rather than completing request

To Reproduce Steps to reproduce the behavior:

  1. Do lots of API requests, and eventually there will be a period of time where many of them throw this exception

Expected behavior Exception is not thrown, and API requests completes normally.

Runtime environment (please complete the following information):

  • Instrumentation mode: manual with NuGet package
  • Tracer version: 1.9.0
  • OS: docker image microsoft/dotnet:2.2-aspnetcore-runtime in EKS kubernetes cluster
  • CLR: .Net Core 2.2

Additional context Stack trace:

System.InvalidProgramException: Common Language Runtime detected an invalid program.
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeResultFilters()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
   at Rethrow(Object )
   at Datadog.Trace.ClrProfiler.Integrations.AspNetCoreMvc2Integration.Rethrow(Object context, Int32 opCode, Int32 mdToken, Int64 moduleVersionPtr)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
   at Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
   at Elmah.Io.AspNetCore.ElmahIoMiddleware.Invoke(HttpContext context)

Packages related to Elmah:

  <ItemGroup>
    <PackageReference Include="Elmah.Io.AspNetCore" Version="3.7.82" />
    <PackageReference Include="Elmah.Io.Client" Version="3.6.73" />
  </ItemGroup>

Mentioned this in #541 after I upgraded to 1.9.0 hoping this issue was fixed. We currently have DataDog tracing disabled in our production API until the issue no longer happens in QA. Maybe related to #564

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fjmorelcommented, Dec 20, 2019

I haven’t had this issue since forcing the docker image to use 2.2.8 instead of whatever 2.2 version it had cached. I tried that after seeing comments in #564.

0reactions
andrewsouthard1commented, Apr 24, 2020

Hey all - we expect this issue to be resolved in later versions of the tracer. We’re going to close this issue but please do reach out again if you run into any problems!

Read more comments on GitHub >

github_iconTop Results From Across the Web

InvalidProgramException in 1.9.0 in .NET Core 2.2 / Fargate
Today I spot again "System.InvalidProgramException: Common Language Runtime detected an invalid program" errors in our logs. To Reproduce
Read more >
InvalidProgramException Class (System)
Initializes a new instance of the InvalidProgramException class with a specified error message and a reference to the inner exception that is the...
Read more >
Angular application does not start under dotnet core / IIS
The problem looks like a bug in how Visual studio handles the startup of the angular server in debug mode: app.UseSpa(spa => {...
Read more >
Common Language Runtime detected an invalid program
It currently seems that solution found from .Net Core Clr issue 18323 has helped to solve this issue for us, but this cannot...
Read more >
Untitled
Common language runtime detected an invalid program .net core ... C# code to insert a block or text - CodeProject InvalidProgramException in 1.9.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found