404 Error when navigating between branches with '#' in the name
Summary
Navigation betwwen branches resukt on a 404 error if the selected branch have a '#' in it's name.
Steps to reproduce
Requisit : Have an existing project with branches that use '#' in the branch name
Importing a project from another git server (redmine in fact) and try to navigate in "Repository/Files" click in the drpdown branch list and choose one with a '#'. It result of a 404 Error.
Another way to get successful access is to click on "Repository/Branches" and then select your branch.
Expected behavior
Should display the branch
Actual behavior
A 404 error
Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.)
Output of checks
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/Padawan/dw-app/refs?ref=development" for 157.99.101.116 at 2016-09-19 14:01:04 +0200
Processing by ProjectsController#refs as */*
Parameters: {"ref"=>"development", "namespace_id"=>"Padawan", "id"=>"dw-app"}
Completed 200 OK in 87ms (Views: 0.5ms | ActiveRecord: 8.4ms)
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-09-19_12:01:04.11123 gitlab.pasteur.fr 157.99.101.116:63028 - - [2016-09-19 14:01:04.009568675 +0200 CEST] "GET /Padawan/dw-app/refs?ref=development HTTP/1.1" 304 0 "https://gitlab.pasteur.fr/Padawan/dw-app/tree/development" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" 0.101517
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/Padawan/dw-app/refs/switch?utf8=%E2%9C%93&destination=tree&path=&ref=Feature%2523Plugins" for 157.99.101.116 at 2016-09-19 14:01:07 +0200
Processing by Projects::RefsController#switch as HTML
Parameters: {"utf8"=>"✓", "destination"=>"tree", "path"=>"", "ref"=>"Feature%23Plugins", "namespace_id"=>"Padawan", "project_id"=>"dw-app"}
Filter chain halted as :assign_ref_vars rendered or redirected
Completed 404 Not Found in 90ms (Views: 1.8ms | ActiveRecord: 7.9ms)
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-09-19_12:01:07.51735 2016/09/19 14:01:07 ErrorPage: serving predefined error page: 404
2016-09-19_12:01:07.51767 gitlab.pasteur.fr 157.99.101.116:63028 - - [2016-09-19 14:01:07.415248191 +0200 CEST] "GET /Padawan/dw-app/refs/switch?utf8=%E2%9C%93&destination=tree&path=&ref=Feature%2523Plugins HTTP/1.1" 404 2440 "https://gitlab.pasteur.fr/Padawan/dw-app/tree/development" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" 0.102157
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/Padawan/dw-app/refs/switch?utf8=%E2%9C%93&destination=tree&path=&ref=Feature%2523Plugins" for 157.99.101.116 at 2016-09-19 14:01:07 +0200
Processing by Projects::RefsController#switch as HTML
Parameters: {"utf8"=>"✓", "destination"=>"tree", "path"=>"", "ref"=>"Feature%23Plugins", "namespace_id"=>"Padawan", "project_id"=>"dw-app"}
Filter chain halted as :assign_ref_vars rendered or redirected
Completed 404 Not Found in 79ms (Views: 1.1ms | ActiveRecord: 7.5ms)
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-09-19_12:01:07.62842 2016/09/19 14:01:07 ErrorPage: serving predefined error page: 404
2016-09-19_12:01:07.62861 gitlab.pasteur.fr 157.99.101.116:63028 - - [2016-09-19 14:01:07.538444945 +0200 CEST] "GET /Padawan/dw-app/refs/switch?utf8=%E2%9C%93&destination=tree&path=&ref=Feature%2523Plugins HTTP/1.1" 404 2440 "https://gitlab.pasteur.fr/Padawan/dw-app/tree/development" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36" 0.090021
==> /var/log/gitlab/gitlab-rails/production.log <==
Started PATCH "/ci/api/v1/builds/678/trace.txt" for 157.99.101.113 at 2016-09-19 14:01:08 +0200
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-09-19_12:01:08.64096 gitlab.pasteur.fr 157.99.101.113:58097 - - [2016-09-19 14:01:08.622225688 +0200 CEST] "PATCH /ci/api/v1/builds/678/trace.txt HTTP/1.1" 202 7 "" "gitlab-ci-multi-runner 1.5.0 (1-5-stable; go1.6.3; linux/amd64)" 0.018503
==> /var/log/gitlab/gitlab-rails/production.log <==
Started PATCH "/ci/api/v1/builds/676/trace.txt" for 157.99.101.113 at 2016-09-19 14:01:13 +0200
==> /var/log/gitlab/gitlab-workhorse/current <==
2016-09-19_12:01:13.75557 gitlab.pasteur.fr 157.99.101.113:36600 - - [2016-09-19 14:01:13.731846891 +0200 CEST] "PATCH /ci/api/v1/builds/676/trace.txt HTTP/1.1" 202 7 "" "gitlab-ci-multi-runner 1.5.0 (1-5-stable; go1.6.3; linux/amd64)" 0.023521
Results of GitLab application Check
[root@gitlab dw-app-build.git]# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 3.4.0 ? ... OK (3.4.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: ...
3/1 ... ok
3/3 ... ok
2/4 ... ok
14/6 ... ok
2/7 ... ok
2/8 ... ok
14/11 ... ok
2/14 ... ok
13/16 ... ok
13/17 ... ok
13/18 ... ok
13/19 ... ok
13/20 ... ok
13/21 ... ok
11/22 ... ok
2/23 ... ok
14/26 ... ok
3/27 ... ok
2/28 ... ok
14/29 ... ok
14/30 ... ok
14/31 ... ok
15/32 ... ok
15/33 ... ok
16/34 ... ok
16/36 ... ok
18/37 ... ok
16/38 ... ok
14/39 ... ok
2/40 ... ok
2/42 ... ok
14/43 ... ok
2/44 ... ok
11/45 ... ok
2/46 ... ok
20/48 ... ok
25/53 ... ok
25/54 ... ok
11/56 ... ok
25/57 ... ok
26/58 ... ok
26/59 ... ok
26/60 ... ok
28/61 ... ok
28/62 ... ok
28/64 ... ok
31/65 ... ok
3/66 ... ok
11/68 ... ok
32/69 ... ok
28/70 ... ok
24/71 ... repository is empty
17/72 ... ok
2/75 ... ok
33/77 ... ok
36/80 ... ok
3/81 ... 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 ...
Reply by email is disabled in config/gitlab.yml
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: ...
3/1 ... yes
3/3 ... yes
2/4 ... yes
14/6 ... yes
2/7 ... yes
2/8 ... yes
14/11 ... yes
2/14 ... yes
13/16 ... yes
13/17 ... yes
13/18 ... yes
13/19 ... yes
13/20 ... yes
13/21 ... yes
11/22 ... yes
2/23 ... yes
14/26 ... yes
3/27 ... yes
2/28 ... yes
14/29 ... yes
14/30 ... yes
14/31 ... yes
15/32 ... yes
15/33 ... yes
16/34 ... yes
16/36 ... yes
18/37 ... yes
16/38 ... yes
14/39 ... yes
2/40 ... yes
2/42 ... yes
14/43 ... yes
2/44 ... yes
11/45 ... yes
2/46 ... yes
20/48 ... yes
25/53 ... yes
25/54 ... yes
11/56 ... yes
25/57 ... yes
26/58 ... yes
26/59 ... yes
26/60 ... yes
28/61 ... yes
28/62 ... yes
28/64 ... yes
31/65 ... yes
3/66 ... yes
11/68 ... yes
32/69 ... yes
28/70 ... yes
24/71 ... yes
17/72 ... yes
2/75 ... yes
33/77 ... yes
36/80 ... yes
3/81 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 17
Checking GitLab ... Finished
#### Results of GitLab environment info
System information
System: CentOS 7.2.1511
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:2.3.0
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.11.6
Revision: 410d751
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://gitlab.pasteur.fr
HTTP Clone URL: https://gitlab.pasteur.fr/some-group/some-project.git
SSH Clone URL: git@gitlab.pasteur.fr:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: shibboleth, github, google_oauth2
GitLab Shell
Version: 3.4.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
Possible fixes
No idea