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

liberica-openjdk-alpine-musl images pick up JDK_JAVA_OPTIONS twice, fail to start #73

Open
stokpop opened this issue Mar 4, 2022 · 1 comment

Comments

@stokpop
Copy link

stokpop commented Mar 4, 2022

Switching to liberica alpine linux-musl our docker image failed to start.

We see JDK_JAVA_OPTIONS processed twice, and it fails for options that can only be parsed once like the agentlib below.

Example:

> docker run --rm -e "JDK_JAVA_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" bellsoft/liberica-openjdk-alpine-musl:11 java -
version
NOTE: Picked up JDK_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
NOTE: Picked up JDK_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
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

Same for liberica-openjdk-alpine-musl:17.

Note: JAVA_TOOL_OPTIONS is parsed only once, but we prefer the other one because the JAVA_TOOL_OPTIONS is also used for tools like jps.

> docker run --rm -e "JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" bellsoft/liberica-openjdk-alpine-musl:17 java -version
Picked up JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005
Listening for transport dt_socket at address: 5005
openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment (build 17.0.2+9-LTS)
OpenJDK 64-Bit Server VM (build 17.0.2+9-LTS, mixed mode)

Note: using non-musl alpine seems to work fine.

Maybe related? adoptium/adoptium-support#303

@stokpop stokpop changed the title liberica-openjdk-alpine images pick up JDK_JAVA_OPTIONS twice, fail to start liberica-openjdk-alpine-musl images pick up JDK_JAVA_OPTIONS twice, fail to start Mar 12, 2022
@ChristianCiach
Copy link

Same issue here. As a workaround, depending on context, you can use JAVA_TOOL_OPTIONS until this is fixed.

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

2 participants