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

Print a good error message when GRADLE_USER_HOME is not writable #8913

Open
msrd0 opened this issue Apr 1, 2019 · 5 comments
Open

Print a good error message when GRADLE_USER_HOME is not writable #8913

msrd0 opened this issue Apr 1, 2019 · 5 comments
Labels
a:feature A new functionality in:invoking-gradle Running Executing

Comments

@msrd0
Copy link

msrd0 commented Apr 1, 2019

Today I encountered the same error as #1493 inside the gradle:alpine (Gradle 5.3.1) docker container using GitLab CI.

The error message I got was:

FAILURE: Build failed with an exception.

* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

None of the above mentioned flags did output any more information about the issue.

Expected behaviour

I would have expected gradle to give me an error that states something like "Unable to write into GRADLE_USER_HOME (maybe add/replace with real path). Make sure gradle has correct permissions"

Actual behaviour

I received a completely irrelevant error message that does not reveal any information on how to resolve it.

Reproduce

https://gitlab.com/msrd0/gradle-test/-/jobs/188394374

@lacasseio
Copy link
Contributor

Thanks for raising this issue. If you have some spare time, we would be happy to accept a PR for showing a better error message. The change would need to make sure it doesn't cause any performance regression.

@lacasseio lacasseio added a:feature A new functionality from:contributor labels Jun 16, 2019
@msrd0
Copy link
Author

msrd0 commented Jun 16, 2019

I'd be happy to help, but since I don't know much about how gradle works internally you'd need to give me some hints on how to fix this.

@lacasseio
Copy link
Contributor

There is a good chance this is where you would need to fix it: https://github.com/gradle/gradle/blob/master/subprojects/native/src/main/java/org/gradle/internal/nativeintegration/services/NativeServices.java#L100. You can confirm this by printing the stacktrace of the same scenario.

It's important to add an integration test to exercise this scenario. You can add the test in this file: https://github.com/gradle/gradle/blob/master/subprojects/core/src/integTest/groovy/org/gradle/NativeServicesIntegrationTest.groovy

@stale
Copy link

stale bot commented Oct 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution.

@stale stale bot added the stale label Oct 6, 2020
@msrd0
Copy link
Author

msrd0 commented Oct 7, 2020

I believe this issue is still valid, still confuses users that encounter it for the first time, and should therefore not be closed.

The official gradle docker image no longer uses a non-root user so I updated the reproducing example: https://gitlab.com/msrd0/gradle-test/-/jobs/777912920#L72 (Tested against gradle 6.5.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:invoking-gradle Running Executing
Projects
None yet
Development

No branches or pull requests

4 participants