More problems trying to add packages from private repos

There have been many threads about the difficulties of using private repositories with Pkg. Here’s one, which contains links to various other threads:

At some point in the past I managed to get things working somehow, but now they appear to be broken again and I don’t know how to fix it. I decided to throw in the towel and connect to one of my private repos with HTTPS instead of SSH. And yet I still can’t actually add the repo. Here’s what happens:

(PackageA) pkg> add https://github.com/CameronBieganek/PackageB.jl.git
    Updating git-repo `https://github.com/CameronBieganek/PackageB.jl.git`
Username for 'https://github.com': myemail@gmail.com
Password for 'https://myemail@gmail.com@github.com': 
Username for 'https://github.com' [myemail@gmail.com]: myemail@gmail.com
Password for 'https://myemail@gmail.com@github.com': 
Username for 'https://github.com' [myemail@gmail.com]: myemail@gmail.com
Password for 'https://myemail@gmail.com@github.com': 
ERROR: failed to fetch from https://github.com/CameronBieganek/PackageB.jl.git, error: GitError(Code:EUSER, Class:Callback, Aborting, user cancelled credential request.)

What am I doing wrong? Why is this so hard? For now I’m giving up and and making one of my private repos public.

1 Like

Mandatory question: can you git clone the package outside of Julia?

If that works you may want to try the Julia 1.7 release candidate with JULIA_PKG_USE_CLI_GIT=true, see julia/NEWS.md at release-1.7 · JuliaLang/julia · GitHub.

1 Like

I don’t know why connecting with HTTPS doesn’t work, but some time ago I also experienced issues adding my private packages via SSH. I think my problem was I was generating an SSH key that was incompatible with LibGit2. Once I generated a compatible SSH key things worked seamlessly. (See LocalRegistry.jl/ssh_keys.md at master · GunnarFarneback/LocalRegistry.jl · GitHub for details.)

2 Likes

Thanks for the responses. Generating a new SSH key with the -m PEM option seemed to do the trick. Maybe when 1.7 is officially released I’ll use the JULIA_PKG_USE_CLI_GIT=true option.

1 Like