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

Executing opentelemetry-instrument.exe on an app with a path with space doesn't work #3238

Open
eerhardt opened this issue Feb 4, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@eerhardt
Copy link

eerhardt commented Feb 4, 2025

Describe your environment

OS: Windows
Python version: 3.13.1
Package version: opentelemetry-instrument 0.50b0

What happened?

Trying to instrument an app with a space in the path doesn't appear to work.

Steps to Reproduce

D:\My Temp\AspireWithPython\InstrumentedPythonProject>.venv\Scripts\opentelemetry-instrument.exe --traces_exporter otlp --logs_exporter console,otlp --metrics_exporter otlp "D:\My Temp\AspireWithPython\InstrumentedPythonProject\.venv\Scripts\python.exe" app.py

D:\My: can't open file 'D:\\My Temp\\AspireWithPython\\InstrumentedPythonProject\\Temp\\AspireWithPython\\InstrumentedPythonProject\\.venv\\Scripts\\python.exe': [Errno 2] No such file or directory

Expected Result

I expect the app to run successfully.

Actual Result

The above error occurs:

D:\My: can't open file 'D:\\My Temp\\AspireWithPython\\InstrumentedPythonProject\\Temp\\AspireWithPython\\InstrumentedPythonProject\\.venv\\Scripts\\python.exe': [Errno 2] No such file or directory

Additional context

Initially reported through AddPythonApp crashes because it does not double quote paths with spaces in arguments list (dotnet/aspire#6841).

Would you like to implement a fix?

None

@xrmx
Copy link
Contributor

xrmx commented Feb 6, 2025

I don't know if there's something windows specific (double backward slackes looks suspicious) but it's saying that the path you provided as Python binary does not exist.

@eerhardt
Copy link
Author

eerhardt commented Feb 6, 2025

but it's saying that the path you provided as Python binary does not exist.

The binary does exist on disk.

I believe the opentelemetry-instrument.exe isn't parsing the arguments correctly. Check the very first characters of the output:

D:\My: can't open....

It is cutting off at the space in the folder My Temp

@eerhardt
Copy link
Author

eerhardt commented Feb 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants