SSH push mirror to Google Source stopped working

Dear All,

Since October the 20th, all my mirrors in different projects stopped working. I have not made any changes to global gitlab/google settings.

Any idea what could cause this issue?

This is the error message:

13:get remote references: create git ls-remote: exit status 128, stderr: “ssh connect to host source.developers.google.com port 2022: Network is unreachable\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n”.

2 Likes

Having the same issue. All of the sudden all the mirrors stopped working with the same error.

1 Like

The user-based mirror uses OAuth and stopps working after 24h. This is not a sustainable solution. The Github mirror might work, but I don’t want to shift all the repos to a new platform.

Same here. No dice on push mirroring.

Same here, but only to some of my repos.
Any solution out there?

Same here. it has been working for months and now we started getting that error.

As they don’t care to reply to tickets even for paid clients, i ended up doing the following workaround:

mirror_to_google:
  image: google/cloud-sdk
  script:
    - echo "$GOOGLE_CREDENTIALS" > ./key.json
    - gcloud auth activate-service-account --key-file ./key.json
    - git config --global credential.'https://source.developers.google.com'.helper gcloud.sh
    - git remote add google_cloud_repo https://source.developers.google.com/p/YOUR_PROJECT_NAME/r/YOUR_REPOSITORY_NAME
    - git checkout -b $CI_COMMIT_REF_NAME
    - git push -f google_cloud_repo $CI_COMMIT_REF_NAME

GOOGLE_CREDENTIALS must be a variable you add in your Gitlab → CI settings, that contains the JSON that you get from a google service account

We have exactly the same issue here. We have managed to work out that if you use the same SSH keypair from Cloud Shell in the console it works fine, but with the same keypair from anywhere else it just won’t connect. We’ve raised a case with Google.

The mirrors are working now. Gitlab mentioned it was a firewall issue, but now it is resolved.

We’ve just had confirmation from Google that mirroring from Gitlab to CSR has been deprecated (and CSR to Gitlab) and that SSH should no longer work. HTTPS mirrors may stop working as well.

Thanks for reply. Did Google also provide an alternative approach?

It now works again but I don’t know why.

The issue still persists. Any solution that doesn’t mean that we have to add extra unneeded complexity?

You would have to provide error messages for anyone to help debug it. Also, since push mirroring to Github works (I use it), I would suggest the problem here is Google and not Gitlab. In which case you should be asking Google.

Thank you for your response!

The error is basically the same, saying that it cannot access the GCP env (excepting the fact we are using HTTPS instead of SSH - a 400 error) as the one that started the thread, and we did not change anything yet 2 / 4 mirrors that we have are failing. I know Google deprecated CSR for new users but we have been using it since late 2020s.
We do not want to shift everything to Github or any other solution.

I will get back here once I get a resolution from either Gitlab or GCP but if you have any other suggestions, besides retrying to create new credentials & mirrors, we would deeply appreciate them.

Thank you!

Unfortunately I don’t use GCP so cannot help there. I know mine works with what I use, eg: Gitlab to Github (at least from my private Gitlab server - I don’t use gitlab.com in case that is the issue here). Usually for any issues or problems if there is an outage, you can check https://status.gitlab.com which does show issues with importing from other repos, now whether pushing to other repos is affected by that, I’ve no idea.

Another thing would be to open an issue here just in case something is broken (since devs don’t read forum posts): Issues · GitLab.org / GitLab · GitLab

1 Like

Just to close the discussion. Managed to make it running by migrating to GEN2 repository on GCP, luckily it was quite simple to setup (the only diff is that for source param you can access the directory tree as GEN2 is aware of it) thus we will not invest any more time in the initial setup.

Thank you for your help!

1 Like