Problem/Motivation

I went looking for the repository clone URL to make modifications to a module I maintain and noticed that I could not clone via SSH using the URL provided by GitLab.

GitLab is providing git@git.drupalcode.org:project/audiorecorder.git as the SSH clone URL whereas the SSH clone URL which works is git@git.drupal.org:project/audiorecorder.git.

The HTTPS clone URL provided by GitLab (https://git.drupalcode.org/project/audiorecorder.git) does work, but only for anonymous downloads.

Here's a screenshot showing the wrong SSH clone URL being displayed:
Screenshot of Gitlab with an arrow pointing at the invalid SSH clone URL.

Steps to reproduce

  1. Go to the Gitlab space for a contrib project, e.g. audiorecorder
  2. Click on the "Clone" button
  3. Examine the "Clone with SSH" field and note that git.drupalcode.org is the hostname
  4. Try running git clone with that URL and receive SSH connection failures:
    $ git clone git@git.drupalcode.org:project/audiorecorder.git
    Cloning into 'audiorecorder'...
    
    ssh: connect to host git.drupalcode.org port 22: Operation timed out
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.

Proposed resolution

Configure GitLab to report the correct hostname for SSH clones.

CommentFileSizeAuthor
gitlab-ssh-clone-url-drupalcode_org.png231.94 KBadamfranco

Comments

adamfranco created an issue. See original summary.

drumm’s picture

This is an issue with GitLab itself: https://gitlab.com/gitlab-org/gitlab/-/issues/404496

bygeoffthompson’s picture

I can confirm this issue and the suggested workaround. Changing the SSH URL I received from Gitlab from

git clone git@git.drupalcode.org:project/node_read_time.git .

to

git clone git@git.drupal.org:project/node_read_time.git .

finally allowed me to pull the repo locally. Hopefully the Gitlab issue can be resolved to avoid this.

Thanks

shashank5563’s picture

Status: Active » Reviewed & tested by the community

I have checkout and found git SSH ulr issue is fixed. So, I am moving it for RTBC.

Like: git@git.drupal.org:project/push_notifications.git

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Yes, this has been resolved. We’re now running a version of GitLab with https://gitlab.com/gitlab-org/gitlab/-/issues/404496 committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.