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

"gradlew buildBwcVersion" fails with misleading error if JAVA11_HOME is not set #37586

Closed
hmcc opened this issue Jan 17, 2019 · 3 comments · Fixed by #37599
Closed

"gradlew buildBwcVersion" fails with misleading error if JAVA11_HOME is not set #37586

hmcc opened this issue Jan 17, 2019 · 3 comments · Fixed by #37599
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team

Comments

@hmcc
Copy link
Contributor

hmcc commented Jan 17, 2019

Elasticsearch version (bin/elasticsearch --version): build issue, seen with master branch

Plugins installed: []

JVM version (java -version):

openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-2ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.1+13-Ubuntu-2ubuntu1, mixed mode, sharing)

OS version (uname -a if on a Unix-like system):

Linux <name> 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

When I run buildBwcVersion, it fails with ERROR: JAVA_HOME is set to an invalid directory: null, but JAVA_HOME is set. It's actually JAVA11_HOME that's missing.

Steps to reproduce:

  1. Confirm that JAVA_HOME is set, but JAVA11_HOME is not (env | grep JAVA)
  2. Check out the latest source and confirm that Java 11 is set in java-versions.properties (grep 11 .ci/java-versions.properties)
  3. Run ./gradlew buildBwcVersion. The build should fail with ERROR: JAVA_HOME is set to an invalid directory: null.

Provide logs (if relevant):

> Task :distribution:bwc:bugfix:buildBwcVersion FAILED

 [6.5.5] ERROR: JAVA_HOME is set to an invalid directory: null
 [6.5.5] 
 [6.5.5] Please set the JAVA_HOME variable in your environment to match the
 [6.5.5] location of your Java installation.
 [6.5.5] 

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':distribution:bwc:bugfix:buildBwcVersion'.
> Process 'command '/home/heather/code/git/elasticsearch/distribution/bwc/bugfix/build/bwc/checkout-6.5/gradlew'' finished with non-zero exit value 1
@hmcc hmcc changed the title gradlew buildBwcVersion fails with misleading error if JAVA11_HOME is not set "gradlew buildBwcVersion" fails with misleading error if JAVA11_HOME is not set Jan 17, 2019
@Tim-Brooks Tim-Brooks added the :Delivery/Build Build or test infrastructure label Jan 18, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

rjernst added a commit to rjernst/elasticsearch that referenced this issue Jan 18, 2019
Currently bwc builds require different java home environment variables
depending on the version of elasticsearch being built. The java home
version checks are run at the end of gradle configuration, when the task
graph is ready. However, we do not know which versions are needed for
bwc builds until execution time, when we have finished checking out the
version of elasticsearch to be built. This commit accounts for late java
home checks, checking immediately instead of delaying the check.

closes elastic#37586
@rjernst
Copy link
Member

rjernst commented Jan 18, 2019

Thanks for the bug report! I've opened a fix in #37599

@hmcc
Copy link
Contributor Author

hmcc commented Jan 18, 2019

Closed #37588 in favour of #37599.

There's still a docs PR, #37589, if JAVA11_HOME should be added to the list of required environment variables.

rjernst added a commit that referenced this issue Jan 21, 2019
Currently bwc builds require different java home environment variables
depending on the version of elasticsearch being built. The java home
version checks are run at the end of gradle configuration, when the task
graph is ready. However, we do not know which versions are needed for
bwc builds until execution time, when we have finished checking out the
version of elasticsearch to be built. This commit accounts for late java
home checks, checking immediately instead of delaying the check.

closes #37586
rjernst added a commit that referenced this issue Jan 21, 2019
Currently bwc builds require different java home environment variables
depending on the version of elasticsearch being built. The java home
version checks are run at the end of gradle configuration, when the task
graph is ready. However, we do not know which versions are needed for
bwc builds until execution time, when we have finished checking out the
version of elasticsearch to be built. This commit accounts for late java
home checks, checking immediately instead of delaying the check.

closes #37586
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants