Skip to content

failed to authenticate when downloading repository #3381

@jefflembeck

Description

@jefflembeck

While going through the docs, this one hit me:

~/code/rust-projects/guessing_game master [!?] $ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to load source for a dependency on `rand`

Caused by:
  Unable to update registry https://github.com/rust-lang/crates.io-index

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  failed to authenticate when downloading repository
attempted ssh-agent authentication, but none of the usernames `git` succeeded

To learn more, run the command again with —verbose.

The reason I'm hitting this issue is buried in my gitconfig

[url "git@github.com:"]
  insteadOf = https://github.com/

I am aware that this bug is a byproduct of how I have things set up locally, but since I'm capable of cloning https://github.com/rust-lang/crates.io-index without any issues with the above settings, I was hoping that I'd be able to use cargo in that way as well.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions