Merge requests fail with error 500 for some projects
Created by: danielran
I've been trying to figure out this one for days. Several other issues seem similar but I've had no luck with any of the proposed solutions (rebuilding satellites, manually cloning into satellite repo, running bundle install
etc.).
Attempting to merge certain branches (most but not all) on certain projects (most but not all) results in 500 errors. There seems to be no correlation between whether a repository has seen any change since the upgrade to 7.0.
production.log
Processing by Projects::MergeRequestsController#new as HTML
Parameters: {"utf8"=>"✓", "merge_request"=>{"source_project_id"=>"#", "source_branch"=>"branchName", "target_project_id"=>"#", "target_branch"=>"master"}, "project_id"=>"<repo-group>/<repo>"}
Completed 500 Internal Server Error in 445ms
NoMethodError (undefined method `reduce' for false:FalseClass):
app/models/commit.rb:26:in `diff_line_count'
app/controllers/projects/merge_requests_controller.rb:94:in `new'
githost.log
July 02, 2014 06:38 -> ERROR -> Command failed [1]: /usr/bin/git --git-dir=/home/git/gitlab-satellites/<repo-group>/<repo>/.git merge-base origin/master source/branchName
It also contains a few instances of this.
July 01, 2014 14:26 -> ERROR -> Command failed [1]: /usr/bin/git --git-dir=/home/git/gitlab-satellites/<repo>/.git branch -D master
error: Cannot delete the branch 'master' which you are currently on.
Which is odd since no one is trying to delete the master branch.
This is the output of gitlab:check
. All green.
Instance method "lock!" is already defined in ActiveRecord::Base, use generic helper instead or set StateMachine::Machine.ignore_method_conflicts = true.
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.9.6 ? ... OK (1.9.6)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ...
[All repos OK]
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.4
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
[All repos OK]
Projects have satellites? ...
[All repos OK]
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.9.1)
Checking GitLab ... Finished
Environment.
Instance method "lock!" is already defined in ActiveRecord::Base, use generic helper instead or set StateMachine::Machine.ignore_method_conflicts = true.
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.6.3
Rake Version: 10.3.2
Sidekiq Version:2.17.0
GitLab information
Version: 7.0.0
Revision: de9bf7d
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: http://<gitlab>
HTTP Clone URL: http://<gitlab>/some-project.git
SSH Clone URL: git@<gitlab>:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.9.6
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/bin/git
I've tried everything I can think of. I think it's still a synchronicity problem between the satellites and actual repositories but even deleting gitlab-satellites
and recreating them doesn't solve it.