Bitbucket installer hangs on extracting files during upgrade

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

When upgrading the application via the Bitbucket installer on Linux, the application "hangs" or is "stuck" on extracting files and can take excessive time to complete.

Environment

Applies to Bitbucket Server or Bitbucket Data Center installations in a Linux environment.

Diagnosis

Retrieve the Bitbucket installation log file from the /tmp/ path as long as the installer is still running. If you terminate it, the log file will be deleted. The naming of the file should be similar to *log_Bitbucket_*.log  this file is the installer log file and contains options selected during the upgrade/install and its status.

If you want to view debugged info from the log and output to the console, you can execute the Linux bin with the command: sudo ./atlassian-bitbucket-version.bin -Dinstall4j.debug=true -Dinstall4j.logToStderr=true


Installer output from the command line:

Starting Installer ...

Bitbucket 7.5.0 installation wizard
Would you like to install or upgrade an instance?
Install a new instance [1, Enter], Upgrade an existing instance [2]
2

Upgrade Bitbucket 7.5.0
What type of instance are you looking to upgrade?
Upgrade an existing Server instance [1, Enter], Upgrade an existing Data Center instance [2], Upgrade an existing Smart Mirroring instance [3]
1
Where should Bitbucket be installed?

Select the folder where you would like Bitbucket 7.5.0 to be installed, then
click Next.
[/opt/atlassian/bitbucket/7.5.0]

Default location for Bitbucket home directory

The location for Bitbucket data.
Please provide the location of your existing home directory, where your
repositories, plugins, and other data are stored.

Be sure to STOP your current instance and create a backup before proceeding.
[/var/atlassian/application-data/bitbucket]

Please review your Bitbucket installation settings


Installation Summary
Installation Directory: /opt/atlassian/bitbucket/7.5.0
Home Directory: /var/atlassian/application-data/bitbucket
Upgrade existing service: Yes

Install [i, Enter], Exit [e]


Extracting files ...


Installation of Bitbucket is complete
Would you like to launch Bitbucket?
Yes [y, Enter], No [n]

Within the Bitbucket installer log file you can see the option to select the service is marked as true:

Variable changed: app.install.service=true

You can then view the arguments being passed and the setup_user.sh script being called:

Property arguments: [-a, atlbitbucket, -d, /var/atlassian/application-data/bitbucket, -i, /opt/atlassian/bitbucket/7.5.0]
       Property environmentVariables: {}
       Property executable: bin/setup_user.sh

Two tasks (for permissions) are executed: one for the install directory (ID 76417) and one for the home directory (ID 76416). You can view the info output for the home directories execution to see it is currently executing an action and running bin/chown.sh:

[INFO] com.install4j.runtime.beans.actions.misc.RunExecutableAction [ID 76416]: Execute action
       Property arguments: [logging of arguments is disabled]
       Property environmentVariables: {}
       Property executable: bin/chown.sh
       Property returnCodeVariable: 
       Property rollbackArguments: null
       Property rollbackExecutable: null
       Property rollbackWorkingDirectory: null
       Property stderrFile: null
       Property stderrRedirectionMode: No redirection
       Property stderrVariableName: 
       Property stdinFile: null
       Property stdinRedirectionMode: No redirection
       Property stdinString: 
       Property stdoutFile: null
       Property stdoutRedirectionMode: No redirection
       Property stdoutVariableName: 
       Property timeout: 0
       Property workingDirectory: .
       Property failOnStderrFileError: false
       Property failOnStdinFileError: false
       Property failOnStdoutFileError: false
       Property includeParentEnvironmentVariables: true
       Property keepConsoleWindow: false
       Property logArguments: false
       Property rollbackSupported: false
       Property showWindowsConsole: false
       Property useRollbackExecutable: false
       Property wait: true
       Property waitForStreams: true
       used working dir: /atlassian/bitbucket/server/atlassian-bitbucket-7.17.1/.


Cause

When installing or upgrading Bitbucket, there are many steps that are performed in regards to the file system such as extracting files and correcting permissions.

The "issue" at hand is triggered when installing the service.

If the default service name atlbitbucket is installed and found, there should be no ownership changes to the home directory. If the service is NOT installed, or cannot be found (ex: you manually installed a service called bitbucket therefore not matching to the default atlbitbucket), then the permissions and ownership script is executed.

This means that if no service is found, but you are selecting to install the service during the upgrade, user creation and permission changes will be triggered.

Solution

There is no workaround. The script will always execute when selecting to install the service. 

Even if you create the default user before opting to install the service, it will only affect the change ownership action, but the chmod action will continue.

(info) See the following ticket for details:

DescriptionWhy the home directory permissions change
ProductBitbucket Server, Bitbucket Data Center
Last modified on Sep 24, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.