Git development
 help / color / mirror / Atom feed
From: DingJunyao  <dingjunyao0703@163.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Bug: git submodule update doesn't give a prompt to add pubkey of remote repo host, and failed because of it.
Date: Wed, 7 Feb 2024 00:07:07 +0800 (CST)	[thread overview]
Message-ID: <37a01273.7951.18d7f2c5303.Coremail.dingjunyao0703@163.com> (raw)

Git version: git version 2.43.0.windows.1
OS: Windows 11 22H2 (22621.3007)
(I don't know whether it's a Windows-specific bug)

I cloned a project from one remote repo (A), and the project has a submodule from the other remote repo (B). Both of them are connected to the remote repo of which by SSH, and I added my pubkey to both of the repo providers.

I executed the command in project directory:

    git submodule init
    git submodule update

When updating, the following error happened:

    Cloning into '/path/to/submodule'...
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed
    Failed to clone 'themes/anzhiyu-ding-mod'. Retry scheduled
    Cloning into '/path/to/submodule'...
    Host key verification failed.
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.
    fatal: clone of 'user@host:repo/path.git' into submodule path '/path/to/submodule' failed
    Failed to clone 'path/to/submodule' a second time, aborting

I cloned another repo from B. When I did it, I found I hadn't added the pubkey of repo B to the list of known hosts before.

    The authenticity of host 'host (XXX.XXX.XXX.XXX)' can't be established.
    ED25519 key fingerprint is SHA256:XXXXXXXXXXXXX.
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'host' (ED25519) to the list of known hosts.

After that, I tried to execute `git submodule update` in the previous project and succeeded.

I think when I update submodule and I haven't added the key to the submodule remote repo, it needs to give a prompt to add the public key, just like cloning.

                 reply	other threads:[~2024-02-06 16:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37a01273.7951.18d7f2c5303.Coremail.dingjunyao0703@163.com \
    --to=dingjunyao0703@163.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox