Using an existing subgroup name in the same parent path returns an internal server error
Summary
Creating a new subgroup with an existing subgroup name (in the same parent path) and a unique group path returns 500 internal server error.
Steps to reproduce
Given there exists a subgroup with:
- name:
Bar
- Parent path:
Foo
- Group path:
Foo/Bar
Attempting to create a new subgroup with:
- name:
Bar
- Parent path:
Foo
- Group path:
Foo/Bar2
Returns an 500 internal server error
Example Group
I have the following subgroup: https://gitlab.com/test-group-for-bug/foo
If I attempt to create a new subgroup with name foo
but path foo1
it fails.
What is the current bug behavior?
Internal server error when subgroup name already exist.
What is the expected correct behavior?
Expected it to allow duplicate names but unique group paths. If it cannot be duplicated, there should be a validation error similar to when you try to use an existing group path.
Relevant logs and/or screenshots
Log snippet from a self hosted instance:
"exception.message":"PG::UniqueViolation: ERROR: duplicate key value violates unique constraint \"index_namespaces_name_parent_id_type\"\nDETAIL: Key (name, parent_id, type)=(that, 103, Group) already exists.\n","exception.backtrace":
Output of checks
This bug happens on GitLab.com and self hosted instance of Gitlab
Edited by haani-niyaz