Skip to content

Improve ssh cloning authentication error feedback #173

@snomos

Description

@snomos

I have run the following command when setting up a new machine:

gut init -r /Users/smo036/langtech/gut -t ghp_TOKEN -o giellalt

And tested that the token has the correct credentials:

curl -H "Authorization: token ghp_TOKEN" https://api.github.com/users/codertocat -I
HTTP/2 200 
server: GitHub.com
date: Sat, 19 Mar 2022 08:40:56 GMT
content-type: application/json; charset=utf-8
content-length: 1340
cache-control: private, max-age=60, s-maxage=60
vary: Accept, Authorization, Cookie, X-GitHub-OTP
etag: "908dbc7a547142520f56ef556f6f4822c2ea88bbd13d61c5fa2a4caadf99d045"
last-modified: Tue, 04 Jan 2022 03:25:08 GMT
x-oauth-scopes: admin:org, admin:org_hook, admin:repo_hook, delete:packages, delete_repo, notifications, repo, user, workflow, write:discussion, write:packages
x-accepted-oauth-scopes: 
x-github-media-type: github.v3; format=json
x-ratelimit-limit: 5000
x-ratelimit-remaining: 4999
x-ratelimit-reset: 1647682856
x-ratelimit-used: 1
x-ratelimit-resource: core
access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'
vary: Accept-Encoding, Accept, X-Requested-With
x-github-request-id: EAF2:7D77:51F91E:57B35C:62359717

Still, I get the following error when trying to clone:

gut clone -o divvun -r ^registry
 2022-03-19T08:57:53.952Z DEBUG gut > Arguments: Args { command: Clone(CloneArgs { organisation: Some("divvun"), regex: Some(Filter { regex: ^registry }), use_https: false }) }
 2022-03-19T08:57:54.774Z DEBUG gut::git::clone > Clone "[email protected]:divvun/registry.git" to "/Users/smo036/langtech/gut/divvun/registry"
+------------------+
| Repo      Status |
+==================+
| registry  Failed |
+------------------+

There 1 errors when cloning:

+--------------------------------------------------------------------------------------------+
| Repo      Error                                                                            |
+============================================================================================+
| registry  Cannot clone repository with [email protected]:divvun/registry.git because of faile |
|           d authentication for repository                                                  |
|                                                                                            |
|           Caused by:                                                                       |
|               failed authentication for reposi                                             |
|           tory                                                                             |
+--------------------------------------------------------------------------------------------+

gut does not give very much details. What is going wrong? Any help appreciated, @bbqsrc and @lenguyenthanh 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions