.Net 4.7.2 Application Crashing

Kibana version: 8.13.0

Elasticsearch version: 8.13

APM Server version: 8.13.0

APM Agent language and version: Profiler 1.26.0

Fresh install or upgraded from other version? Fresh install

Notes:

  • APM .net agent works fine to add traces. We had no issues with this
  • The reason we were exploring the profiler as an option was to give us SQL tracing, as I believe this isn't supported with the agent in .net framework mentioned here
  • Microsoft.Data.SqlClient is used, 1.1.3, but we have tried upgrading this with no success
  • We have tried removing all references to the Elastic APM agent in code also, this does not have any affect.
  • Screenshots in comments, as im a new user

Description of the problem:
When starting our application after enabling the profiler with the below script, our application crashes (screenshot below of some logs). When the profiler is disabled, the application loads as normal.

Script to init profiler:

$appcmd = "$($env:systemroot)\system32\inetsrv\AppCmd.exe"
$appPool = "AppPoolName" 
$profilerHomeDir = "C:\source\ApmProfiler\elastic_apm_profiler_1.26.0-win-x64" 
$environment = @{
  COR_ENABLE_PROFILING = "1"
  COR_PROFILER = "{FA65FE15-F085-4681-9B20-95E04F6C03CC}"
  COR_PROFILER_PATH = "$profilerHomeDir\elastic_apm_profiler.dll"
  ELASTIC_APM_PROFILER_HOME = "$profilerHomeDir"
  ELASTIC_APM_PROFILER_INTEGRATIONS = "$profilerHomeDir\integrations.yml"
  ELASTIC_APM_SERVER_URL = "https://XYZ:8200" 
  ELASTIC_APM_PROFILER_LOG = "trace"
}

$environment.Keys | ForEach-Object {
  & $appcmd set config -section:system.applicationHost/applicationPools /+"[name='$appPool'].environmentVariables.[name='$_',value='$($environment[$_])']"
}

image

Hi, @agierens. I'm sorry to hear about this crash. As a starting point, could you please try v1.28.6? There are fixes since 1.26.0, which might help in some scenarios.

Do any of the profiler/agent logs get produced before the crash? Are there any errors towards the end that might line up with the crash if they are present?

Hi Steve,

We did try with the latest with no luck.

The only error we saw in the trace logs from the profiler was an error related to Postgres integration, so we disabled via the integration exclusion variable, but that made no difference unfortunately.

I will provide the trace logs asap, I will just need to remove some IP. Should have this to you in the next 24h

Do you have any recommendations on getting other traces or debugging this somehow?

@agierens It might be worth opening an issue on our repo so we can track this more formally.

The next step after the logs would be to try to capture a crash dump to investigate what triggers the crash.

Will do - Thanks. Will post the github link for tracking after I have created it so others can track if they run into the same issue :slight_smile:

Github link: [BUG] .Net 4.7.2 Application Crashing · Issue #2449 · elastic/apm-agent-dotnet · GitHub