404 on "Edit milestone" page when followed link on Group Milestones page
Summary
Link to "Edit Milestone" for group milestones (introduced in GitLab 9.4) references a wrong milestone, resulting in 404 on /groups/<group>/milestones/‹wrong ID›/edit
.
Steps to reproduce
- Create group milestone on
/groups/‹group›/milestones/
- Go to
/groups/‹group›/milestones/
- Click "Edit" on the newly created milestone.
What is the current bug behavior?
The "Edit" link reference has a wrong milestone ID in it. The "Edit" page is actually accessible when browsed via /groups/‹group›/milestones/‹correct ID›/edit
It seems like an incorrect number range (one of a project milestone?) is looked up for creating the link reference.
What is the expected correct behavior?
The "Edit Milestone" for the selected group milestone appears.
Relevant logs and/or screenshots
production.log:
Started GET "/groups/‹group›/milestones/37/edit" for 10.0.200.187 at 2017-08-01 10:28:36 +0200
Processing by Groups::MilestonesController#edit as HTML
Parameters: {"group_id"=>"‹group›", "id"=>"37"}
Filter chain halted as :milestone rendered or redirected
Completed 404 Not Found in 28ms (Views: 0.9ms | ActiveRecord: 3.3ms)
Started POST "/api/v4/jobs/request" for 10.0.200.201 at 2017-08-01 10:28:36 +0200
Started GET "/-/metrics" for 127.0.0.1 at 2017-08-01 10:28:36 +0200
Processing by MetricsController#index as HTML
Filter chain halted as :validate_prometheus_metrics rendered or redirected
Completed 404 Not Found in 2ms (Views: 0.8ms | ActiveRecord: 0.0ms)
Output of checks
This bug might also happen on GitLab.com.
Results of GitLab environment info
Expand for output related to 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.13.0 Sidekiq Version:5.0.0 Go Version: unknownGitLab information Version: 9.4.2 Revision: a2ffceb Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https://gitlab.domain.com HTTP Clone URL: https://gitlab.domain.com/some-group/some-project.git SSH Clone URL: git@gitlab.domain.com:some-group/some-project.git Using LDAP: yes Using Omniauth: no
GitLab Shell Version: 5.3.1 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
Expand for output related to the GitLab application check
Checking GitLab Shell ...GitLab Shell version >= 5.3.1 ? ... OK (5.3.1) 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: ... 4/1 ... ok 14/2 ... ok 6/3 ... ok 6/4 ... ok 7/5 ... ok 5/6 ... ok 6/7 ... ok 6/8 ... ok 6/9 ... ok 3/10 ... ok 5/11 ... ok 6/12 ... ok 6/13 ... ok 6/14 ... ok 8/15 ... ok 6/16 ... ok 6/17 ... ok 6/18 ... ok 10/19 ... ok 2/20 ... ok 2/21 ... ok 2/22 ... ok 14/26 ... ok 3/27 ... ok 17/28 ... ok 10/29 ... ok 14/30 ... ok 2/31 ... repository is empty 14/32 ... ok 14/37 ... ok 10/38 ... ok 10/39 ... ok 10/40 ... ok 10/41 ... ok 10/42 ... ok 10/43 ... ok 14/44 ... ok 14/45 ... ok 14/46 ... 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 ...
Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) DN: uid=admin,ou=people,dc=domain,dc=com uid: admin DN: uid=abc,ou=people,dc=domain,dc=com uid: abc DN: uid=def,ou=people,dc=domain,dc=com uid: def DN: uid=ghj,ou=people,dc=domain,dc=com uid: ghj DN: uid=klm,ou=people,dc=domain,dc=com uid: klm DN: uid=nop,ou=people,dc=domain,dc=com uid: nop DN: uid=qrs,ou=people,dc=domain,dc=com uid: qrs DN: uid=tuv,ou=people,dc=domain,dc=com uid: tuv DN: uid=wxy,ou=people,dc=domain,dc=com uid: wxy DN: uid=zab,ou=people,dc=domain,dc=com uid: zab DN: uid=cde,ou=people,dc=domain,dc=com uid: cde
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? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. 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: ... 4/1 ... yes 14/2 ... yes 6/3 ... yes 6/4 ... yes 7/5 ... yes 5/6 ... yes 6/7 ... yes 6/8 ... yes 6/9 ... yes 3/10 ... yes 5/11 ... yes 6/12 ... yes 6/13 ... yes 6/14 ... yes 8/15 ... yes 6/16 ... yes 6/17 ... yes 6/18 ... yes 10/19 ... yes 2/20 ... yes 2/21 ... yes 2/22 ... yes 14/26 ... yes 3/27 ... yes 17/28 ... yes 10/29 ... yes 14/30 ... yes 2/31 ... yes 14/32 ... yes 14/37 ... yes 10/38 ... yes 10/39 ... yes 10/40 ... yes 10/41 ... yes 10/42 ... yes 10/43 ... yes 14/44 ... yes 14/45 ... yes 14/46 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.3 ? ... yes (2.3.3) Git version >= 2.7.3 ? ... yes (2.13.0) Active users: ... 9
Checking GitLab ... Finished