Issues Building Metabase v0.38.2

I want to build metabase for the fun and experience. I'm not a developer but I enjoy the product and figure this is a way to learn more about it.

I installed the development prerequisites as outline in the Developers Guild.

My attempts at running ./bin/build results in a few errors being thrown during the build process.

Here are details concerning my build environment using a post response from @ flamber

Ubuntu 20.04.2 LTS
On branch master commit c28d43096caa714448675cee45c06cfe4d7984d2
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

Retrieving lein-environ/lein-environ/1.1.0/lein-environ-1.1.0.pom from clojars
Retrieving lein-licenses/lein-licenses/0.2.2/lein-licenses-0.2.2.pom from clojars
Retrieving lein-environ/lein-environ/1.1.0/lein-environ-1.1.0.jar from clojars
Retrieving lein-licenses/lein-licenses/0.2.2/lein-licenses-0.2.2.jar from clojars
Warning: implicit hook found: lein-environ.plugin/hooks
Hooks are deprecated and will be removed in a future version.
Leiningen 2.9.1 on Java 11.0.10 OpenJDK 64-Bit Server VM
v10.19.0
1.22.10

The first of the errors I'm seeing is;

Step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" failed with error "Node#before is deprecated. Use Node#raws.before"

I read in one of the posts that is more a warning and can be skipped... so I did.

Next error I'm seeing after that is

Step "Install metabase-core locally if needed" failed with error "Error encountered performing task 'install' with profile(s): 'base,system,user,provided,dev,install-for-building-drivers,install'\nCompilation failed: Subprocess failed\nError encountered performing task 'install' with profile(s): 'install-for-building-drivers'\nSuppressed exit\nWarning: implicit hook found: lein-environ.plugin/hooks \nHooks are deprecated and will be removed in a future version.\nCompiling 1 source files to /home/abarnes/metabase/target/install-for-building-drivers+install/classes\nwarning: [options] bootstrap class path not set in conjunction with -source 8\n1 warning\nCompiling metabase.api.activity\nCompiling metabase.api.alert\nCompilation failed: Subprocess failed"

When I have tried to "Skip" this as well other errors that have come up the build ends (in error) and no target jar to speak of.

Any assistance is appreciated.
TIA!

1 Like

Hi @abarnes
Skip master right now - try one of the branches like release-x.38.x or a specific tag like v0.38.2

1 Like

Gave the release branch you mentioned a try but hit another error. Relevant snippet below.
Any input you might have is appreciate @flamber.

  $ "./node_modules/.bin/webpack" "--bail"

Step failed:
{:via
[{:type clojure.lang.ExceptionInfo,
:message "",
:data {:exit 137, :out , :err },
:at [metabuild_common.shell$sh invokeStatic "shell.clj" 77]}],
:trace
[[metabuild_common.shell$sh invokeStatic "shell.clj" 77]
[metabuild_common.shell$sh doInvoke "shell.clj" 69]
[clojure.lang.RestFn invoke "RestFn.java" 436]
[build$build_frontend_BANG_$fn__5420$fn__5425 invoke "build.clj" 38]
[metabuild_common.steps$do_step invokeStatic "steps.clj" 85]
[metabuild_common.steps$do_step invoke "steps.clj" 79]
[build$build_frontend_BANG_$fn__5420 invoke "build.clj" 37]
[metabuild_common.steps$do_step invokeStatic "steps.clj" 85]
[metabuild_common.steps$do_step invoke "steps.clj" 79]
[build$build_frontend_BANG_ invokeStatic "build.clj" 21]
[build$build_frontend_BANG_ invoke "build.clj" 16]
[build$fn__5439 invokeStatic "build.clj" 64]
[build$fn__5439 invoke "build.clj" 63]
[build$build_BANG_$fn__5453 invoke "build.clj" 89]
[metabuild_common.steps$do_step invokeStatic "steps.clj" 85]
[metabuild_common.steps$do_step invoke "steps.clj" 79]
[build$build_BANG_ invokeStatic "build.clj" 78]
[build$build_BANG_ invoke "build.clj" 70]
[build$_main$fn__5464 invoke "build.clj" 94]
[metabuild_common.entrypoint$do_exit_when_finished_nonzero_on_exception invokeStatic "entrypoint.clj" 8]
[metabuild_common.entrypoint$do_exit_when_finished_nonzero_on_exception invoke "entrypoint.clj" 6]
[build$_main invokeStatic "build.clj" 93]
[build$_main doInvoke "build.clj" 92]
[clojure.lang.RestFn invoke "RestFn.java" 397]
[clojure.lang.AFn applyToHelper "AFn.java" 152]
[clojure.lang.RestFn applyTo "RestFn.java" 132]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.core$apply invokeStatic "core.clj" 667]
[clojure.main$main_opt invokeStatic "main.clj" 514]
[clojure.main$main_opt invoke "main.clj" 510]
[clojure.main$main invokeStatic "main.clj" 664]
[clojure.main$main doInvoke "main.clj" 616]
[clojure.lang.RestFn applyTo "RestFn.java" 137]
[clojure.lang.Var applyTo "Var.java" 705]
[clojure.main main "main.java" 40]],
:cause "",
:data {:exit 137, :out , :err }}
Step "Run 'webpack' with NODE_ENV=production to assemble and minify frontend assets" failed with error ""

@abarnes I don't know why you are seeing these errors.
Make sure you are using the latest versions (or LTS in some cases).
Post the commands you are using to build.
And post the output of these commands:

# OS and version
 sed -nE 's/^PRETTY_NAME="([^"]+)"$/\1/p' /etc/os-release
# Git branch and commit
 echo `git status | head -1 && git log -1 --format="commit %H"`
# Java version and architecture
 java -version
# Java variable configuration
 echo $JAVA_HOME
# Java path configuration
 echo $PATH | grep --color=never -oe "/usr/lib/jvm/[^:]*"
# Lein version
 lein --version
# NodeJS version
 nodejs --version
# Yarn version
 yarn --version
# Clojure version
 clojure --help | grep Version

bin/build

Ubuntu 20.04.2 LTS
On branch remotes/origin/release-x.38.x commit e8c347b849c0020fdd2267aa74fc66c456a07c5f
openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

Warning: implicit hook found: lein-environ.plugin/hooks
Hooks are deprecated and will be removed in a future version.
Leiningen 2.9.1 on Java 1.8.0_282 OpenJDK 64-Bit Server VM
v10.19.0
1.22.10
Version: 1.10.3.814

@abarnes Try upgrading Node to latest LTS version. Leiningen latest release is 2.9.5, and from Metabase 0.39 it will be possible to skip gettext and use Java 11.

Ubuntu 20.04.2 LTS
On branch remotes/origin/release-x.39.x commit b57b503fd9075aab3a80f550589503f316f24075
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

Leiningen 2.9.5 on Java 11.0.10 OpenJDK 64-Bit Server VM
../checkenv: line 14: nodejs: command not found
1.22.10
Version: 1.10.3.814
abarnes@earth:~/metabase$ node -v
v15.14.0

Still running into the same basic errors. I appreciate your sticking with me @flamber.
I'm using ./bin/build from within the metabase directory. Is there a pre-build step I should be doing or something? I read over Developers Guide and I'm using what I believe to be the appropriate build script.

I am not setting MB_EDITION. The docs say that...
"If you don’t provide a value, the default is oss which will build the Community Edition."

@abarnes I would recommend removing everything and installing everything again. And post every single command you use from installing thru building, and include every single error.

1 Like

EDIT: Success! The build completed and appears to be running well.

I am not completely clear on what my errors were but following the advice of @flamber I started from scratch and installed the latest for all of the necessary software. I hit a memory error with my 1GB droplet. I expanded to a 4GB droplet and the build completed without issue.

In case it is useful for anyone... These are the major steps I took that led to success.

  1. Created a new Digital Ocean droplet - 4 GB Memory / 25 GB Disk / NYC3 - Ubuntu 20.04 (LTS) x64

  2. Upgraded GIT
    A. https://git-scm.com/download/linux

    1. add-apt-repository ppa:git-core/ppa
    2. apt update
    3. apt install git
    4. git --version
    5. git version 2.31.1
  3. Install latest JDK
    A. Downloaded jdk from https://www.oracle.com/java/technologies/javase-jdk11-downloads.html
    B. pscp .\jdk-11.0.10_linux-x64_bin.rpm root@mydroplet:/root
    C. Followed https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-20-04
    D. java 11.0.10 2021-01-19 LTS

  4. Install leiningen
    A. Followed https://purelyfunctional.tv/guide/how-to-install-clojure/#linux
    B. curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein > lein
    C. These steps included the install of Clojure and the CLI tools.

  5. Install node.js
    A. Followed https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04
    B. Also referenced https://github.com/nodesource/distributions/blob/master/README.md

  6. Install yarn
    A. Followed https://linuxize.com/post/how-to-install-yarn-on-ubuntu-20-04/

  7. Cloned https://github.com/metabase/metabase.git

  8. git checkout release-x.39.x

  9. bin/build

1 Like

Hi @abarnes, have you installed Clojure CLI? you can use the Dockerfile in the root of the project and easily do DOCKER_BUILDKIT=1 docker build . --no-cache, it will be easier

1 Like

Thanks for the idea @Luiggi. I managed to get all of my issues resolved and completed the build.
I may look into the docker image next time.