Cannot mirror protected branches
Summary
Enabling Only mirror protected branches
fails
Steps to reproduce
Set up mirroring between Gitlab projects. It doesn't matter if it's push or pull, I've seen this in both cases.
Click Mirror Repository
.
What is the current bug behavior?
Mirroring will fail with error message GitLab: You are not allowed to force push code to a protected branch on this project.
What is the expected correct behavior?
Mirroring should complete successfully.
Discussion
This is mirroring between two different servers running on the network. As mentioned, I experience this regardless whether it's a push to the target server or a pull from the source server, and regardless whether this is done with SSH or HTTPS (connectivity and access to each server is working correctly in each case, based on logs that I can see).
I am only working with master
branch at this time, and what's even better, I unprotected master
on the target server. Note that the server details below are from the source server that I manage; the target server is managed by another team and I do not have access to it to run the commands requested. I can say that the target server is running v11.3 omnibus, and that it is also healthy and otherwise perfectly operational.
Results of GitLab environment info
System information
System: Ubuntu 18.04
Proxy: no
Current User: git
Using RVM: no
Ruby Version: 2.5.3p105
Gem Version: 2.7.6
Bundler Version:1.16.6
Rake Version: 12.3.2
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.3
Go Version: unknown
GitLab information
Version: 11.7.0-ee
Revision: c02f0d47774
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
DB Version: 9.6.11
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: yes
Using Omniauth: yes
Omniauth Providers:
GitLab Shell
Version: 8.4.4
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: 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 ... 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: ... Server: <...>
LDAP authentication... Success
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... 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? ... no
Try fixing it:
sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads
sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} \;
sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} \;
For more information see:
doc/install/installation.md in section "GitLab"
Please fix the error above and rerun the checks.
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
2/27 ... yes
3/30 ... yes
3/31 ... yes
6/33 ... yes
2/38 ... yes
3/39 ... yes
6/40 ... yes
2/41 ... yes
2/42 ... yes
6/43 ... yes
6/44 ... yes
3/45 ... yes
2/46 ... yes
3/47 ... yes
31/48 ... yes
31/49 ... yes
6/50 ... yes
6/51 ... yes
2/52 ... yes
31/54 ... yes
31/55 ... yes
12/56 ... yes
3/57 ... yes
31/58 ... yes
31/59 ... yes
15/60 ... yes
3/61 ... yes
32/63 ... yes
31/65 ... yes
52/67 ... yes
46/68 ... yes
31/70 ... yes
31/71 ... yes
2/72 ... yes
52/73 ... yes
51/74 ... yes
52/75 ... yes
52/76 ... yes
52/77 ... yes
3/78 ... yes
50/79 ... yes
52/80 ... yes
3/81 ... yes
46/82 ... yes
45/83 ... yes
8/84 ... yes
10/85 ... yes
46/86 ... yes
2/87 ... yes
3/88 ... yes
46/89 ... yes
2/90 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.5.3)
Git version >= 2.18.0 ? ... yes (2.18.1)
Git user has default SSH configuration? ... no
Try fixing it:
mkdir ~/gitlab-check-backup-1548383016
sudo mv /var/opt/gitlab/.ssh/id_rsa ~/gitlab-check-backup-1548383016
sudo mv /var/opt/gitlab/.ssh/id_rsa.pub ~/gitlab-check-backup-1548383016
For more information see:
doc/ssh/README.md in section "SSH on the GitLab server"
Please fix the error above and rerun the checks.
Active users: ... 28
Elasticsearch version 5.6 - 6.x? ... skipped (elasticsearch is disabled)
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished