Unable to fork project or create project from group template if application wide lock_duo_features_enabled
is true
Summary
If an instance has Duo disabled then you cannot fork a project. Additionally, creating a project from a group template results in the destination project having no repository.
Steps to reproduce
Forking a project
- Deploy an instance with some level of Duo license (tested with an Ultimate/Duo Core license)
- In
Admin>GitLab Duo
>Change configuration
setGitLab Duo availability
toAlways off
- Visit
/api/v4/application/settings
and checklock_duo_features_enabled: true
- Create a project and fork it
- Project is half created with no repository
Creating a project from group template
- Create a top-level group
- Create a subgroup within the group called
Templates
- Create a project with some content in the
Templates
subgroup - Set the subgroup to be the template source for the group
- Create a new project in the top-level group from the newly created template
- Notice it imports as expected
- Now set
lock_duo_features_enabled
totrue
- UI:
Admin -> GitLab Duo -> Change configuration -> select 'Always off'
- API:
curl -X PUT -H "PRIVATE-TOKEN: $PAT" http://gitlab.example.net/api/v4/application/settings?lock_duo_features_enabled=true
- UI:
- Now attempt to create a new project from the template in the top-level group
- Notice how the import fails and the project is created with no repository
Example Project
n/a
What is the current bug behavior?
Project is created but the import process does not complete so there is no git repo.
An error is also logged:
{"severity":"ERROR","time":"2025-09-02T12:24:09.100Z","correlation_id":"01K4564X77ZW4EQJN8KAXG7JV4","meta.caller_id":"POST /api/:version/projects/:id/fork","meta.remote_ip":"","meta.feature_category":"source_code_management","meta.user":"root","meta.user_id":1,"meta.project":"test/test","meta.root_namespace":"test","meta.client_id":"user/1","meta.organization_id":1,"message":"Unable to save project. Error: Unable to save #\u003cActiveRecord::RecordInvalid: Validation failed: Duo features enabled cannot be changed because it is locked by an ancestor\u003e: Duo features enabled cannot be changed because it is locked by an ancestor Project ID: 4"}
What is the expected correct behavior?
Project successfully forked.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
\# gitlab-rake gitlab:env:info System information System: Proxy: no Current User: git Using RVM: no Ruby Version: 3.2.8 Gem Version: 3.6.9 Bundler Version:2.7.1 Rake Version: 13.0.6 Redis Version: 7.2.10 Sidekiq Version:7.3.9 Go Version: unknown GitLab information Version: 18.3.1-ee Revision: cb15859792b Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 16.8 URL: https://gitlab.example.com HTTP Clone URL: https://gitlab.example.com/some-group/some-project.git SSH Clone URL: git@gitlab.example.com:some-group/some-project.git Elasticsearch: no Geo: no Using LDAP: no Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 14.44.0 Repository storages: - default: unix:/var/opt/gitlab/gitaly/gitaly.socket GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Gitaly - default Address: unix:/var/opt/gitlab/gitaly/gitaly.socket - default Version: 18.3.1 - default Git Version: 2.50.1.gl1
Results of GitLab application Check
Expand for output related to the GitLab application check
# gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ... Checking GitLab Shell ... GitLab Shell: ... GitLab Shell version \>= 14.44.0 ? ... OK (14.44.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Sidekiq: ... Running? ... yes Number of Sidekiq processes (cluster/worker) ... 1/1 Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... LDAP is disabled in config/gitlab.yml Checking LDAP ... Finished Checking GitLab App ... Database config exists? ... yes Tables are truncated? ... skipped All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Cable config exists? ... yes Resque config exists? ... 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? ... skipped (no tmp uploads folder yet) Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units) Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units) Projects have namespace: ... 35/1 ... yes 35/2 ... yes 35/3 ... yes 35/4 ... yes Redis version \>= 6.2.14? ... yes Ruby version \>= 3.0.6 ? ... yes (3.2.8) Git user has default SSH configuration? ... yes Active users: ... 1 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Elasticsearch version 7.x-9.x or OpenSearch version 1.x-3.x ... skipped (advanced search is disabled) All migrations must be finished before doing a major upgrade ... skipped (Advanced Search is disabled) Checking GitLab App ... Finished Checking GitLab subtasks ... Finished
Possible fixes
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.