Bitbucket 8.7.1 New Install - Stuck @ "Migrating Home Directory".
Asked by Rob:

I just performed a fresh install of Bitbucket v8.7.1 on a brand new VM in my lab. We have this exact version running in production using Java 8. I'm working on migrating to Java 11. I was so far unsuccessful at converting my Bitbucket lab server (running Java 8) to Java 11, so I figured I'd try a fresh install going straight to Java 11. So far, so good.  

The install went fine, things seemed to line up, I have the JAVA_HOME and JRE_HOME variables set for Java 11, things look good. But when I fire up the app for the INITIAL start (using bin/start-bitbucket.sh from the install directory, just as the doc says) here's what I see...

1) The app starts up.

I run the start script and the app starts. Sometimes it gets to the scren shoen in step 3 below, sometimes it immediately fails. When it gets to the "Migrating home directory" screen, the logs are clean and show no errors. Things just seem to stop there. When it fasils, it throws the errors I have listed below.

2) Logs (launcher.log, atlassian-bitbucket.log) either show nothing at all (as in no errors), or when the app fails they show the below java errors. Messages and audit logs show no system or SElinux hiccups.

3) I can connect to the GUI in my browser, and I see it get to "Migrating home directory."

![bb-start.jpg](/t5/image/serverpage/image-id/256750iBE011291431A6B4B/image-size/large?v=v2&px=999 "bb-start.jpg")

4) That's where things come to a screeching halt.

It's been here for quite some time, and it just doesn't progress. Tried re-starting the app, the server, etc. Nothing.

Note: I am familiar w/ the issue that may occur when using a PG database and the system hung at start forcing you to manually release the lock on the PG database. This is not that. This is my initial start-up of Bitbucket, and while I will be using a PG database, I have not yet even made it to the set-up wizard where I define any of that.

Here's the output from the logs so far for the last boot...

**Start script output ...**

Starting Atlassian Bitbucket as dedicated user stash

Starting the bundled search server  
Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server  
Bundled search server started successfully

Bitbucket is being run with a umask that contains potentially unsafe settings.  
The following issues were found with the mask "u=rwx,g=rwx,o=rx" (0002):  
- Access is allowed to 'others'. It is recommended that 'others' be denied  
all access for security reasons.  
- Write access is allowed to 'group'. It is recommend that 'group' be  
denied write access. Read access to a restricted group is recommended  
to allow access to the logs.  
The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be  
configured in _start-webapp.sh

Starting Bitbucket webapp at <http://localhost:7990>  
The Bitbucket webapp has been started.

If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:  
<https://go.atlassian.com/bbs-troubleshooting-installations>

<br />

# A fatal error has been detected by the Java Runtime Environment:  
#  
# SIGSEGV (0xb) at pc=0x00007f6b1961b884, pid=2025, tid=2065  
#  
# JRE version: OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7) (build 11.0.19+7-LTS)  
# Java VM: OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7-LTS, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)  
# Problematic frame:  
# V \[libjvm.so+0x5b1884\] ciBaseObject::ident()+0x4  
#  
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /opt/atlassian/bitbucket/8.7.1/opensearch/core.2025)  
#  
# An error report file with more information is saved as:  
# logs/hs_err_pid2025.log  
#  
# Compiler replay data is saved as:  
# /opt/atlassian/bitbucket/8.7.1/opensearch/replay_pid2025.log  
#  
# If you would like to submit a bug report, please visit:  
# [https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208\&component=java-11-openjdk](https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=java-11-openjdk)  
#

**atlassian-bitbucket.log ...**

```
2023-05-11 19:21:03,327 INFO [main] c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication v8.7.1 using Java 11.0.19 on saltminion8.local with PID 2043 (/opt/atlassian/bitbucket/8.7.1/app/WEB-INF/classes started by stash in /opt/atlassian/bitbucket/8.7.1)
2023-05-11 19:21:03,330 INFO [main] c.a.b.i.b.BitbucketServerApplication No active profile set, falling back to 1 default profile: "default"
2023-05-11 19:21:04,515 INFO [main] c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 8.7.1 (38a3eec built on Wed Jan 25 05:27:37 UTC 2023)
2023-05-11 19:21:04,515 INFO [main] c.a.b.i.boot.log.BuildInfoLogger JVM: Red Hat, Inc. OpenJDK 64-Bit Server VM 11.0.19+7-LTS
```

**launcher.log ...**

```
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007fad4ce24b77, pid=2043, tid=2044
#
# JRE version: OpenJDK Runtime Environment (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7) (build 11.0.19+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM (Red_Hat-11.0.19.0.7-1.el8_7) (11.0.19+7-LTS, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# J 1751 c1 java.lang.Class.getPackageName()Ljava/lang/String; java.base@11.0.19 (81 bytes) @ 0x00007fad4ce24b77 [0x00007fad4ce24820+0x0000000000000357]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e" (or dumping to /opt/atlassian/bitbucket/8.7.1/core.2043)
#
# An error report file with more information is saved as:
# /opt/atlassian/bitbucket/8.7.1/hs_err_pid2043.log
Compiled method (c1) 6571 1740 3 java.net.URLStreamHandler::toExternalForm (156 bytes)
total in heap [0x00007fad4ce1d290,0x00007fad4ce200d0] = 11840
relocation [0x00007fad4ce1d408,0x00007fad4ce1d730] = 808
main code [0x00007fad4ce1d740,0x00007fad4ce1f5a0] = 7776
stub code [0x00007fad4ce1f5a0,0x00007fad4ce1f750] = 432
oops [0x00007fad4ce1f750,0x00007fad4ce1f758] = 8
metadata [0x00007fad4ce1f758,0x00007fad4ce1f7a8] = 80
scopes data [0x00007fad4ce1f7a8,0x00007fad4ce1fbf8] = 1104
scopes pcs [0x00007fad4ce1fbf8,0x00007fad4ce200a8] = 1200
dependencies [0x00007fad4ce200a8,0x00007fad4ce200b0] = 8
nul chk table [0x00007fad4ce200b0,0x00007fad4ce200d0] = 32
Compiled method (c1) 6572 859 ! 3 jdk.internal.loader.Resource::getBytes (242 bytes)
total in heap [0x00007fad4ccc2710,0x00007fad4ccc4ed8] = 10184
relocation [0x00007fad4ccc2888,0x00007fad4ccc2a50] = 456
main code [0x00007fad4ccc2a60,0x00007fad4ccc4420] = 6592
stub code [0x00007fad4ccc4420,0x00007fad4ccc4520] = 256
metadata [0x00007fad4ccc4520,0x00007fad4ccc4550] = 48
scopes data [0x00007fad4ccc4550,0x00007fad4ccc4928] = 984
scopes pcs [0x00007fad4ccc4928,0x00007fad4ccc4c18] = 752
dependencies [0x00007fad4ccc4c18,0x00007fad4ccc4c20] = 8
handler table [0x00007fad4ccc4c20,0x00007fad4ccc4e78] = 600
nul chk table [0x00007fad4ccc4e78,0x00007fad4ccc4ed8] = 96
Could not load hsdis-amd64.so; library not loadable; PrintAssembly is disabled
#
# If you would like to submit a bug report, please visit:
# https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%208&component=java-11-openjdk
#
```

Any thoughts on what the heck I'm doing wrong?


Answers:
author: Rob
body: **NOTE:** This was supposed to be a comment, NOT an answer. /smh

Just rebooted the server and tried again. Now I'm back to being stuck on the on the "Migrating home directory screen. ZERO errors in the logs.

**atlassian-bitbucket.log...**

```
2023-05-11 19:30:55,923 INFO [main] c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication v8.7.1 using Java 11.0.19 on saltminion8.local with PID 2377 (/opt/atlassian/bitbucket/8.7.1/app/WEB-INF/classes started by stash in /opt/atlassian/bitbucket/8.7.1)
2023-05-11 19:30:55,937 INFO [main] c.a.b.i.b.BitbucketServerApplication No active profile set, falling back to 1 default profile: "default"
2023-05-11 19:30:57,406 INFO [main] c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 8.7.1 (38a3eec built on Wed Jan 25 05:27:37 UTC 2023)
2023-05-11 19:30:57,406 INFO [main] c.a.b.i.boot.log.BuildInfoLogger JVM: Red Hat, Inc. OpenJDK 64-Bit Server VM 11.0.19+7-LTS
2023-05-11 19:31:01,053 INFO [main] c.a.b.i.b.BitbucketServerApplication Started BitbucketServerApplication in 7.508 seconds (JVM running for 8.628)
2023-05-11 19:31:14,515 INFO [spring-startup] c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory /opt/stash

```

**launcher.log...**

(No entries at all)

**Start script output...**  
\[root@saltminion8 8.7.1\]# bin/start-bitbucket.sh  
Starting Atlassian Bitbucket as dedicated user stash  
Starting the bundled search server  
Hint: Run start-bitbucket.sh --no-search to skip starting the bundled search server  
Bundled search server started successfully  
Bitbucket is being run with a umask that contains potentially unsafe settings.  
The following issues were found with the mask "u=rwx,g=rwx,o=rx" (0002):  
- Access is allowed to 'others'. It is recommended that 'others' be denied  
all access for security reasons.  
- Write access is allowed to 'group'. It is recommend that 'group' be  
denied write access. Read access to a restricted group is recommended  
to allow access to the logs.  
The recommended umask for Bitbucket is "u=,g=w,o=rwx" (0027) and can be  
configured in _start-webapp.sh  
Starting Bitbucket webapp at [http://localhost:7990](http://localhost:7990/)  
The Bitbucket webapp has been started.  
If you cannot access Bitbucket within 3 minutes, or encounter other issues, check the troubleshooting guide at:  
<https://go.atlassian.com/bbs-troubleshooting-installations>  
\[root@saltminion8 8.7.1\]#  
\[root@saltminion8 8.7.1\]#  
\[root@saltminion8 8.7.1\]#  
\[root@saltminion8 8.7.1\]#

comments: author: ss
body: [@Rob](/t5/user/viewprofilepage/user-id/3834529)

did you find any solution to this?

I am facing the same issue. all the articles about this problem suggests to run an sql query in the Bitbucket database. But in my case and I guess in yours aswell, the database is not even in the scenario yet. this is just a fresh installation and Bitbucket is failing to start in the very first attempt. Setup wizard has not even reached where database can even be set.

if you managed to solve this issue, may you please share how you did it, please.


Tags: bitbucket-server

java11

server