502 Bad Gateway after trying to rebuild test-passed branch

That is the problem.

Lots of information here: Upgrade from within China fails due to git issues