5

I have a Springboot application, packaged in a docker image with jib version 3.2.0.

And when i tried to start on my linux server, i have an error immediatly.

[0.012s][warning][os,thread] Failed to start thread - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# An error report file with more information is saved as:
# //hs_err_pid1.log

I don't know how to see /hs_err_pid1.log because the server crash immediatly and i can't enter with an exec.

After some test i've find that the container work in privileged mode. But i want to avoid that solution for security reason.

I've try to free some ram (4g) but the container still crash.

I've run my container with docker run and docker-compose and i have the same result

I also try to run it on a different server (with similar capacity) and the image works fine.

For information i was on docker version 20.10.4 The image packaged by jib use jdk17 temurin 17.0.3+7

3
  • 1
    You can start the container with overridden entrypoint/command in interactive mode (docker run --entrypoint sh -it $IMAGE), using shell instead of your java process, and then start java manually. Should the JVM crash, the container would stay alive and you will be able to inspect the crash log. Commented Jun 9, 2022 at 6:58
  • Thanks for your response, i 've tryed that. And in result even a java -version failed with the same error
    – Ruokki
    Commented Jun 9, 2022 at 8:41
  • I've try the same thing with classic java image openjdk17 and java -version work. So i don't think i'm lacking ram
    – Ruokki
    Commented Jun 9, 2022 at 8:47

1 Answer 1

10

The problem come from openjdk-temurin.

According to this github issue this is corrected by using docker 20.10.5.

I've tried to upgrade my docker version and I doesn't have the issue anymore

4
  • 1
    I'm with docker 20.10.8 and having the problem... Commented Oct 13, 2022 at 13:58
  • 1
    Same here, problem persists with 20.10.8, but fixed in 20.10.21
    – rti
    Commented Nov 23, 2022 at 11:44
  • also fixed in docker version 20.10.18
    – Amirio
    Commented Feb 14, 2023 at 12:00
  • It might happen that the update does not fix the issue. I have find that when the system has libseccomp2 >= "2.5.1-1ubuntu1~16.04.1" the problem persists, even after docker has been updated. The error comes from the clone3 instruction being prohibited in the default security profile. To fix the issue, you need to create a seccomp.json file including this operation as permitted. Copy a seccomp.json and include this operation as SCMP_ACT_ALLOW. With this, run your container with --security-opt seccomp=seccomp.json or your dockerd service with --seccomp-profile ###/seccomp.json.
    – PauAL
    Commented Sep 4 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.