Skip to content

Fail to clone submodules due to "the unauthenticated git protocol on port 9418 is no longer supported". #20714

@QuellaZhang

Description

@QuellaZhang

When we cloned cocos2d-x repo today and found the following error:

F:\>git clone --recursive https://github.com/cocos2d/cocos2d-x F:\gitP\cocos2d\cocos2d-x
Cloning into 'F:/gitP/cocos2d/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path 'F:/gitP/cocos2d/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res'. Retry scheduled
Cloning into 'F:/gitP/cocos2d/cocos2d-x/tools/bindings-generator'...
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/cocos2d/bindings-generator.git' into submodule path 'F:/gitP/cocos2d/cocos2d-x/tools/bindings-generator' failed
Failed to clone 'tools/bindings-generator'. Retry scheduled
Cloning into 'F:/gitP/cocos2d/cocos2d-x/tools/cocos2d-console'...
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/cocos2d/cocos2d-console.git' into submodule path 'F:/gitP/cocos2d/cocos2d-x/tools/cocos2d-console' failed
Failed to clone 'tools/cocos2d-console'. Retry scheduled
Cloning into 'F:/gitP/cocos2d/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: remote error:
The unauthenticated git protocol on port 9418 is no longer supported.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path 'F:/gitP/cocos2d/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res' a second time, aborting

Activity

slackmoehrle

slackmoehrle commented on Jan 12, 2022

@slackmoehrle
Contributor

I see the failure. I tested and the following works:

git clone https://github.com/cocos2d/cocos2d-x
cd cocos2d-x/
git submodule update --init
Trother555

Trother555 commented on Mar 17, 2022

@Trother555

Hey, I actually faced this issue. It is said here that the protocol git:// is outdated. You may do this as a workaround:

  1. Replace urls in .gitmodules like this:
$git diff
...
 [submodule "tools/cocos2d-console"]
         path = tools/cocos2d-console
-        url = git://github.com/cocos2d/cocos2d-console.git
+        url = git@github.com:cocos2d/cocos2d-console.git
 [submodule "tools/bindings-generator"]
         path = tools/bindings-generator
-        url = git://github.com/cocos2d/bindings-generator.git
+        url = git@github.com:cocos2d/bindings-generator.git
 [submodule "tests/cpp-tests/Resources/ccs-res"]
         path = tests/cpp-tests/Resources/ccs-res
-        url = git://github.com/dumganhar/ccs-res.git
+        url = git@github.com:dumganhar/ccs-res.git
  1. Sync the new urls: $git submodule sync --recursive
  2. Now $git submodule update --init should work.

I don't know maybe they should update the submodule urls if it won't break something

QuellaZhang

QuellaZhang commented on Mar 17, 2022

@QuellaZhang
Author

Yes, the problem is back. I tried it and it works too, but it's better to fix it upstream, local patching is of no use to us.

diff --git a/.gitmodules b/.gitmodules
index b3bdfed93f..7cd9b05dd5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,9 +1,9 @@
 [submodule "tools/cocos2d-console"]
         path = tools/cocos2d-console
-        url = git://github.com/cocos2d/cocos2d-console.git
+        url = https://github.com/cocos2d/cocos2d-console.git
 [submodule "tools/bindings-generator"]
         path = tools/bindings-generator
-        url = git://github.com/cocos2d/bindings-generator.git
+        url = https://github.com/cocos2d/bindings-generator.git
 [submodule "tests/cpp-tests/Resources/ccs-res"]
         path = tests/cpp-tests/Resources/ccs-res
-        url = git://github.com/dumganhar/ccs-res.git
+        url = https://github.com/dumganhar/ccs-res.git
\ No newline at end of file

https://github.blog/2021-09-01-improving-git-protocol-security-github/
We’re changing which keys are supported in SSH and removing unencrypted Git protocol. Only users connecting via SSH or git:// will be affected. If your Git remotes start with https://, nothing in this post will affect you. If you’re an SSH user, read on for the details and timeline.

linked a pull request that will close this issue on Mar 17, 2022
Thf772

Thf772 commented on Jul 22, 2024

@Thf772

I see the failure. I tested and the following works:

git clone https://github.com/cocos2d/cocos2d-x
cd cocos2d-x/
git submodule update --init

Tested on Ubuntu 22.04 WSL with Git 2.34.1 and these commands don't work. On the day I write this message, replacing git submodule update --initwith the following commands do work:

git submodule init
git submodule set-url tools/cocos2d-console https://github.com/cocos2d/cocos2d-console.git
git submodule set-url tools/bindings-generator https://github.com/cocos2d/bindings-generator.git
git submodule set-url tests/cpp-tests/Resources/ccs-res https://github.com/dumganhar/ccs-res.git
git submodule update

The .gitmodule file needs to be updated ASAP. There is a PR over 2 years old that will do exactly that, I can't believe it hasn't been merged already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @slackmoehrle@Trother555@Thf772@QuellaZhang

      Issue actions

        Fail to clone submodules due to "the unauthenticated git protocol on port 9418 is no longer supported". · Issue #20714 · cocos2d/cocos2d-x