Skip to content

Authentication failed cloning public repo containing submodules #2344

Closed

Description

@erikmartinessanches

Description

When cloning my repo using HTTPS containing two submodules, I receive the following:
githuberror

  • This error does not appear when using GitHub Desktop to clone the submodules individually.

  • This error does not appear when using terminal to clone my repo git clone -recursive https://github.com/erikmartinessanches/javadev.git but git prompts for password twice (for each submodule, how to enable cloning without password?)

Version

git version 2.11.0 (Apple Git-81)

GitHub Desktop version: 0.7.0

OS version: Mac OS version 10.12.5 (16F73)

Steps to Reproduce

  1. Select Open in Desktop (HTTPS option) on my repo
  2. Optionally adjust directory details
  3. Error appears

I've tried signing out of GitHub and GitHub Desktop and signing in again, does not resolve.

Expected behavior: Clone repo with or without submodules.

Actual behavior: Only the outer repo seems to get cloned, then the error above appears, the submodule repos are not cloned.

Reproduces how often: 100%

Logs

2017-07-27.desktop.production.log.zip

Additional Information

Activity

  1. added
    bug
    investigation-needed
    on Jul 27, 2017
  2. shiftkey commented on Jul 27, 2017

    @shiftkey
    Member

    @erikmartinessanches thanks for the detailed report (and public repository that demonstrates the issue):

    git prompts for password twice (for each submodule, how to enable cloning without password?)

    I think this is due to the submodules using SSH remotes (there's a slightly different flow here, which I can write more about after ☕).

    As these submodules are public, they can be changed over to HTTPS URLs which will not trigger the authentication steps. Just remember to synchronize the submodules on your machine after the change:

    git submodule sync
    git submodule update --init --recursive --remote
    
  3. removed
    investigation-needed
    on Jul 27, 2017
  4. shiftkey commented on Jul 27, 2017

    @shiftkey
    Member

    Reproducible on macOS:

    Submodule 'patterns' ([email protected]:erikmartinessanches/patterns.git) registered for path 'patterns'
    Cloning into '/Users/shiftkey/Desktop/new/javadev/algorithms'...
    ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
    Host key verification failed.
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    It looks like our setup for prompting for credentials falls through to some random defaults when it encounters an SSH remote. Not sure if we need to opt in SSH_ASKPASS as per these docs or something else.

  5. self-assigned this
    on Aug 27, 2017
  6. shiftkey commented on Aug 27, 2017

    @shiftkey
    Member

    @erikmartinessanches apologies for the delay in replying.

    As a workaround you could change these entries to be HTTPS URLs, which will bypass the need to invoke SSH for cloning the submodules which seems to have issues unless you have configured SSH credentials.

  7. removed their assignment
    on Sep 22, 2017
  8. ievgennaida commented on Aug 8, 2018

    @ievgennaida

    I have the same issue with https and sub-module. Terminal works fine.
    Sub-module is fetched with something like this: [email protected]:www/www.git

  9. added a commit that references this issue on Aug 10, 2018
  10. added
    priority-2
    on Oct 10, 2018
  11. varunsinghal65 commented on Oct 24, 2018

    @varunsinghal65

    Hello @erikmartinessanches,
    I faced the exact same issue, for me even terminal was not working.
    This was after my repo was configured to target HTTPS url and not SSH.

    As i workaround i deleted the stored credentials (windows) :
    Credentials Manager -> Manage windows credentials -> delete all stored credentials for GIT

    After this it worked from terminal as well as the UI (Git ext)

  12. fluffy commented on Aug 30, 2021

    @fluffy

    Having exactly this issue. Hard to believe this has been open since 2017.

  13. sergiou87 commented on Jul 11, 2022

    @sergiou87
    Member

    This seems related to the lack of proper support for SSH authentication in GitHub Desktop, but that should've been solved with #12756 and #14677

    I just tested it and works as expected with private SSH and HTTPS submodules.

  14. JosephTLyons commented on Feb 25, 2024

    @JosephTLyons
    Contributor

    This is happening to me right now.

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

    bugpriority-2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions