Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Failed to migrate database for v5.4.0 (Up_1561558376) #4139
Hi - I'm not sure if this is worth even raising as an issue. I think it was probably caused by an old bug, but somehow it left some data hiding in the database which is now being surfaced by one of the recent migrations. Even if it's a rare edge case, I figured I could at least document it in an issue for potential searches. Feel free to close if you think no changes are needed.
After my Concourse was upgraded from to 5.4.0 (from 5.3.0), my
From that I was able to find
Manually looking through my database I found several entries which looked like they could cause a failure due to empty config and missing
From that I tried tracking down when those resources were configured (because they're not active resources in the pipeline). Unfortunately, those resource names don't ever appear in the repository's entire history, so it was likely something that happened during development.
So then I tried checking
From that I was able to see the metadata
From that, I checked back in my environment configuration history and it looks like I was running Concourse 0.75.0 at that time.
Given all that, I assume it was caused by a probably-old bug, but it seems suspicious that those records have been quietly sitting there unreferenced for three years?
Steps to Reproduce
Unfortunately, not sure if it's still reproducible, per se. I would theorize there was probably a since-fixed Concourse bug which allowed some incomplete database records to be created before updating a pipeline finished, and when updating it failed, the records were abandoned.
Successful database migrations; and probably no unnecessary ghost
I needed to get my Concourse up and running again, so I went ahead and tried to resolve it (in a possibly-not recommended way). I stopped the database to make a filesystem backup, and then I went ahead and manually removed those three ghost
I have the database backup for a little while longer in case there are any other details I can extract to help you investigate or patch.
Before the upgrade, that pipeline was green; and I don't recall seeing any weird, visual quirks in the UI that would have suggested the ghost resources.
As always, thanks for Concourse. It has been awesome watching it evolve over the years :)
Hmm, yeah it looks like it chokes on old inactive resources from before we stored the config data?
We could just make it default to an empty string. Kinda hacky, but at least we don't have to invent a value. The row is already inactive, and for it to become active it'll become valid at the same time.