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] Datadog agent silently corrupts Visual Studio Code and other JavaScript applications on a server #21882

Closed
miohtama opened this issue Jan 5, 2024 · 11 comments

Comments

@miohtama
Copy link

miohtama commented Jan 5, 2024

Describe what happened:

Datadog agent silently hooks itself to JavaScript (and Python) applications on a computer. Because the hooks are invasive, and cause side effects and bugs, this will break applications. One of such applications is Visual Studio Code.

Describe what you expected:

Any decision to use Datadog agent in an application should be opt-in by the user and datadog-agent should not silently modify any JavaScript (or Python, as it seems) applications. This is because there is a high chance that datadog-agent breaks complex applications, and this causes unnecessary issues for the application maintainers.

Steps to reproduce the issue:

Additional environment details (Operating System, Cloud provider, etc):

datadog-agent version
Agent 7.47.1 - Commit: 24dcc70 - Serialization version: v5.0.90 - Go version: go1.20.6
Description:    Ubuntu 22.04.3 LTS

One workaround to this is to delete Datadog and use alternative monitoring solutions where the user has opt-in control to allow a monitoring agent to inject (and potentially break) any application.

apt remove datadog-agent
nano /etc/ld.so.preload   # Remove Datadog system level infector
rm -rf /opt/datadog
# Remove the server from Datadog and make sure it is not part of any recurring subscription
@yshapiro-57
Copy link
Contributor

We are able to reproduce this error and are looking into what is causing it.

@gferreri
Copy link

Further noting that running sudo apt-get remove --purge datadog-agent -y does not remedy the problem.

@robbiedhickey
Copy link

Over the last two weeks I have had two separate Windows machines have their Visual Studio 2022 installations corrupted. Repairing the installation and uninstalling/reinstalling Visual Studio did not resolve the issue. The only thing that got me back into working order was a fresh install of Windows.

Reading through this thread made me realize that on both of these machines the datadog-agent was installed shortly before I started experiencing problems.

This sounded similar enough to the issue creator's problem so I wanted to provide another datapoint.

@michel-smarticket
Copy link

Further noting that running sudo apt-get remove --purge datadog-agent -y does not remedy the problem.

@gferreri Did you follow all the steps?

    apt remove datadog-agent
    nano /etc/ld.so.preload   # Remove Datadog system level infector
    rm -rf /opt/datadog
    # Remove the server from Datadog and make sure it is not part of any recurring subscription

I can confirm the issue was fixed once I completely removed the DD agent using the steps above.

@yshapiro-57 Any news on this?

@anselanza
Copy link

I can confirm that removing the Datadog Agent on my remote host also immediately fixed the problems I was having with basic VSCode extensions (e.g. Source Control / Git).

Needless to say, it is very frustrating having to "choose" between running my Datadog agent or having a workable remote development machine. I really hope this one can be sorted out ASAP.

@Steadyon
Copy link

Steadyon commented Jan 31, 2024

I am having the exact same problem, have spent hours trying to diagnose it before finding this stackoverflow post and finally it all made sense. This is breaking all of my VSCode extensions and stopping me pushing any changes to my github repo as it can't find the repo.

It was working yesterday when I implemented datadog, but then when I reconnected today this all happened.

Just incase it helps, the error I get in the dev tools is that it can't find the module 'vscode'. Any short term fixes for this aside from removing the agent? I'm enjoying the logs.

@nhurden
Copy link

nhurden commented Mar 19, 2024

I was able to workaround this by uninstalling just datadog-apm-library-js, leaving the rest of the agent installed (essentially the opposite of https://docs.datadoghq.com/tracing/trace_collection/library_injection_local/?tab=host#install-only-library-injection)

@KTamas
Copy link

KTamas commented Apr 2, 2024

This happened to us as well. Very disappointing.

@alvesdm
Copy link

alvesdm commented Apr 9, 2024

Over the last two weeks I have had two separate Windows machines have their Visual Studio 2022 installations corrupted. Repairing the installation and uninstalling/reinstalling Visual Studio did not resolve the issue. The only thing that got me back into working order was a fresh install of Windows.

Reading through this thread made me realize that on both of these machines the datadog-agent was installed shortly before I started experiencing problems.

This sounded similar enough to the issue creator's problem so I wanted to provide another datapoint.

Same here.

My VS 2022 stopped working after installing DD Agent. The only way back was fresh new win install.
At first I though it was only after installing DD agent. Then after a fresh new win install, I first installled DD agent, then right after, VS 2022... and bang! same happened again.

Def smtg up with DD agent.

@yshapiro-57
Copy link
Contributor

The fix from https://github.com/DataDog/auto_inject/pull/168 has now been released. Anyone still experiencing this issue should be able to fix it by reinstalling the Datadog agent.

@B3nihana
Copy link

B3nihana commented May 2, 2024

@yshapiro-57 Your link doesn't appear to work? Was the fix released in a particular agent version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests