cocos2d-x icon indicating copy to clipboard operation
cocos2d-x copied to clipboard

Update protocol to submodules

Open QuellaZhang opened this issue 3 years ago • 9 comments
trafficstars

Submodules will no longer download as the git: protocol, reference https://github.blog/2021-09-01-improving-git-protocol-security-github/#no-more-unauthenticated-git, update the protocol to https://. Fixed https://github.com/cocos2d/cocos2d-x/issues/20714.

QuellaZhang avatar Mar 17 '22 09:03 QuellaZhang

Can someone help approve the PR? Thanks!

QuellaZhang avatar Mar 24 '22 02:03 QuellaZhang

I just pulled down fresh git clone to test out v4 again and ran into this issue. Ideally someone who can merge this will also update the v3 branch with the same replace git:// with https://.

stevetranby avatar Apr 27 '22 12:04 stevetranby

@stevetranby I just tried v4 on an M1 machine (I finally own one) and I ran into this issue. Let's get it in front of engineering to have the fix merged for v4 and v3 branches.

I have this in .gitmodules

[submodule "tools/cocos2d-console"]
        path = tools/cocos2d-console
        url = https://github.com/cocos2d/cocos2d-console.git
[submodule "tools/bindings-generator"]
        path = tools/bindings-generator
        url = https://github.com/cocos2d/bindings-generator.git
[submodule "tests/cpp-tests/Resources/ccs-res"]
        path = tests/cpp-tests/Resources/ccs-res
        url = https://github.com/dumganhar/ccs-res.git

but I still seem to be doing the same error:

% git submodule update --init
Cloning into '/Users/jasmine/sandbox/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 '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/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 '/Users/jasmine/sandbox/cocos2d-x/tools/bindings-generator' failed
Failed to clone 'tools/bindings-generator'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/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 '/Users/jasmine/sandbox/cocos2d-x/tools/cocos2d-console' failed
Failed to clone 'tools/cocos2d-console'. Retry scheduled
Cloning into '/Users/jasmine/sandbox/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 '/Users/jasmine/sandbox/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res' a second time, aborting

did I make a mistake? I also read the blog post.

slackmoehrle avatar May 11 '22 15:05 slackmoehrle

Not sure why it's not using the https version, but your git submodule command looks like it tried to clone from the git:// protocol version:

fatal: clone of 'git://github.com/dumganhar/ccs-res.git'

You need to figure out how to get the git submodule command to use the updated .gitmodules? Not sure how? Maybe you have something cached? Maybe you updated the wrong .gitmodules? Maybe you need to restart (for the proverbial fixes everything potential?)

stevetranby avatar May 18 '22 20:05 stevetranby

I also ran into the same issue and fixing the .gitmodules file was not sufficient. I also had to edit .git/config file and replace git refferences with https url. I recommend adding a note on the README or approving the PR asap to avoid recurring errrors

pvgmenegasso avatar Jun 16 '22 06:06 pvgmenegasso

Link to pull request

pvgmenegasso avatar Jun 16 '22 19:06 pvgmenegasso

Until the fix is merged, I resolved problem by running the following command (which makes git run https protocol instead of git for github.com:

git config --global url.https://github.com/.insteadOf git://github.com/

raulcesar avatar Jun 29 '22 00:06 raulcesar

Please check this. Yes, the git protocol can't work now. The error log is:

Cloning into 'F:/cocos2d-x/tests/cpp-tests/Resources/ccs-res'...
fatal: unable to connect to github.com:
github.com[0: 20.205.243.166]: errno=Unknown error

fatal: clone of 'git://github.com/dumganhar/ccs-res.git' into submodule path 'F:/cocos2d-x/tests/cpp-tests/Resources/ccs-res' failed
Failed to clone 'tests/cpp-tests/Resources/ccs-res' a second time, aborting

huhuang03 avatar Jul 16 '22 08:07 huhuang03