Developer Q&A Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OneAgent auto-injection was disabled on this host during installation.

FullastackMon
Newcomer_

We are facing an issue with Dynatrace OneAgent auto-injection and Java deep monitoring on a Windows server.

Environment:

  • OS: Windows

  • Application: Dynatrace easyTravel

  • Technology: Java

  • OneAgent is installed and running successfully.

  • Infrastructure and process-level monitoring are visible in Dynatrace.

  • However, Java deep monitoring is not working as expected.

We tried enabling auto-injection using the following command:

"C:\Program Files\dynatrace\oneagent\agent\tools\oneagentctl.exe" --set-auto-injection-enabled=true --restart-service

The command returns the following output:

Stopping OneAgent service
Cannot enable auto-injection as it was disabled during installation, please contact support
Starting OneAgent service

However, when we check the current auto-injection status using:

"C:\Program Files\dynatrace\oneagent\agent\tools\oneagentctl.exe" --get-auto-injection-enabled

the result is:

true

This is confusing because the configuration reports that auto-injection is enabled, but attempting to enable it says that auto-injection was disabled during installation.

We have also restarted the OneAgent service and the easyTravel/Java processes, but Java deep monitoring is still not working.

The Java process is running from the following path:

C:\Program Files\dynaTrace\easyTravel (x64)\jre\bin\java.exe

Example command line:

"C:\Program Files\dynaTrace\easyTravel (x64)\jre\bin\java.exe"
-jar "C:\Program Files\dynaTrace\easyTravel (x64)\com.dynatrace.easytravel.launcher.jar"

We would like to understand:

  1. Why does --get-auto-injection-enabled return true while --set-auto-injection-enabled=true reports that auto-injection was disabled during installation?

  2. Does true only represent the current configuration, while the OneAgent installation itself still prevents code-module injection?

  3. Is there any way to verify whether oneagentjava.dll is actually injected/loaded into the Java process?

  4. Can this condition be corrected without reinstalling OneAgent?

  5. If reinstalling OneAgent is required, which installer parameter or installation option should we verify to ensure auto-injection is enabled?

  6. Are there any additional logs or diagnostic files we should check to identify why Java deep monitoring is not being activated?

Any guidance on how to troubleshoot this auto-injection status mismatch and restore Java deep monitoring would be appreciated.

Note: We are using Dynatrace free trail account.

1 REPLY 1

sujit_k_singh
Leader

Hi @FullastackMon 

Why --get-auto-injection-enabled returns true while the set command says "disabled during installation"
These are two separate, independent settings:

  •  Installation-level auto-injection is a kernel-driver-level capability baked in at install time. It controls whether the oneagentmon kernel driver (which enables automatic DLL injection into processes) was registered. This cannot be changed post-installation.
  • --get/set-auto-injection-enabled is a runtime configuration flag that sits on top of the installation-level capability. It can be toggled freely, but it has no effect if the underlying installation-level capability was disabled.

So true from --get-auto-injection-enabled only means the runtime config wants injection enabled it does not confirm that the kernel driver is actually capable of injecting. The warning message "Cannot enable auto-injection as it was disabled during installation" is the definitive signal that the kernel driver was not installed.

How to verify whether oneagentjava.dll is actually loaded

Use either of these methods:

Process Explorer (Use Sysinternals process monitor tool (ofcourse its free):

Open Process Explorer as Administrator ->Find your java.exe process -> Press Ctrl+D to open the DLL view -> Search for oneagentjava.dll — if it's absent, injection is not working

Check the oneagentmon driver:
Open Device Manager -> View -> Show hidden devices -> Non-Plug and Play Drivers -> Look for Dynatrace OneAgent Monitor (oneagentmon)
If it's missing or in an error state, the injection mechanism was not installed

Check OneAgent logs: %PROGRAMDATA%\dynatrace\oneagent\log\

Look for entries referencing injection, java, or code module errors here will confirm the root cause.

Can this be fixed without reinstalling? - No

When reinstalling, ensure you do not pass --set-auto-injection-enabled=false. The default is enabled, so simply omitting that flag is sufficient.

Additional diagnostics to collect before reinstalling
Generate a support archive for a full picture. This ZIP will contain injection logs, configuration snapshots, and driver status useful if you want to confirm the root cause before proceeding.

Thanks,

Sujit

Dynatrace Professional Certified

Featured Posts