Error "Approvals rules group is invalid" is shown when trying to create a merge request
Summary
NOTE: This issue has not been reproduced on a test environment, and it is created to gather all the investigation results from various customers.
Error Approvals rules group is invalid is shown when trying to create a merge request for a project with merge request approvals configured.
Steps to reproduce
- have a project in a private group with merge request approvals configured
- try to create a MR in this project - error
Approvals rules group is invalid(see the attached screenshot)
What is the current bug behavior?
Unclear error message Approvals rules group is invalid is shown when trying to create a merge request
What is the expected correct behavior?
Error message should not be shown or it should be actionable i.e. it should explain what is wrong with the approval rules.
Relevant logs and/or screenshots
Case1: reproduced with GitLab 11.10.8 after the upgrade from 11.9 with a private project in a private group (not a sub-group). If one un-checks Can override approvers and approvals required per merge request then it will be possible to create a merge request
Approval rules:
irb(main):002:0> p.approval_rules
=> #<ActiveRecord::Associations::CollectionProxy [#<ApprovalProjectRule id: xxx, created_at: "2019-xx-xx 04:45:30", updated_at: "2019-xx-xx 04:45:30", project_id: yyyy, approvals_required: 2, name: "Default">]>
Case2: reproduced with GitLab 12.3.3 with an internal project in a private group (not clear how project visibility was set to internal). Fixed by setting the group to public.
irb(main):002:0> p.approval_rules
=> #<ActiveRecord::Associations::CollectionProxy [#<ApprovalProjectRule id: xxx, created_at: "2019-xx-xx 18:16:57", updated_at: "2019-xx-xx 18:16:57", project_id: yyy, approvals_required: 1, name: "Avenger", rule_type: "regular">]>
For both cases: no errors were observed in GitLab logs. The following error was found in browser console:
dropzone.js:1431 Uncaught Error: No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.
at Function.i.forElement (dropzone.js:1431)
at f (dropzone_input.js:300)
at e.value (gl_form.js:48)
at new e (gl_form.js:22)
at HTMLDocument.t.a (init_merge_request.js:15)
i.forElement @ dropzone.js:1431
f @ dropzone_input.js:300
value @ gl_form.js:48
e @ gl_form.js:22
t.a @ init_merge_request.js:15
Links to ZD tickets (internal only):
