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

Error with AdditionalDeps on macOS #2036

Closed
pjanotti opened this issue Jan 21, 2023 · 8 comments
Closed

Error with AdditionalDeps on macOS #2036

pjanotti opened this issue Jan 21, 2023 · 8 comments
Assignees

Comments

@pjanotti
Copy link
Contributor

pjanotti commented Jan 21, 2023

[EDIT @pjanotti: please, see temporary workaround in #2181 for Apple M1 and #1744 for dotnet CLI in general]

Full interaction at https://cloud-native.slack.com/archives/C01NR1YLSE7/p1674162631314489

Instrumentation caused a crash on the app even after some workarounds were applied to the instructions for macos. The error message was

An assembly specified in the application dependencies manifest (Openelemetry.AutoInstrumentation.AdditionalDeps.deps.json) was not found: package: 'DnsClient', version: '1.4.0' path: 'lib/netstandard2.1/DnsClient.dil'

There were no logs on the user's machine. Initially, I wasn't able to repro the same on a macos, which indicates that something is still wrong with the user config. However, it is not clear what is broken with the config.

@rajkumar-rangaraj
Copy link
Contributor

Error message indicates it is not able to locate the runtime store. Here are few things we could ask customer to verify.

  • Check DOTNET_SHARED_STORE is pointing to a valid location
  • Validate there are contents in runtime store folder
  • While decompress a zip file, it might have not copied files from store due to long path

@ramanjaneyagupta
Copy link

ramanjaneyagupta commented Jan 23, 2023

DOTNET_SHARED_STORE is pointing to a valid location
And seeing contents in store folder
Tried installing multiple times but still seeing the same issue
Also tried installing latest dotnet version that is 7.0.102

Also tried with another MAC same issue happening

below are the export options

export CORECLR_ENABLE_PROFILING="1"
export CORECLR_PROFILER="{918728DD-259F-4A6A-AC2B-B85E1B658318}"
export CORECLR_PROFILER_PATH="/Users/prg/.otel-dotnet-auto/OpenTelemetry.AutoInstrumentation.Native.dylib"
export DOTNET_ADDITIONAL_DEPS="/Users/prg/.otel-dotnet-auto/AdditionalDeps"
export DOTNET_SHARED_STORE="/Users/prg/.otel-dotnet-auto/store"
export DOTNET_STARTUP_HOOKS="/Users/prg/.otel-dotnet-auto/net/OpenTelemetry.AutoInstrumentation.StartupHook.dll"
export HOME="/Users/prg"
export LANG="en_US.UTF-8"
export LOGNAME="root"
export MAIL="/var/mail/root"
export OLDPWD="/Users/prg/Documents/RAM/dotnet"
export OTEL_DOTNET_AUTO_HOME="/Users/prg/.otel-dotnet-auto"
export OTEL_DOTNET_AUTO_INTEGRATIONS_FILE="/Users/prg/.otel-dotnet-auto/integrations.json"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin"
export PWD="/Users/prg/Documents/RAM/dotnet/getting-started"
export SHELL="/bin/sh"
export SHLVL="1"
export SSH_AUTH_SOCK="/private/tmp/com.apple.launchd.g0RY0MDSki/Listeners"
export SUDO_COMMAND="/bin/sh"
export SUDO_GID="20"
export SUDO_UID="501"
export SUDO_USER="prg"
export TERM="xterm-256color"
export USER="root"

@pellared
Copy link
Member

Can you share a minimal working example so that we can reproduce the issue? I think sharing the code which you want to instrument (I suggest cutting down the code to minimum) and shell (and which shell) commands that you execute.

The problem is that for our examples everything seems to work. All our integration tests are passing on macOS and the smoke test is passing as well. https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/actions/runs/3994013767/jobs/6851250881

@ramanjaneyagupta
Copy link

Mine is Apple M1 not sure it may differ execution environment, but after installing and running

source $HOME/.otel-dotnet-auto/instrument.sh
i am just doing dotnet command that it self is giving the issue.
And mine is very small sample application and it have the following lines

Console.WriteLine("Hello, World!");

var httpClient = new HttpClient();
var response = await httpClient.GetAsync("https://google.com");
Console.WriteLine($"Response Status: {response.StatusCode}");

-> and below is the error

dotnet run
Error:
An assembly specified in the application dependencies manifest (OpenTelemetry.AutoInstrumentation.AdditionalDeps.deps.json) was not found:
package: 'DnsClient', version: '1.4.0'
path: 'lib/netstandard2.1/DnsClient.dll'
sh-3.2$

And the same is executing successfully if i am not doing this step

source $HOME/.otel-dotnet-auto/instrument.sh (indirectly not setting these env variables)

@pellared
Copy link
Member

pellared commented Jan 25, 2023

@ramanjaneyagupta

  1. Take notice that dotnet run won't likely work. See Instrumentation does not work with dotnet CLI #1744
  2. Can you try using sh (or bash) instead of zsh? @pjanotti reported some problems with zsh. If I remember correctly in sh you must use . instead of source. Therefore you should execute: . $HOME/.otel-dotnet-auto/instrument.sh

I think that something like this should work:

dotnet build
sh
. $HOME/.otel-dotnet-auto/instrument.sh
./bin/Debug/YourApp

Let me know if it helps. If it won't help I will do my best to dedicate some time this week and take a deeper look.

@pellared pellared changed the title Error with AdditionalDeps on macos Error with AdditionalDeps on macOS Jan 25, 2023
@ramanjaneyagupta
Copy link

@pellared tried with sh and bash and resulting the same

@pjanotti pjanotti self-assigned this Jan 25, 2023
@RassK
Copy link
Contributor

RassK commented Jan 31, 2023

Mine is Apple M1 not sure it may differ execution environment, but after installing and running

Apple M1 won't be compatible, related issue #1865

@pjanotti
Copy link
Contributor Author

pjanotti commented Feb 9, 2023

Source instrumentations are supported on Apple M1, but, need the temporary workaround in #2181

I'm closing this issue since we should have covered and understood all the issues here.

@pjanotti pjanotti closed this as completed Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants