You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using run.sh to launch a dotnet application using 10.33.1 does not properly set CORECLR_NEW_RELIC_HOME (or the now deprecated CORECLR_NEWRELIC_HOME) variable, leading to the agent failing.
Description
I have a Docker container with the latest Debian package 10.33.1 of newrelic-dotnet-agent.
The entry point is set to ENTRYPOINT ["/usr/local/newrelic-dotnet-agent/run.sh", "dotnet", "Application.dll"]
The application starts up and runs, however the newrelic dotnet agent is no loaded and running. There are no log files in the /usr/local/newrelic-dotnet-agent/logs folder. Checking the dotnet /proc/7/maps file shows that libNewRelicProfiler.so is not loaded into memory anywhere.
Inspecting /proc/7/environ file of the dotnet process shows that there is no CORECLR_NEW_RELIC_HOME or CORECLR_NEWRELIC_HOME environment variable set. Instead there is a new/undocumented NRHOME variable set instead.
Expected Behavior
The application should launch successfully with proper new relic agent monitoring, with logs showing the agent is running in /usr/local/newrelic-dotnet-agent/logs
Observe that running docker exec bug ls -l /usr/local/newrelic-dotnet-agent/logs returns total 0 indicating that there are no log files in the expected directory
Observe that running docker exec bug cat /proc/7/environ spits out a environment string which looks like the following which doesn't have a CORECLR_NEW_RELIC_HOME OR CORECLR_NEWRELIC_HOME environment variable set, instead it has a NRHOME environment variable instead.
Additionally, running docker exec bug cat /proc/7/maps spits how a long list of memory mapped files which doesn't include any references to libNewRelicProfiler.so or any of the dotnet assemblies in newrelic-dotnet-agent directory
Your Environment
Running WSL on Windows 10 w/ docker desktop 4.35.1
dotnet sdk 8.0.11
new relic agent 10.33.1
Additional context
To fix the issue, CORECLR_NEWRELIC_HOME or CORECLR_NEW_RELIC_HOME must be set manually in the DockerFile
7. run echo ENV CORECLR_NEWRELIC_HOME=/usr/local/newrelic-dotnet-agent >> DockerFile
8. run docker build -f DockerFile ./bin/Debug/net8.0 -t fixed
9. run docker run -d --name fixed fixed
Observe now that running docker exec fixed ls -l /usr/local/newrelic-dotnet-agent/logs
total 8
-rw-r--r-- 1 root root 2058 Nov 15 20:28 NewRelic.Profiler.8.log
-rw-r--r-- 1 root root 408 Nov 15 20:28 newrelic_agent_NewRelicBug.log
This seems to have been introduced by #2852 when build/Linux/build/common/run.sh was changed as follows
Since run.sh no longer sets CORECLR_NEWRELIC_HOME or CORECLR_NEW_RELIC_HOME, the agent can't start properly since AgentInstallConfiguration.cs is only looking for these two variables.
The text was updated successfully, but these errors were encountered:
Using run.sh to launch a dotnet application using 10.33.1 does not properly set CORECLR_NEW_RELIC_HOME (or the now deprecated CORECLR_NEWRELIC_HOME) variable, leading to the agent failing.
Description
I have a Docker container with the latest Debian package 10.33.1 of newrelic-dotnet-agent.
The entry point is set to
ENTRYPOINT ["/usr/local/newrelic-dotnet-agent/run.sh", "dotnet", "Application.dll"]
The application starts up and runs, however the newrelic dotnet agent is no loaded and running. There are no log files in the /usr/local/newrelic-dotnet-agent/logs folder. Checking the dotnet
/proc/7/maps
file shows that libNewRelicProfiler.so is not loaded into memory anywhere.Inspecting
/proc/7/environ
file of the dotnet process shows that there is no CORECLR_NEW_RELIC_HOME or CORECLR_NEWRELIC_HOME environment variable set. Instead there is a new/undocumented NRHOME variable set instead.Expected Behavior
The application should launch successfully with proper new relic agent monitoring, with logs showing the agent is running in /usr/local/newrelic-dotnet-agent/logs
Steps to Reproduce
mkdir NewRelicBug
cd .\NewRelicBug
dotnet new webapp --no-https
dotnet build
docker build -f DockerFile ./bin/Debug/net8.0 -t bug
docker run -d -name bug bug
Observe that running
docker exec bug ls -l /usr/local/newrelic-dotnet-agent/logs
returnstotal 0
indicating that there are no log files in the expected directoryObserve that running
docker exec bug cat /proc/7/environ
spits out a environment string which looks like the following which doesn't have a CORECLR_NEW_RELIC_HOME OR CORECLR_NEWRELIC_HOME environment variable set, instead it has a NRHOME environment variable instead.Additionally, running
docker exec bug cat /proc/7/maps
spits how a long list of memory mapped files which doesn't include any references to libNewRelicProfiler.so or any of the dotnet assemblies in newrelic-dotnet-agent directoryYour Environment
Running WSL on Windows 10 w/ docker desktop 4.35.1
dotnet sdk 8.0.11
new relic agent 10.33.1
Additional context
To fix the issue, CORECLR_NEWRELIC_HOME or CORECLR_NEW_RELIC_HOME must be set manually in the DockerFile
7. run
echo ENV CORECLR_NEWRELIC_HOME=/usr/local/newrelic-dotnet-agent >> DockerFile
8. run
docker build -f DockerFile ./bin/Debug/net8.0 -t fixed
9. run
docker run -d --name fixed fixed
Observe now that running
docker exec fixed ls -l /usr/local/newrelic-dotnet-agent/logs
This seems to have been introduced by #2852 when build/Linux/build/common/run.sh was changed as follows
Since run.sh no longer sets CORECLR_NEWRELIC_HOME or CORECLR_NEW_RELIC_HOME, the agent can't start properly since AgentInstallConfiguration.cs is only looking for these two variables.
The text was updated successfully, but these errors were encountered: