Occasionally, forking a new branch in a git repo can cause immediate, unrelated and irreversible build failures.
Our setup is a multibranch pipeline building each branch of the project for every commit. The repo is stored in Bitbucket.
We recently created a 'release/6.0.0' branch from our master branch, and the build on that branch immediately failed with the following error:
The same commit built fine on master, the only change in git is the creation of this new branch, which gets a new job/branch in the multibranch pipeline to reflect that. Our builds run on fresh Docker containers (Yet Another Docker Plugin); the builds in question ran on the same physical host, at separate times.
The problem is not ephemeral for the new branch - all future builds of that branch will be broken, with the same issue.
Deleting the branch, removing it from the multibranch job, then re-creating the branch does not fix the issue
The only approach that seems to work is to create another branch directly from the 'broken' one, with another name. For example, we created 'release/6.0.0b' (directly from 'release/6.0.0') and the build for that was fine.
The only correlation I can see is with the branch name. We occasionally see this with PRs too - sometimes the builds for a PR seem irreversibly broken. Simply opening a new PR with the same code change fixes the problem