I messed up running environment for jar 0.27.0: no longer runs

Hello, I downloaded the 0.27.0 jar yesterday and tried running it via java -jar metabase.jar. I did so on a Mac Sierra system running Oracle Java 1.7.0_80. I started the jar and then realized I had another web app already running at port 3000. I terminated the other app and returned to the metabase terminal and it was doing nothing. So I ctrl-C’ed out. I eventually I had to force quit the app called “core”. Now every time I try to run the metabase.jar in a new terminal window (even after system restart) it repeatedly reports that JavaAWT Shutdown has an OutOfMemory error. It will loop like this forever. I end up ctrl-C’ing out of the app and have to force quit the core again. I cannot get the jar running at all. Can you tell me what environmental settings I might need to tweak so that the app can startup? Thanks.

Tried “java -Xmx1024m -jar metabase.jar”: no effect on problem.

Tried “java -Xmx4096m -jar metabase.jar”: no effect on problem.

Tried the “java -jar metabase.jar migrate release-lock”: no effect on problem.

I think you’ve run into this issue, which we just hotfixed yesterday in 0.27.1.

Thanks for the tip. I downloaded 0.27.1 and it now behaves differently. It tries to startup but never completes and spins the cpu way up. Trying to attach to localhost:3000 never returns in the browser. I waited a couple minutes. Here are the console contents:

11-30 13:14:30 INFO metabase.core :: Starting Metabase in STANDALONE mode
11-30 13:14:30 INFO metabase.core :: Launching Embedded Jetty Webserver with config:
{:port 3000}
11-30 13:14:30 INFO metabase.core :: Starting Metabase version v0.27.1 (055e448 release-0.27.0) …
11-30 13:14:30 INFO metabase.core :: System timezone is ‘America/Chicago’ …
Exception in thread “main”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “main”
Exception in thread “dirigiste-executor-controller-0”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “dirigiste-executor-controller-0”
Exception in thread “qtp1687833816-23”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “qtp1687833816-23”
2017-11-30 13:17:05.395 java[2591:54901] IMKClient Stall detected, please Report your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block performed very slowly (1.12 secs).
2017-11-30 13:17:21.433 java[2591:54901] IMKClient Stall detected, please Report your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block performed very slowly (1.33 secs).
2017-11-30 13:19:51.400 java[2591:54901] IMKClient Stall detected, please Report your user scenario attaching a spindump (or sysdiagnose) that captures the problem - (imkxpc_presentFunctionRowItemTextInputViewWithEndpoint:reply:) block performed very slowly (1.02 secs).

I had to force quit to get that instance to top. Now when I run java -jar metabase.jar I am back to my original problem:

1-30 14:12:19 INFO metabase.util :: Loading Metabase…
11-30 14:12:22 INFO util.encryption :: DB details encryption is DISABLED for this Metabase instance. :unlock:
See http://www.metabase.com/docs/latest/operations-guide/start.html#encrypting-your-database-connection-details-at-rest for more information.
11-30 14:12:30 INFO metabase.core :: Starting Metabase in STANDALONE mode
11-30 14:12:30 INFO metabase.core :: Launching Embedded Jetty Webserver with config:
{:port 3000}

11-30 14:12:30 INFO metabase.core :: Starting Metabase version v0.27.1 (055e448 release-0.27.0) …
11-30 14:12:30 INFO metabase.core :: System timezone is ‘America/Chicago’ …
Exception in thread “AWT-Shutdown”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “AWT-Shutdown”
Exception in thread “main”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “main”
Exception in thread “AWT-Shutdown”
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread “AWT-Shutdown”
(THIS CONTINUES INDEFINITELY)

One of my more intelligent colleagues says the problem is that the process is running out of memory. How are you launching Metabase? It might be the case that you’re not assigning enough memory to the JVM.

I originally just tried:

java -jar metabase.jar

Then in my second post (above) I detailed how I tried:

“java -Xmx1024m -jar metabase.jar”: no effect on problem.

“java -Xmx4096m -jar metabase.jar”: no effect on problem.

To be safe I just now tried:

java -Xms1024m -Xmx4096m -jar metabase.jar

Still get the infinite looping out of memory error related to java AWT shutdown.

I had a different person log into my machine so they have a clean user profile. Downloaded a fresh metabase.jar into their user profile Downloads folder. From there in a terminal they tried java -jar metabase.jar and they also get the infinite looping out of memory error. It appears there is no cached data causing the problem.

When using Java 7 you’ll need to give it more PermGen memory. Check out the first entry in our troubleshooting guide here: https://metabase.com/docs/latest/troubleshooting-guide/running.html and follow those steps.It should end up looking something like this:

java -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m -jar metabase.jar

Alternatively I’d highly recommend upgrading your JVM. Java 9 is out and with it all the security patches and performance improvements. Note that with Java 9 you’ll need to pass a couple options as well:

java --add-opens=java.base/java.net=ALL-UNNAMED --add-modules=java.xml.bind -jar metabase.jar
2 Likes

Thank you camsaul. The first line you gave works for me.

I’d like to update java but this is a development machine that has some apps that rely on Java 7.

Thanks again.