Corrupted loose reference file refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2d [www-gitlab-com]

Overview

@ayufan reported the error warning: ignoring broken ref refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2doccurring when testing deploy on env for the repo www-gitlab-com

Investigation

root@worker17:/tmp/www-gitlab-com.git# git fsck 
Checking object directories: 100% (256/256), done.
Checking objects: 100% (98811/98811), done.
error: refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2d: invalid sha1 pointer 0000000000000000000000000000000000000000
root@worker17:/tmp/www-gitlab-com.git# git gc
fatal: bad object refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2d
error: failed to run repack
root@worker17:/tmp/www-gitlab-com.git# ls -l /var/opt/gitlab/git-data/repositories/gitlab-com/www-gitlab-com.git/refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2d
-rw-r--r-- 1 git git 0 Jul 18 22:59 /var/opt/gitlab/git-data/repositories/gitlab-com/www-gitlab-com.git/refs/keep-around/450b31dca86436b334dc11c8a1644ef32b1f5e2d

Kibana logs: https://log.gitlap.com/goto/df53297bb89a55754c1d894f9268cb5e (Unable to create keep-around reference)

Slack discussion: https://gitlab.slack.com/archives/infrastructure/p1480069757034990

//cc @pcarranza @stanhu @zj