500 error viewing merge request following migration to AWS
Summary
As described by customer:
Here’s what I get from the console:
irb(main):007:0> mr.state
=> "merged"
irb(main):008:0> mr.source_branch
=> "branch-name-omitted"
irb(main):009:0> mr.diff_head_commit
=> nil
The source branch is definitely gone, but that’s common since we typically remove those on merge. The merge_commit_sha points to a valid commit.
Customer was able to resolve issue but unsure what occurred:
I got it working. I had to manually set MergeRequest#source_branch_id and MergeRequestDiff#head_commit_sha, then delete some Notes that were referencing commits that no longer exist.
Steps to reproduce
We have been unsuccessful in reproducing this error, or finding similar cases.
Example Project
n/a
What is the current bug behavior?
Merge request throws a 500 error due to notes referencing non-existent commits.
What is the expected correct behavior?
Merge request should load without error.
Results of GitLab environment info
System information
System: Ubuntu 16.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.3.5p376
Gem Version: 2.6.13
Bundler Version:1.13.7
Rake Version: 12.0.0
Redis Version: 3.2.5
Git Version: 2.13.5
Sidekiq Version:5.0.4
Go Version: unknown
GitLab information
Version: 10.0.1-ee
Revision: 9c3a3ca
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.3
URL: https://gitlab.emfeng.com
HTTP Clone URL: https://gitlab.emfeng.com/some-group/some-project.git
SSH Clone URL: git@gitlab.emfeng.com:some-group/some-project.git
Elasticsearch: yes
Geo: no
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 5.9.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.9.0 ? ... OK (5.9.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:root, or git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
3/1 ... ok
3/2 ... ok
3/3 ... ok
3/4 ... ok
5/5 ... ok
5/7 ... ok
5/8 ... ok
7/12 ... ok
4/13 ... ok
11/20 ... ok
11/23 ... ok
2/25 ... repository is empty
12/36 ... ok
12/37 ... ok
3/40 ... ok
11/41 ... ok
3/42 ... ok
3/43 ... ok
11/44 ... ok
11/48 ... ok
11/50 ... ok
11/51 ... ok
11/53 ... ok
11/54 ... ok
11/55 ... ok
11/56 ... ok
3/57 ... ok
3/58 ... ok
11/60 ... ok
11/61 ... ok
11/62 ... ok
3/63 ... ok
11/64 ... ok
11/65 ... ok
11/66 ... ok
16/68 ... ok
16/69 ... ok
16/70 ... repository is empty
5/71 ... ok
11/72 ... ok
3/73 ... ok
11/74 ... ok
11/75 ... ok
11/76 ... ok
11/78 ... ok
11/79 ... ok
11/80 ... ok
11/82 ... ok
3/83 ... ok
3/84 ... ok
3/85 ... ok
12/86 ... repository is empty
3/87 ... ok
3/88 ... ok
12/89 ... ok
11/90 ... ok
11/91 ... ok
11/92 ... ok
2/93 ... ok
17/94 ... ok
3/95 ... ok
11/96 ... ok
13/97 ... repository is empty
3/98 ... repository is empty
3/99 ... ok
3/101 ... ok
3/102 ... ok
3/103 ... ok
3/104 ... repository is empty
11/105 ... ok
13/107 ... repository is empty
13/109 ... repository is empty
13/110 ... repository is empty
11/111 ... ok
11/112 ... ok
11/113 ... ok
11/115 ... ok
11/116 ... ok
11/117 ... ok
11/118 ... ok
12/119 ... ok
3/121 ... ok
11/122 ... ok
11/123 ... repository is empty
3/124 ... ok
3/125 ... ok
3/126 ... repository is empty
3/127 ... ok
27/130 ... ok
27/131 ... ok
11/132 ... ok
11/133 ... ok
3/134 ... ok
9/135 ... ok
5/136 ... ok
24/137 ... ok
11/138 ... ok
11/139 ... ok
16/140 ... ok
3/141 ... ok
3/143 ... ok
13/144 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Reply by email is disabled in config/gitlab.yml
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... 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: ...
3/1 ... yes
3/2 ... yes
3/3 ... yes
3/4 ... yes
5/5 ... yes
5/7 ... yes
5/8 ... yes
7/12 ... yes
4/13 ... yes
11/20 ... yes
11/23 ... yes
2/25 ... yes
12/36 ... yes
12/37 ... yes
3/40 ... yes
11/41 ... yes
3/42 ... yes
3/43 ... yes
11/44 ... yes
11/48 ... yes
11/50 ... yes
11/51 ... yes
11/53 ... yes
11/54 ... yes
11/55 ... yes
11/56 ... yes
3/57 ... yes
3/58 ... yes
11/60 ... yes
11/61 ... yes
11/62 ... yes
3/63 ... yes
11/64 ... yes
11/65 ... yes
11/66 ... yes
16/68 ... yes
16/69 ... yes
16/70 ... yes
5/71 ... yes
11/72 ... yes
3/73 ... yes
11/74 ... yes
11/75 ... yes
11/76 ... yes
11/78 ... yes
11/79 ... yes
11/80 ... yes
11/82 ... yes
3/83 ... yes
3/84 ... yes
3/85 ... yes
12/86 ... yes
3/87 ... yes
3/88 ... yes
12/89 ... yes
11/90 ... yes
11/91 ... yes
11/92 ... yes
2/93 ... yes
17/94 ... yes
3/95 ... yes
11/96 ... yes
13/97 ... yes
3/98 ... yes
3/99 ... yes
3/101 ... yes
3/102 ... yes
3/103 ... yes
3/104 ... yes
11/105 ... yes
13/107 ... yes
13/109 ... yes
13/110 ... yes
11/111 ... yes
11/112 ... yes
11/113 ... yes
11/115 ... yes
11/116 ... yes
11/117 ... yes
11/118 ... yes
12/119 ... yes
3/121 ... yes
11/122 ... yes
11/123 ... yes
3/124 ... yes
3/125 ... yes
3/126 ... yes
3/127 ... yes
27/130 ... yes
27/131 ... yes
11/132 ... yes
11/133 ... yes
3/134 ... yes
9/135 ... yes
5/136 ... yes
24/137 ... yes
11/138 ... yes
11/139 ... yes
16/140 ... yes
3/141 ... yes
3/143 ... yes
13/144 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.3 ? ... Exception: undefined method `run_command' for SystemCheck::App::RubyVersionCheck:Class
Did you mean? run_commands
Git version >= 2.7.3 ? ... Exception: undefined method `run_command' for SystemCheck::App::GitVersionCheck:Class
Did you mean? run_commands
Git user has default SSH configuration? ... no
Try fixing it:
mkdir ~/gitlab-check-backup-1506698471
sudo mv /var/opt/gitlab/.ssh/id_rsa ~/gitlab-check-backup-1506698471
sudo mv /var/opt/gitlab/.ssh/authorized_keys.lock ~/gitlab-check-backup-1506698471
sudo mv /var/opt/gitlab/.ssh/id_rsa.pub ~/gitlab-check-backup-1506698471
For more information see:
doc/ssh/README.md in section "SSH on the GitLab server"
Please fix the error above and rerun the checks.
Active users: ... 16
Elasticsearch version 5.1 - 5.5? ... yes (5.3.0)
Checking GitLab ... Finished
Possible fixes
Need to identify what has occurred.
Edited by Adam Mulvany