Bitbucket Server installer 4.10.1 fails with OutOfMemory exception

Hi. I have an issue where the Atlassian installer eats memory until it crashes. "top" shows it spiking at 15GB virtual memory usage just before the crash. The install4j log is empty.
Is there any way of controlling the amount of memory used by the installer?
  • Ubuntu 16.04 x64
  • 4GB RAM
  • 4GB Swap
  • OpenJDK 8

Error

root@bitbucket-01:/$ /tmp/atlassian-bitbucket-4.10.1-x64.bin -q -varfile /tmp/varfile
Starting Installer ...
The target home directory is not empty.
The installation directory has been set to /opt/atlassian/bitbucket/4.10.1.
An error occurred:
java.lang.OutOfMemoryError: unable to create new native thread
Error log: /tmp/install4jError7730425451491793188.log
java.lang.OutOfMemoryError: unable to create new native thread
	 java.lang.Thread.start0(Native Method)
	 java.lang.Thread.start(Thread.java:714)
	 com.atlassian.bitbucket.installer.Tracker.track(Tracker.java:37)
	 com.install4j.script.I4jScript_Internal_59.eval(I4jScript_Internal_59.java:20)
	 com.install4j.script.I4jScript_Internal_59.evaluate(I4jScript_Internal_59.java:24)
	 com.install4j.runtime.installer.helper.Script.evaluate(Script.java:29)
	 com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:181)
	 com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:176)
	 com.install4j.runtime.installer.ContextImpl.runBooleanScript(ContextImpl.java:49)
	 com.install4j.runtime.installer.ContextImpl.runBooleanScript(ContextImpl.java:210)
	 com.install4j.runtime.installer.frontend.headless.UnattendedScreenExecutor.handleScreen(UnattendedScreenExecutor.java:99)
	 com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.execute(AbstractHeadlessScreenExecutor.java:81)
	 com.install4j.runtime.installer.controller.Controller$1.run(Controller.java:133)
	 java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	 java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
	 java.awt.EventQueue.access$500(EventQueue.java:97)
	 java.awt.EventQueue$3.run(EventQueue.java:709)
	 java.awt.EventQueue$3.run(EventQueue.java:703)
	 java.security.AccessController.doPrivileged(Native Method)
	 java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
	 java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
	 java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	 java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	 java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	 java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	 java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	 java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

 

Varfile

app.install.service$Boolean=true
portChoice=custom
httpPort=7990
serverPort=8006
app.bitbucketHome=/bitbucket
app.defaultInstallDir=/opt/atlassian/bitbucket/4.10.1


Log

[INFO] com.install4j.runtime.beans.actions.control.RunScriptAction [ID 81761]: Execute action
       Property rollbackScript: null
       Property rollbackSupported: false
       Property script: com.install4j.script.I4jScript_Internal_61
[ERROR] com.install4j.runtime.beans.actions.control.RunScriptAction [ID 81761]: Execute action not successful after 0 ms
[INFO] com.install4j.runtime.beans.screens.FormScreen [ID 54715]: command: go back 0 screens
       Show screen
       Variable changed: app.install.service=true[class java.lang.Boolean]
       Sending pingback for event installer-install-service
[INFO] com.install4j.runtime.beans.actions.control.RunScriptAction [ID 81761]: Execute action
       Property rollbackScript: null
       Property rollbackSupported: false
       Property script: com.install4j.script.I4jScript_Internal_61
[ERROR] com.install4j.runtime.beans.actions.control.RunScriptAction [ID 81761]: Execute action not successful after 0 ms

... repeat over and over and over again until the log is 8 GB!

 

Install4j is executed with -Dinstall4j.executionMode=gui even though -q is used

$ ps -ef | grep java
root     31985 31912 99 14:32 pts/1    00:00:07 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Dinstall4j.jvmDir=/usr/lib/jvm/java-8-openjdk-amd64/jre -Dexe4j.moduleName=/tmp/atlassian-bitbucket-4.10.1-x64.bin -Dexe4j.totalDataLength=267859283 -Dinstall4j.cwd=/home/root -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-8-openjdk-amd64/jre/jre/lib/ext -Dinstall4j.executionMode=gui -Dsun.java2d.noddraw=true -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4j.vpt=true -classpath i4jruntime.jar:user.jar:user/bitbucket-installer.jar com.install4j.runtime.launcher.UnixLauncher launch 0   com.install4j.runtime.installer.Installer -q -varfile /tmp/varfile

3 answers

1 accepted

1 vote
Jeff Thomas Atlassian Team Oct 25, 2016

Hi Daniel,

Thanks for the work to dig into this one. I can reproduce the same issue with the 4.10 installer and have raised the following bug to track the fix.

https://jira.atlassian.com/browse/BSERV-9267

Please Watch this issue for updates on the progress. I don't have another workaround at the moment other than not using the unattended option, which you've already discovered.

Which version of OpenJDK do you use ?

/:$ java -version
openjdk version "1.8.0_91"
OpenJDK Runtime Environment (build 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.91-b14, mixed mode)
 
/:$ uname -a
Linux bitbucket-01 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

What seems to be the issue is that the varfile is missing some responses, which instead of stopping the installation sends it into an infinite loop.

The installation works with manual responses, but won't work with any of the unattended modes.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

25,466 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you