Skip to content

Unable to create a new project from a template when using a group access token

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

When attempting to create a project from a template while authenticating as a group access token, the project creation fails. The error that comes back from the API is:

Error adding importer user to Project members. Validation failed: User project bots cannot be added to other groups [FILTERED] projects","stats":null}"

We use the Gitlab terraform provider to manage subgroups and projects and utilize group access tokens and bot users to run that terraform as. It would be very useful to be able to support creating projects from templates as a bot user for this use case.

Potentially adding a "skip_set_owner" flag to the API would make this possible.

@georgekoltsov @wortschi @m_frankiewicz

Steps to reproduce

Using a group access token and bot user, attempt to create a project in the tokens group.

What is the current bug behavior?

Project fails to successfully finish, it is created but then some post import steps fails and the API returns the above error

What is the expected correct behavior?

API should allow for the project creation to successfully complete. If the bot user is unable to be added to the project members then there should be an option to skip that when creating a new project from a template

Relevant logs and/or screenshots

Error adding importer user to Project members. Validation failed: User project bots cannot be added to other groups [FILTERED] projects","stats":null}"

Results of GitLab environment info

Gitlab EE 15.9.3

Possible fixes

Post project creation authorization step: https://gitlab.com/gitlab-org/gitlab/-/blob/f5269a7d223fa76ac6b4d6f986d5f985b7b03a3d/app/services/projects/create_service.rb#L150 Possibly add the ability to skip this?

Edited by 🤖 GitLab Bot 🤖