Git push --mirror doesn't work

It was working fine 2 days ago.

This is the output:

Enter passphrase for key 'id_rsa':
Counting objects: 100, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (65/65), done.
Writing objects: 100% (100/100), 140.21 KiB | 3.79 MiB/s, done.
Total 100 (delta 78), reused 45 (delta 33)
remote: Resolving deltas: 100% (78/78), completed with 55 local objects.
remote: GitLab: API is not accessible
 ! [remote rejected]       git-svn/TECH-131_new -> git-svn/TECH-131_new (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-638_DetailedNotes -> git-svn/TECH-638_DetailedNotes (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-720 -> git-svn/TECH-720 (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-732 -> git-svn/TECH-732 (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-783 -> git-svn/TECH-783 (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-809 -> git-svn/TECH-809 (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-834 -> git-svn/TECH-834 (pre-receive hook declined)
 ! [remote rejected]       git-svn/TECH-839 -> git-svn/TECH-839 (pre-receive hook declined)
 ! [remote rejected]       git-svn/production -> git-svn/production (pre-receive hook declined)
 ! [remote rejected]       git-svn/release -> git-svn/release (pre-receive hook declined)
 ! [remote rejected]       git-svn/staging -> git-svn/staging (pre-receive hook declined)
 ! [remote rejected]       origin/production -> origin/production (pre-receive hook declined)```
1 Like

Did you check /var/opt/gitlab/gitlab-shell/config.yml file to see if “gitlab_uri” is set to your correct gitlab address?

thanks for replying - I don’t use gitlab shell.

  • this is command line git on windows
  • i checked the url - it’s correct
  • i tried the url both using the ssh and https - both result in the same error
  • i think it can reach gitlab (as it can count the delta it needs to push)

I mean on GitLab server to make sure the server is correctly set.

hi @hozawa - this is hosted gitlab (
Am I not in the right forum to ask this ?


i noticed the same issue when trying to push from another repository with --mirror …
Maybe a new version of gitlab has been deployed and we need to configure something ?

can anyone help us to re-activate this functionality ?

1 Like

I’ve same issue. Problem started at 07-Sep-2017 15:00:00 (UTC+3). One of my repositories wasn’t mirrored. Script logs:

07-Sep-2017 15:01:39 Cloning into bare repository ‘repo.git’…
07-Sep-2017 15:02:21 remote: GitLab: API is not accessible
07-Sep-2017 15:02:21 To
07-Sep-2017 15:02:21 ! [remote rejected] master -> master (pre-receive hook declined)
07-Sep-2017 15:02:21 ! [remote rejected] refs/pull/2322/head -> refs/pull/2322/head (pre-receive hook declined)
07-Sep-2017 15:02:21 ! [remote rejected] refs/pull/2322/merge -> refs/pull/2322/merge (pre-receive hook declined)
07-Sep-2017 15:02:21 ! [remote rejected] refs/pull/2324/merge (pre-receive hook declined)
07-Sep-2017 15:02:21 ! [remote rejected] refs/pull/2326/merge -> refs/pull/2326/merge (pre-receive hook declined)
07-Sep-2017 15:02:21 error: failed to push some refs to ‘’

Next script starts fails if I’ve any changes in my repository. Same time my script also registered deploy message:

07-Sep-2017 15:31:10 remote: ========================================================================
07-Sep-2017 15:31:10 remote:
07-Sep-2017 15:31:10 remote: We are currently deploying GitLab EE 9.5.4
07-Sep-2017 15:31:10 remote:
07-Sep-2017 15:31:10 remote: ========================================================================

I can push any my branch, push each of my brances one-by-one, create new branches and delete any branches, but I can’t use --mirror flag. Also I can’t use command git push '*:*' - it’s fails too.

1 Like

Oh ! It’s kind of good I’m not the only one having this issues.

And as you said: I too, can push them one by one but just not using the refspec or with --mirror

*edit: yes my problem also started around a week ago - around the time after they did an outage.

I also have the same problem with git push --mirror. I get the following message:

remote: GitLab: API is not accessible        
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ''

This was working for me for months but is broken since a week ago or so. I have checked my project and there are no protected branches set up. I don’t know how I can further help debug this.

1 Like

I think it may have something to do with rebasing. The push does work for other repos I have that are less complicated, and the error messages I see could possibly be only for branches that were rebased and then force pushed.

I’m having the same trouble. Seems to have started recently (within the past week or so?) for me too. Seems to be happening for my more “complicated” repo’s too. However, I’m not sure where to begin to look for more useful information.

Seems to have started recently (within the past week or so?)

Yep - timeline sounds about right.

In case it’s useful in establishing a pattern, the only things “complicated” I can think of with my two repos (out of about 15-20) that are failing with ‘git push --mirror’ is that both have had some rebasing of branches and cherry-picking of commits.

Not sure if it is a coincident … but it works now.

I’ve just l’ve just connect the social-sign int by going to:
User Settings>Account>Social-Sign in>Connect to GitHub as the upstream repository is hosted in GitHub!

I’ve tried disconnecting again the GitHub service, but it is still working fine and was able to push to Gitlab (origin repository) using the git push --mirror command without any error message. (i.e. remote: GitLab: API is not accessible).

Please try at your end to confirm.

Note: This has been tested on the GitLab hosted/cloud account, not enterprise server.

OK - can confirm it works now (hosted / cloud).

I’m new to gitlab and currently hosting quite a sizable repository.

A few questions to those who’ve used gitlab longer than I am:

  1. Is this sort of event happen regularly ?
  2. It’s about 11 days for this to be fixed - is this considered average / normal ?

Ok it works also for me now.

But i had not to connect to GitHub for upstream. It looks like the bug is fixed now.

My issues appear to have resolved as well.