Continuous Integration drama

When I read that Bitbucket Server is going to be discontinued in the future, I could have done two things. I could have waited as I could still use Bitbucket Server for quite a long time or I could go out and search for a new solution. I did the latter. Well, at least the searching part. I am still trying to find the best solution.

I am still trying to work with Bitbucket Cloud, but I am running into some issues:

  1. I am still not very pleased with having to put the credentials for my Nexus server into someone’s web application.
  2. Pipelines in Bitbucket Cloud aren’t very fast.
  3. Creating a Docker image with the spring-boot-maven-plugin fails at this time and it seems this problem isn’t going to be fixed any time soon.

I’d better have a look at gitlab and see what it can do for me, but there’s a good chance I’ll stick with Bitbucket Cloud and my own Jenkins server. More on that later.

And then my Bitbucket server died

One day I moved all my LXC containers to one host. This was done to use one of my NUCs as a Roon ROCK server. Moving the containers was easy with LXC. Just take a snapshot of the container and copy it to another server. Start it there and well, that was that.

In the back of my head a voice was telling me that all my LXC containers have boot.autostart set to true. The voice was telling also telling me this might become an issue. What if the Bitbucket server starts before the PostgreSQL server running on the same host?

Anyway, quite soon, after a few reboots, I got into trouble. Bitbucket was stuck at “Migrating home directory”.

I’m not saying booting all containers at the same time is the problem. It might be. It might also be that I shutdown down the SQL server before Bitbucket.

Looking for a solution wasn’t easy as I couldn’t find anything in the Bitbucket logs:

******@bitbucket ERROR: function aurora_version() does not exist at character 8

Apparently there is some sort of PostgreSQL implementation you can run on the Amazon cloud that is called Aurora. You learn something new every day…

I thought I had found the root cause, but also realised that all the people mentioning these log messages weren’t saying their server didn’t boot.

Then I started googling the message “Migrating home directory” and quickly had a solution. It seems my database was locked. This statement allowed my server to boot Bitbucket successfully again:

UPDATE DATABASECHANGELOGLOCK SET LOCKED=false, LOCKGRANTED=null, LOCKEDBY=null where ID=1;