bitbucket server stuck at external database setup w/postgresql

Hi, I've been in the process of setting up jira, confluence, and now Bitbucket on my machine (windows).

I can't get it to proceed past the database setup screen for just bitbucket.  The test database connection works, and it creates a good number of tables in the schema for bitbucket, but then the page just refreshes and returns to the database setup page fresh without any indication of an error.  Checking the logs in both the Bitbucket home and the application data for Bitbucket folders doesn't report any entries or problems from this either.

I'm using postgresql 9.3, I have the latest git for windows 2.x installed (the Bitbucket installer was satisfied about that), I've got a separate role/schema/tablespace/database combination for each product (jira, confluence, and bitbucket) and the other apps are up and running OK.  My git is set to use the 'windows command prompt' option which is supposedly one of the two compatible options.

I followed the steps to create the role and database correctly (e.g. -1 connection limit, encoding UTF8) - at least I believe I have.  Couldn't find any existing articles or google results to help figure out why I seem to be stuck in a loop on this page and would appreciate any ideas or experience dealing with this please?

One thought that just occurred to me, is that my git installation is brand new, no setup or anything beyond running the installer, getting the services running, and then checking the response with a 'git --version' at the command prompt.  Did I miss any requirements here?  I was hoping to not muck about with it too much here and would do necessary administration through the Bitbucket integration instead.

Thanks a lot.

2 answers

1 accepted

0 votes
Accepted answer

Ok, looks like I had a few issues/problems.

  1. Logs weren't flushing immediately when visiting the folders via command prompt, so I only thought they weren't recording anything.  Opening them in explorer windows caused the file sizes to update, and could see a bit more insight.
  2. I tried reinstalling Bitbucket Server at one point and then couldn't proceed past the 'unable to find Git' screen (grrr), turns out via SysInternals/PStools 'process monitor' that if my path entries to Git are wrapped in double-quotes (e.g.: path=...;"j:\program files\git\cmd";...) then the installer cannot find git as it tried appending this path to the temporary folder that the installer was running out of.  Removing the double-quotes let it work OK.
  3. I still couldn't get through the external database setup screen at this point, so went with an internal one - previously this failed for me, but now it worked OK.  So from here I thought I'd try and do a migrate.  Nope, failed again with the same symptoms.
  4. Finally, due to the log file outputs, I seem to have realized that my error was in setting a default schema for my Bitbucket db user/role, and that unlike the other Atlassian server products, it cannot handle this and needs to dump everything into public.  References: and

Following these adjustments I was able to install and get an external db configured just like the other Atlassian products I'm trialling.

The key differences I had to make between this application and the others (where it wasn't necessary) were with respect to leaving the default schema as 'public', avoiding quotes around the git paths, and avoiding spaces in the Bitbucket paths.

Actually fixed those issues a while ago but had to wait 24 hrs before it would let me comment/answer myself ><  #nooblife

Hello Nick, I am having the same exact problem but in MySQL, can you help me.

Forgot to mention that I set my default tablespace and default schema (search path) to my Bitbucket specific entries too, confirmed that they were working by connecting to postgresql as my Bitbucket db user and created a table without specifying schema or tablespace, checked how it appeared in pg_tables, then dropped it again.  I did that to avoid clashes with the other products which are setup in the same way with their respective entries too.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

1,909 views 7 10
Read article

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