Cannot fork into a group where a user has Developer permissions
Summary
An error occurred while forking the project. Please try again.
is shown when a user tries to fork a project into a group where this user has Developer permissions.
Steps to reproduce
- Create a user & add them to a group with a Developer role.
- Create a project under the personal namespace of this user.
- Go to this project and click
Fork
. - in
Select namespace
dropdown you will see the list of namespaces where the user can create projects: personal namespace + groups where this user has a role Developer or higher. - select one of the groups where the user is a Developer, specify
Project name
andProject slug
, clickFork project
.
What is the current bug behavior?
Fork fails with An error occurred while forking the project. Please try again.
There will be the error {"message":{"user":["is not allowed to import projects"]}}
in browser's console coming from /api/v4/projects/PROJECT_ID/fork
.
What is the expected correct behavior?
Fork should be completed successfully. According to group members permissions, a user should be able to create projects in the namespaces where their role is Developer or higher.
Relevant logs and/or screenshots
The error from the console is shown above.
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 10 Proxy: no Current User: git Using RVM: no Ruby Version: 3.0.6p216 Gem Version: 3.4.13 Bundler Version:2.4.13 Rake Version: 13.0.6 Redis Version: 6.2.11 Sidekiq Version:6.5.7 Go Version: unknown GitLab information Version: 16.0.1-ee Revision: 29e1314f910 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 13.8 URL: https://gitlab.host.tld HTTP Clone URL: https://gitlab.host.tld/some-group/some-project.git SSH Clone URL: git@gitlab.host.tld:some-group/some-project.git Elasticsearch: no Geo: yes Geo node: Undefined Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 14.20.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell
Possible fixes
The issue is happening as a result of the merge request !117374 (merged) because the fork functionality relies on project import, and it is now not possible to import projects into a group for users with Developer permissions. Related issue: #387891 (closed)
Workaround
Assign Maintainer or Owner permissions to the user and then try to fork again.
Additional details
The issue was reproduced on 16.0.1 and 15.11.3.