Skip to content
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

[BUG] APM agent 1.18.0.0 not working on .NET 6 #1904

Closed
karpediemnow opened this issue Nov 15, 2022 · 9 comments · Fixed by #1905
Closed

[BUG] APM agent 1.18.0.0 not working on .NET 6 #1904

karpediemnow opened this issue Nov 15, 2022 · 9 comments · Fixed by #1905
Assignees
Labels

Comments

@karpediemnow
Copy link

APM Agent version

The version of the Elastic.Apm nuget package is 1.18.0.0

Environment

Docker image:
mcr.microsoft.com/dotnet/aspnet:6.0

Application target framework to
net6.0

Describe the bug

image

Work correctly with elastic_apm_profiler version 1.18.0.0

@karpediemnow karpediemnow added the bug Something isn't working label Nov 15, 2022
@z1c0 z1c0 self-assigned this Nov 15, 2022
@z1c0
Copy link
Contributor

z1c0 commented Nov 15, 2022

Hi @karpediemnow,

It looks like you were using DOTNET_STARTUP_HOOKS, is that correct?

Did you follow these instructions?
If yes, could you follow the troubleshooting steps described here (ELASTIC_APM_STARTUP_HOOKS_LOGGING) and attach the logs to this issue?

@z1c0 z1c0 linked a pull request Nov 15, 2022 that will close this issue
@karpediemnow
Copy link
Author

Hi z1c0,
Yes I have followed the "Zero code change" instruction.
I have auto instrumented a .net5.0 application without problems. As soon as possible I will attach the startup logs.

@karpediemnow
Copy link
Author

this is the log:
image

this is my installation path:
image

Thanks for the support ;)

@karpediemnow
Copy link
Author

karpediemnow commented Nov 16, 2022

Probably in Elastic.Apm.StartupHook.Loader the path is wrong:

image

I have found a similar problem on stackoverflow
stackoverflow

We should try:

Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

@z1c0
Copy link
Contributor

z1c0 commented Nov 16, 2022

Hi @karpediemnow,

I tried to reproduce the issue you reported, but to no avail yet.

Testing net60 on Linux with the DOTNET_STARTUP_HOOKS feature is part of our regular CI tests, so we really need to have hit some obscure corner case here.

I also tested this manually with the Docker image you mentioned: mcr.microsoft.com/dotnet/aspnet:6.0, and the latest agent released ElasticApmAgent_1.18.0.zip, but everything worked as expected.

The only way to reproduce the error I saw in your screenshot was to physically remove the Elastic.Apm.dll assembly from the 6.0.0 directory.

Can you double-check the contents of this directory, please?

Also, could you again check these environment variables and paths and add them to the issue:

  • DOTNET_STARTUP_HOOKS
  • `ELASTIC_APM_STARTUP_HOOKS_LOGGING``
  • full path of your ASP.NET 6 application
  • full path of the directory where the downloaded agent is in

@z1c0
Copy link
Contributor

z1c0 commented Nov 17, 2022

Closed by accident, sorry.

@z1c0 z1c0 reopened this Nov 17, 2022
@karpediemnow
Copy link
Author

Hi z1c0,
I have figured out the issue in my dockerfile I use
WORKDIR /app
setting a working directory misconfigure the Assembly.GetExecutingAssembly().Location
;)

@z1c0
Copy link
Contributor

z1c0 commented Nov 17, 2022

Hi @karpediemnow,
so it's working now for you?

@z1c0
Copy link
Contributor

z1c0 commented Nov 21, 2022

Hi @karpediemnow,
since your last comment suggested that the problem is gone and I have not heard back otherwise, I will resolve this issue.
Feel free to reopen it, should the problem still persist.
Thank you for reaching out!

@z1c0 z1c0 closed this as completed Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants