Rewriting History causes Error 500 on Merge Requests
Summary
After rewriting history using bfg, visiting a merge request whose commit was rewritten, results in the HTTP 500 error page.
Steps to reproduce
Rewrite the history of a repo, specifically a commit referenced by a merge request. Then try to visit that merge request.
What is the current bug behavior?
Error 500
What is the expected correct behavior?
Complain that the commit is missing or otherwise display the merge request without the commit details. Ideally, use the rewritten commit.
Results of GitLab environment info
System information System: Ubuntu 16.04 Current User: git Using RVM: no Ruby Version: 2.3.3p222 Gem Version: 2.6.6 Bundler Version:1.13.7 Rake Version: 10.5.0 Redis Version: 3.2.5 Git Version: 2.10.2 Sidekiq Version:4.2.7
GitLab information Version: 9.0.5 Revision: a6b9899d Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://agora.cis.upenn.edu HTTP Clone URL: https://agora.cis.upenn.edu/some-group/some-project.git SSH Clone URL: git@agora.cis.upenn.edu:some-group/some-project.git Using LDAP: no Using Omniauth: no
GitLab Shell Version: 5.0.0 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/ Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 5.0.0 ? ... OK (5.0.0) Repo base directory exists? default... yes Repo storage directories are symlinks? default... no Repo paths owned by git:git? default... yes Repo paths access is drwxrws---? default... yes hooks directories in repos are links: ... 8/2 ... ok 8/4 ... ok 8/5 ... ok 8/6 ... ok 8/7 ... repository is empty 3/8 ... ok Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Access to /var/opt/gitlab/.ssh/authorized_keys: OK Send ping to redis server: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
IMAP server credentials are correct? ... yes Init.d configured correctly? ... skipped (omnibus-gitlab has no init script) MailRoom running? ... can't check because of previous errors
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config outdated? ... no Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory setup correctly? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) projects have namespace: ... 8/2 ... yes 8/4 ... yes 8/5 ... yes 8/6 ... yes 8/7 ... yes 3/8 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.1.0 ? ... yes (2.3.3) Your git bin path is "/opt/gitlab/embedded/bin/git" Git version >= 2.7.3 ? ... yes (2.10.2) Active users: 7
Checking GitLab ... Finished