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

7.4.2-jdk17 can't be runned #222

Closed
APshenkin opened this issue May 27, 2022 · 22 comments
Closed

7.4.2-jdk17 can't be runned #222

APshenkin opened this issue May 27, 2022 · 22 comments

Comments

@APshenkin
Copy link

APshenkin commented May 27, 2022

New version was published 12 hours ago. Its not working on Ubuntu 20.04 (linux/amd64)

docker run --rm -ti gradle:7.4.2-jdk17 sh
# java -version
[0.004s][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:
# /home/gradle/hs_err_pid6.log
# gradle

ERROR: JAVA_HOME is set to an invalid directory: /opt/java/openjdk

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
@keeganwitt
Copy link
Owner

It looks like Temurin must have pushed a broken image, which triggered a new gradle image to be pushed. Can you try again? It appears to be working for me now.

@zydxt
Copy link

zydxt commented May 30, 2022

I just tried locally and it works well. But same issue on my CI machine. Any further information about this? I guess the image has dependencies on some system level properties/configuration?

@bohenmian
Copy link

bohenmian commented May 30, 2022

I pull a specific Gradle image digest and fix the issue.
For JDK11 gradle:7.4-jdk11@sha256:c81c15b2af05ab6256ad14f65022986d6f406af211db007255268a8c06c8f247, it works well for me.

@keeganwitt
Copy link
Owner

It might be cached on your CI.

@liangde-chen
Copy link

Same issue, for the latest gradle:7.4.2-jdk11. It doesn't work even I pull the latest image with digest: gradle@sha256:1a3024d58e3bf7a5b3187e8e304f20bba45a4214cc361f98d1f7376643deb297

The sha is the latest one: https://hub.docker.com/layers/gradle/library/gradle/7.4.2-jdk11/images/sha256-1a3024d58e3bf7a5b3187e8e304f20bba45a4214cc361f98d1f7376643deb297?context=explore

@malcolm-brooks
Copy link

I am facing the same issue. I have run "docker sysem prune -f --all" to make sure there is no image cached, but the "gradle:jdk8" image still does not work. The only way I can get things working is to use the digest that last worked (on 26/05/2022).

$ docker run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project gradle@sha256:5341d85dc65fd3473faed2cc264c728df5672b69d38de6899d4683c656919f17 gradle build
Unable to find image 'gradle@sha256:5341d85dc65fd3473faed2cc264c728df5672b69d38de6899d4683c656919f17' locally
docker.io/library/gradle@sha256:5341d85dc65fd3473faed2cc264c728df5672b69d38de6899d4683c656919f17: Pulling from library/gradle
d5fd17ec1767: Pull complete
8e94d254f3c4: Pull complete
5bef23661879: Pull complete
0ef342c79cf4: Pull complete
bcdd99bbe80f: Pull complete
aab8a5878f43: Pull complete
0ee463584a1b: Pull complete
Digest: sha256:5341d85dc65fd3473faed2cc264c728df5672b69d38de6899d4683c656919f17
Status: Downloaded newer image for gradle@sha256:5341d85dc65fd3473faed2cc264c728df5672b69d38de6899d4683c656919f17

Welcome to Gradle 7.4.2!

Here are the highlights of this release:
 - Aggregated test and JaCoCo reports
 - Marking additional test source directories as tests in IntelliJ
 - Support for Adoptium JDKs in Java toolchains

For more details see https://docs.gradle.org/7.4.2/release-notes.html

... lines removed ...

BUILD SUCCESSFUL in 29s
9 actionable tasks: 9 executed

@keeganwitt
Copy link
Owner

keeganwitt commented May 30, 2022

My test Gradle project succeeds on all the below images.

REPOSITORY        TAG             IMAGE ID                                                                  CREATED       SIZE
gradle            jdk17           sha256:fb4ec379092cdf12e128af6e1aca257dfd7f6e415bff526d5cf88a0b57f69e9d   3 days ago    748MB
gradle            jdk11           sha256:71e215cc8b38fa249545184caba183fae8fc1f3f7189daab56a19dcf847079db   3 days ago    727MB
gradle            jdk8            sha256:7dd7794171495be672ae97a060eb50080c12d5268173b732f743b71b692d17e7   3 days ago    609MB

You can run this test yourself with below

git clone https://github.com/keeganwitt/docker-gradle.git
cd docker-gradle/test
./run.sh gradle:jdk8 7.4.2 && ./run.sh gradle:jdk11 7.4.2 && ./run.sh gradle:jdk17 7.4.2

If those work for you also, is there a docker run command I can use to reproduce the issue?

@alexthaii
Copy link

I just ran the same image sha256:71e215cc8b38fa249545184caba183fae8fc1f3f7189daab56a19dcf847079db on two different hosts with different results: one failed with the reported issue, and the other succeeded just fine.

It might have to do with what the @APshenkin reported when he ran the java command? Although the host that's reporting my failure has more than enough free mem and disk space.

# java -version
[0.004s][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:
# /home/gradle/hs_err_pid6.log

@keeganwitt
Copy link
Owner

Was the host that it failed on a different architecture?

@alexthaii
Copy link

Was the host that it failed on a different architecture

They're both x86_64.

The success is running on my macOS Monterey whereas the failure is on RHEL 8.2.

@kahootali
Copy link

kahootali commented May 30, 2022

Facing the same issue with gradle:jdk17, I am using Bitbucket pipelines to build my image and it was continuously failing

Step 5/12 : RUN ./gradlew clean build && cp build/libs/-SNAPSHOT.jar app.jar &&jar -xf app.jar
---> Running in 540e172e32a7
[0.004s][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:

I moved to gradle:jdk17-alpine based image and it is working fine

@keeganwitt
Copy link
Owner

I'm working on getting -focal variants added: docker-library/official-images#12543.

I didn't anticipate so much trouble coming from Temurin's Ubuntu upgrade. I apologize for the inconvenience.

@keeganwitt
Copy link
Owner

The Focal images are now available. Let me know if there still issues and I'll reopen this issue.

@james-michael
Copy link

Thank you. I see the new jammy and focal images published yesterday. However, this issue is still not resolved for the reported images. The images (for example gradle:jdk8) was previously overwritten with the jammy image. That should be reverted. Especially this commit (f51f258) should be reverted. Can you please take a look?

@keeganwitt
Copy link
Owner

Going forward, the tags that don't specify an OS (that is don't have -focal or -jammy) will reference the latest LTS Ubuntu in the same way that latest and jdk use the latest LTS JDK. If you want to continue to use Focal, you should switch to a tag that references Focal.

@james-michael
Copy link

Going forward, the tags that don't specify an OS (that is don't have -focal or -jammy) will reference the latest LTS Ubuntu in the same way that latest and jdk use the latest LTS JDK. If you want to continue to use Focal, you should switch to a tag that references Focal.

Got it. Thanks.

@julianschelker
Copy link

I still got the issues with e.g. "gradle:7.4-jdk17"
Is it possible to remove the broken images from dockerhub or update them? Would be good if we can prevent future people of running into this.

@keeganwitt
Copy link
Owner

The images are not broken, they just require a newer version of Docker than you are using.

@julianschelker
Copy link

Ok which version of docker is required?
I currently run "Docker version 19.03.15, build 99e3ed8919"

Also doesn't work with gradle:7.4-jdk17-jammy. I thought you wrote above that these should work.

@keeganwitt
Copy link
Owner

As I understand it, 20.10.16 or newer is required. See this comment.

@julianschelker
Copy link

Can confirm it works again after an update to "Docker version 20.10.17, build 100c701"
Thanks for your help!

@keeganwitt
Copy link
Owner

keeganwitt commented Oct 14, 2022

This issue has come up so frequently (#221, #222, #223, #224, #226, #227, #230, #231), I've created a page explaining: https://github.com/keeganwitt/docker-gradle/wiki/Troubleshooting:-JAVA_HOME-is-set-to-an-invalid-directory. Please let me know how the page can be improved.

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

10 participants