Hi there, I'm facing the following error after run...
# troubleshoot
s
Hi there, I'm facing the following error after run
./gradlew build
Copy code
FAILURE: Build failed with an exception.

* Where:
Build file '/Users/gamboad/Sites/datahub/metadata-service/restli-servlet-impl/build.gradle' line: 80

* What went wrong:
A problem occurred evaluating project ':metadata-service:restli-servlet-impl'.
> Could not resolve all dependencies for configuration ':metadata-service:restli-servlet-impl:dataModel'.
   > Failed to calculate the value of task ':metadata-models:compileJava' property 'javaCompiler'.
      > Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read '<https://api.adoptopenjdk.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk>' as it does not exist.

* 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.

* Get more help at <https://help.gradle.org>

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.9.2/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD FAILED in 1m 58s
My java version is 11
Copy code
$ java --version


openjdk 11.0.18 2023-01-17
OpenJDK Runtime Environment Homebrew (build 11.0.18+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.18+0, mixed mode)
The issue seems the be related with the gradle version, which version should I use?
g
Hi @strong-easter-55319 Please refer section https://datahubproject.io/docs/developers
s
I followed the steps described in that section.
g
Gradle 6.9.2 ------------------------------------------------------------ Build time: 2021-12-21 201838 UTC Revision: 5d94aa68c0fdbe443838bb977080e3b9f273e889 Kotlin: 1.4.20 Groovy: 2.5.12 Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020 JVM: 11.0.17 (Ubuntu 11.0.17+8-post-Ubuntu-1ubuntu222.04) OS: Linux 5.15.0-58-generic amd64
s
I had Gradle 7, so I've downgraded it to 6.9.3 but I'm still facing the same error
Copy code
> Configure project :metadata-service:factories
fullVersion=da85e73
cliMajorVersion=da85e73
version=da85e73

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/gamboad/Sites/datahub/metadata-service/restli-servlet-impl/build.gradle' line: 80

* What went wrong:
A problem occurred evaluating project ':metadata-service:restli-servlet-impl'.
> Could not resolve all dependencies for configuration ':metadata-service:restli-servlet-impl:dataModel'.
   > Failed to calculate the value of task ':metadata-models:compileJava' property 'javaCompiler'.
      > Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read '<https://api.adoptopenjdk.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk>' as it does not exist.

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

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating project ':metadata-service:restli-servlet-impl'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.lambda$apply$0(DefaultScriptPluginFactory.java:133)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:136)
        at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:65)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
        at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
the process is interrupted in the step
:metadata-jobs:mce-consumer-job
g
Looks like mac specific issue
Could you please launch a Ubuntu VM and try it out
s
Sure, do you have any resource which I can follow?
g
google would help
b
You will need to have a jdk8 that is compatible with apple m1, one example is the
zulu
variant, gradle is not able to fetch one that is compatible automatically, however it can use one if it is already installed.
s
Thanks @brainy-tent-14503, however I am confused, the documentation says that JDK11 is required
I installed jdk11 version from zulu , same error
b
jdk8 and jdk11 are required for a full build because of the spark dependencies which require jdk8 still. The jdk11 components will use the jdk8 artifacts for certain modules. runtime only jdk11 is required
w
Recently moved to a laptop with M1 and although I installed the zulu one, still facing same issue
Copy code
➜  datahub git:(master) java -version
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment Zulu11.62+17-CA (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM Zulu11.62+17-CA (build 11.0.18+10-LTS, mixed mode)
➜  datahub git:(master) 
➜  datahub git:(master) ./gradlew build -x test -x yarnTest
To honour the JVM settings for this build a single-use Daemon process will be forked. See <https://docs.gradle.org/6.9.2/userguide/gradle_daemon.html#sec:disabling_the_daemon>.
Daemon will be stopped at the end of the build 
Configuration on demand is an incubating feature.

> Configure project :datahub-frontend
fullVersion=v0.9.6-45-g54c5017
cliMajorVersion=0.9.6
...
Build file '/Users/sergio.gomez.villamor/github/sgv/datahub/metadata-service/restli-servlet-impl/build.gradle' line: 80

* What went wrong:
A problem occurred evaluating project ':metadata-service:restli-servlet-impl'.
> Could not resolve all dependencies for configuration ':metadata-service:restli-servlet-impl:dataModel'.
   > Failed to calculate the value of task ':metadata-models:compileJava' property 'javaCompiler'.
      > Unable to download toolchain matching these requirements: {languageVersion=8, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read '<https://api.adoptopenjdk.net/v3/binary/latest/8/ga/mac/aarch64/jdk/hotspot/normal/adoptopenjdk>' as it does not exist.

* 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.

* Get more help at <https://help.gradle.org>

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See <https://docs.gradle.org/6.9.2/userguide/command_line_interface.html#sec:command_line_warnings>

BUILD FAILED in 12s
b
For building DataHub, you must have a jdk8 for arm as well as jdk11. It is not apparent from your logs whether you have installed the zulu release for jdk8.
Copy code
$ /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/javac -version
javac 1.8.0_345
$ /Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents/Home/bin/javac -version
javac 11.0.16.1
Those are the locations on my system, yours might vary. Do you have a jdk8 available but it is not being detected?
w
No jdk8. I didn't understood that both were required, my fault. Just installed zulu-1.8 and fixed my issues!
Copy code
➜  datahub git:(master) jenv versions
  system
  openjdk64-11.0.18
  zulu64-1.8.0.362
* zulu64-11.0.18 (set by /Users/sergio.gomez.villamor/github/sgv/datahub/.java-version)
➜  datahub git:(master)
Thanks!
t
I installed amazon-corretto-8 and amazon-corretto-11, but could not fix my issue, is there any config should be updated? or only zulu is suitable?
b
Any jdk8 should work as long as gradle can find it. Zulu was chosen simply because they were one of the first m1 mac compatible. If you are on an m1 mac then you may want to make sure you installed the corretto for the right platform architecture, these are listed here and here. If on m1, it should be the macosx-aarch64 build.