Create a branch button fails in empty project
Summary
If you make a new project, don't commit anything and click create branch (or create merge request) in an issue, you get "Something went wrong on our end" (or "Failed to create Merge Request. Please try again.").
EDIT: I just found out that an important addition to this problem is this: My user did not have permissions to push to the default branch!
Steps to reproduce
- Create an empty project
- Be a "developer" user on that project
- Create an issue in that project
- Click "Create a branch"
What is the current bug behavior?
"Something went wrong on our end"
What is the expected correct behavior?
An error message saying "You do not have sufficient permissions to create the default branch", or give permissions to a Developer to create the default branch if it does not exist yet
Relevant logs and/or screenshots
From gitlab-rails/production.log:
Started POST "/yyy/zzz/branches?branch_name=2-xxx&issue_iid=2" for 80.127.151.185 at 2018-01-24 09:11:28 +0000
Processing by Projects::BranchesController#create as JSON
Parameters: {"branch_name"=>"2-xxx", "issue_iid"=>"2", "namespace_id"=>"yyy", "project_id"=>"zzz"}
Started GET "/openappstack/oas-admin/noteable/issue/1391/notes" for 80.127.151.185 at 2018-01-24 09:11:28 +0000
Started POST "/api/v4/internal/allowed" for 127.0.0.1 at 2018-01-24 09:11:28 +0000
Completed 500 Internal Server Error in 321ms (ActiveRecord: 8.3ms)
ActionController::UrlGenerationError (No route matches {:action=>"show", :controller=>"projects/compare", :from=>nil, :namespace_id=>#<Group id:20 @yyy>, :project_id=>#<Project id:125 yyy/zzz>, :to=>"2-xxx"} missing required keys: [:from]):
config/application.rb:175:in `block (4 levels) in <class:Application>'
app/services/system_note_service.rb:413:in `new_issue_branch'
app/controllers/projects/branches_controller.rb:51:in `create'
lib/gitlab/i18n.rb:47:in `with_locale'
lib/gitlab/i18n.rb:53:in `with_user_locale'
app/controllers/application_controller.rb:340:in `set_locale'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:14:in `call'
lib/gitlab/middleware/go.rb:18:in `call'
lib/gitlab/etag_caching/middleware.rb:11:in `call'
lib/gitlab/middleware/read_only.rb:31:in `call'
lib/gitlab/request_context.rb:18:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 8.9 Current User: git Using RVM: no Ruby Version: 2.3.5p376 Gem Version: 2.6.13 Bundler Version:1.13.7 Rake Version: 12.1.0 Redis Version: 3.2.5 Git Version: 2.13.6 Sidekiq Version:5.0.4 Go Version: unknownGitLab information Version: 10.2.3 Revision: 3141105 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://code.greenhost.net HTTP Clone URL: https://code.greenhost.net/some-group/some-project.git SSH Clone URL: git@code.greenhost.net:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.9.4 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git