microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

JVM TI agent load failed - #301

Open fredcsfaria opened 2 years ago

fredcsfaria commented 2 years ago

Hello,

I am using VS Code remote extension    and  have  configured  the setting:
          "useKubernetesServiceEnvironmentVariables": true

  However for some Java services  in cluster,  that have in their containers  defined the environment var  "JAVA_TOOL_OPTIONS" with debug options set   I am getting  an error running the debug in local VS COde  development environment:   

            " Picked up JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n,quiet=y
            ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
            Error occurred during initialization of VM
           agent library failed to init: jdwp "       

The duplicated   jdwp option  comes from (1) pod container environment variable and  (2) launch configuration.

Would it be possible disable the "jdwp option" in "bridge to kubernetes" launch configuration ? Or should be necessary unset the debug option on Shell variable on containers ? Any hint ?

Thanks