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
To gitlab.com:st.git
 ! [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 (https://about.gitlab.com/gitlab-com/)
Am I not in the right forum to ask this ?

Hi,

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 git@gitlab.com:org/repo.git
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 ā€˜git@gitlab.com:org/repo.gitā€™

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 git@gitlab.com:org/repo.git '*:*' - 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        
To https://larkbuildmachine:xxx@gitlab.com/LarkTechnologies/goldfinch.git
 ! [remote rejected] master -> master (pre-receive hook declined)
...
error: failed to push some refs to 'https://larkbuildmachine:xxx@gitlab.com/LarkTechnologies/goldfinch.git'

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.