Hello! I recently made <a post in the UI channel> ...
# troubleshoot
b
Hello! I recently made a post in the UI channel about updating themes for datahub running in Kubernetes. Apparently, making these changes for Kubernetes deployments requires rebuilding the datahub-frontend container. This is what I originally suspected and have already made some efforts to rebuild the image, but have run into some trouble with gradle. I'm running the following command to build the
datahub-frontend
image:
Copy code
DOCKER_BUILDKIT=1 docker build -t "$IMAGE_TAG" -f ./docker/datahub-frontend/Dockerfile
However, doing so eventually gives me the following error:
Copy code
* What went wrong:
Execution failed for task ':li-utils:generateDataTemplate'.
> Process 'command '/usr/lib/jvm/java-1.8-openjdk/bin/java'' finished with non-zero exit value 1
As well as this further down in the stack trace:
Copy code
> Task :datahub-frontend:compilePlayBinaryPlayRoutes
I haven't been able to diagnose this issue, at first glace it seems like java issue, perhaps something with the version. But I am confused as to why an error would occur in the first place as we have not made an substantive changes to the code from the source repo and the image should be built in a blank container. Now I originally dealt with a series of errors about gradle being unable to download plugins and dependencies, so I had to make a few changes to allow these to be pulled in our network environment. I will list those below: • Updated the
distributionUrl
in
gradle-wrapper.properties
to point to our Nexus repo • Added a
pluginManagement.repositories.maven
object with our nexus url and credentials to
settings.gradle
• Added a new repository object for our nexus repo to
repositories.gradle
and commented out all other repos (as they would be blocked when accessed directly and are configured to be proxied by our nexus repo) • Added a few lines to the datahub-frontend
Dockerfile
to accept nexus credentials as ARGs, set them as ENV variables, and used them to set
-Dgradle.wrapperUser
&
-Dgradle.wrapperPassword
in the
GRADLE_OPTS
ENV and set new command line arguments
-PsonatypeNexusUsername
&
-PsonatypeNexusPassword
to the
./gradlew :datahub-frontend:dist
command. Has anyone encountered a build issue like this before or is able to assist in the trouble shooting? I appreciate it and have a great week!
i
Hello Ryan, To compile the frontend, please try:
Copy code
./gradlew :datahub-frontend:build -x yarnTest -x yarnLint
I’m curious about one thing though, why did you have to change gradle configurations? Is the machine where you are building the frontend component not able to connect to public jar repositories?
b
Hi Pedro, thanks for the response. So the gradle build command is currently being run from within the Dockerfile like so:
Copy code
./gradlew :datahub-frontend:dist --stacktrace -PsonatypeNexusUsername=${NEXUS_USER_TOKEN} -PsonatypeNexusPassword=${NEXUS_AUTH_TOKEN} -PenableEmber=${ENABLE_EMBER} -PuseSystemNode=${USE_SYSTEM_NODE} -x test -x yarnTest -x yarnLint
So it already has the
-x yarnTest
and
-x yarnLint
arguments given. However, I have noticed that the docker file uses
:datahub-frontend:dist
instead of
:datahub-frontend:build
. I am not sure of the significance of this. I am actually trying to build this image inside a separate docker container that is created as part of a pipeline. But yes, our network configuration does not allow us to directly connect to public jar repositories. Instead we have a Sonatype Nexus repository configured to proxy to those repositories, so we just connect to that when we need to pull from them. If it would be useful to run just the gradle build command, I can work on setting up my local machine to be able to do so (currently it is not). However, it seems to me that running the command as provided within the Dockerfile would be better as it should prevent environment conflicts and is the way in which I actually intend to do the build.
g
@bland-balloon-48379 could you share more of the stacktrace? do you get anything else in the error aside from
Copy code
> Process 'command '/usr/lib/jvm/java-1.8-openjdk/bin/java'' finished with non-zero exit value 1
Did the java process print any errors out higher up in the log?
b
@green-football-43791 yeah here are the logs for the gradle job up until that error:
Copy code
#13 4.808 Welcome to Gradle 6.9.2!
#13 4.808 
#13 4.808 Here are the highlights of this release:
#13 4.808  - This is a small backport release.
#13 4.808  - Java 16 can be used to compile when used with Java toolchains
#13 4.808  - Dynamic versions can be used within plugin declarations
#13 4.808  - Native support for Apple Silicon processors
#13 4.808 
#13 4.808 For more details see <https://docs.gradle.org/6.9.2/release-notes.html>
#13 4.808 
#13 7.989 Configuration on demand is an incubating feature.
#13 33.59 
#13 33.59 > Configure project :metadata-integration:java:datahub-client
#13 33.59 In else section
#13 36.19 
#13 36.19 > Configure project :metadata-integration:java:spark-lineage
#13 36.19 In else section
#13 40.79 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
#13 40.79 SLF4J: Defaulting to no-operation (NOP) logger implementation
#13 40.79 SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.
#13 41.39 
#13 41.39 > Task :datahub-web-react:nodeSetup SKIPPED
#13 41.39 > Task :li-utils:generateAvroSchema SKIPPED
#13 43.29 
#13 43.29 > Task :li-utils:generateDataTemplate FAILED
#13 43.29 There are 31 data schema input files. Using input root folder: /datahub-src/li-utils/src/main/pegasus
#13 43.29 Error: A JNI error has occurred, please check your installation and try again
#13 43.29 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
#13 43.29 	at java.lang.Class.getDeclaredMethods0(Native Method)
#13 43.29 	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
#13 43.29 	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
#13 43.29 	at java.lang.Class.getMethod0(Class.java:3018)
#13 43.29 	at java.lang.Class.getMethod(Class.java:1784)
#13 43.29 	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
#13 43.29 	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
#13 43.29 Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
#13 43.29 	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
#13 43.29 	at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
#13 43.29 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
#13 43.29 	at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
#13 43.29 	... 7 more
#13 43.39 
#13 43.39 > Task :datahub-web-react:yarnSetup
#13 43.39 
#13 43.39 added 1 package, and audited 2 packages in 1s
#13 43.39 
#13 43.39 found 0 vulnerabilities
#13 44.89 
#13 44.89 > Task :datahub-graphql-core:graphqlCodegen
#13 44.89 Generated 426 definition classes in folder /datahub-src/datahub-graphql-core/src/mainGeneratedGraphQL/java
#13 44.89 Finished processing 7 schema(s) in 2553 ms
#13 46.39 
#13 46.39 FAILURE: Build failed with an exception.
#13 46.39 
#13 46.39 * What went wrong:
#13 46.39 Execution failed for task ':li-utils:generateDataTemplate'.
#13 46.39 > Process 'command '/usr/lib/jvm/java-1.8-openjdk/bin/java'' finished with non-zero exit value 1
I can include more of the lower stack trace if needed but it is quite a lot.
Looking at that I can see the
:li-utils:generateDataTemplate
task failed of course, but also noticed that the failure is said to be caused by a failure to find
org.apache.commons.cli.ParseException
. Is this something that needs to be pulled? Perhaps a hidden network error if so
g
Seems like it, given the URLClassLoader error
i wonder if your docker container doesn’t have the ability to access the internet?
b
It's able to pull the gradle distribution and plugins, so it's able to access the internet fine. However it's pretty locked down, so the issue would be that perhaps the necessary proxy isn't set up. I'll reach out to our network team to check on this. Thanks for the help getting pointed in a direction.
This is also assuming the issue is caused by trying to pull a remote package. Open to other ideas around if it's failing to load a local class.