Skip to content

LibGit2: Try collecting github sideband messages #58914

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Jul 5, 2025

github sends "sideband" messages to git clone that would be helpful for Pkg to show.
See the remote: prefixed messages here.

% git clone https://github.com/IanButterworth/Private.jl
Cloning into 'Private.jl'...
Username for 'https://github.com': IanButterworth
Password for 'https://IanButterworth@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/IanButterworth/Private.jl/'

This PR tries to capture and show them as part of our GitError (trying to fix JuliaLang/Pkg.jl#2701), but currently it doesn't detect any messages. I'm not sure why not.

The error below isn't relevant if you have github auth setup, it's only about user/password entry, but I thought maybe we should generally capture things github etc. is telling us.

Note LibGit2 tries 3 times.

julia> LibGit2.clone("https://github.com/IanButterworth/Private.jl", "/tmp/test_private_clone"; callbacks=LibGit2.Callbacks())
Username for 'https://github.com': IanButterworth
Password for 'https://IanButterworth@github.com': 
Username for 'https://github.com' [IanButterworth]:
Password for 'https://IanButterworth@github.com': 
Username for 'https://github.com' [IanButterworth]: 
Password for 'https://IanButterworth@github.com': 
ERROR: GitError: Code:EAUTH, Class:Callback, Message:
Aborting, maximum number of prompts reached.
Stacktrace:
 [1] macro expansion
   @ ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.13/LibGit2/src/error.jl:124 [inlined]
 [2] clone(repo_url::String, repo_path::String, clone_opts::LibGit2.CloneOptions)
   @ LibGit2 ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.13/LibGit2/src/repository.jl:470
 [3] clone(repo_url::String, repo_path::String; branch::String, isbare::Bool, remote_cb::Ptr{Nothing}, credentials::Nothing, callbacks::Dict{Symbol, Tuple{…}})
   @ LibGit2 ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.13/LibGit2/src/LibGit2.jl:592
 [4] top-level scope
   @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

(Note Base.getpass doesn't currently add a newline after entry like Base,prompt does. I think that's a bug which is tentatively fixed here..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloning repo using Pkg.add(url) results in a non-descriptive error
1 participant