JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.43k stars 5.46k forks source link

Package manager hangs on git operations that require a password #1630

Closed toivoh closed 11 years ago

toivoh commented 11 years ago

Operations in the Pkg module that perform git operations that require a password seem to hang consistently for me on this computer (Fedora 16), and I have to interrupt them with ctrl-C.

For instance,

julia> Pkg.update()
^C
 in cd at file.jl:181
 in update at /work/toivo/program/julia2/base/pkg.jl:349

To compare, if I try to pull from my METADATA fork manually, it asks for a password:

> pwd
/home/toivo/.julia/METADATA
> git pull
Enter passphrase for key '/home/toivo/.ssh/rata/id_rsa': 
Already up-to-date.

I guess that Pkg.update() gets stuck on the password question, that doesn't get through to the user?

StefanKarpinski commented 11 years ago

Ah, this hadn't occurred to me since I use an ssh agent consistently. I could maybe have Julia automatically start an ssh agent and use it. In the mean time, if you can start your own ssh agent, you'll be much happier with life in general. I never enter passwords to ssh anywhere :-)

toivoh commented 11 years ago

Thanks for the tip :) I'll try it.

JeffBezanson commented 11 years ago

Pkg.update used to work for me, now I get this:

julia> Pkg.update()
Already up-to-date.
Username for 'https://github.com': 
^C
 in wait at process.jl:126
 in wait at process.jl:626
 in success at process.jl:660
 in run at process.jl:661
 in anonymous at no file:351
 in cd at file.jl:176
 in anonymous at no file:349
 in anonymous at no file:37
 in cd at file.jl:176
 in each_submodule at /home/jeff/src/julia2/julia/base/git.jl:36
 in anonymous at no file:348
 in cd at file.jl:176
 in update at /home/jeff/src/julia2/julia/base/pkg.jl:347

It hangs and I ^C'd it. A couple things might have changed in my setup; I was added to Winston.jl and I have a couple packages on master in the "working on it" state.

StefanKarpinski commented 11 years ago

It's trying to use the https:// protocol which requires a username. It should use the git:// protocol and I'm unsure why it would switch. Can you send me a tarball of your .julia directory?

JeffBezanson commented 11 years ago

Ah, it's the MCMC package. It's the only one with an https url.

StefanKarpinski commented 11 years ago

Fixed in METADATA. Adding and removing it should fix the problem.

JeffBezanson commented 11 years ago

Now I get this:

julia> Pkg.rm("MCMC")
could not open file METADATA/ArgParse/hashes/c80e6d2a479844a3f8cdd75142cb4db8e788c25a
 in open at io.jl:261
 in open at io.jl:281
 in version at /home/jeff/src/julia2/julia/base/pkgmetadata.jl:39
 in _resolve at /home/jeff/src/julia2/julia/base/pkg.jl:167
 in anonymous at no file:110
 in cd at file.jl:176
 in rm at /home/jeff/src/julia2/julia/base/pkg.jl:88
 in rm at /home/jeff/src/julia2/julia/base/pkg.jl:112

MCMC doesn't even use ArgParse.

StefanKarpinski commented 11 years ago

Sorry about that. That should be fixed by running Pkg.Metadata.gen_hashes().

JeffBezanson commented 11 years ago

Oh dear:

julia> Pkg.Metadata.gen_hashes()
fatal: Not a git repository: 'METADATA/.git'
StefanKarpinski commented 11 years ago

Bah. You need to be in the right place for that to work. Just pull and try again. I pushed a fix.

JeffBezanson commented 11 years ago

Nice, that is helpful.

You know what's coming...

julia> Pkg.rm("MCMC")
Upgrading ArgParse: v0.0.0 => v0.0.0
Upgrading DataFrames: v0.0.0 => v0.0.0
Upgrading ICU: v0.0.0 => v0.0.0
Removing MCMC v0.0.0
Removing OpenLib v0.0.0
Upgrading RDatasets: v0.0.0 => v0.0.0
fatal: reference is not a tree: 1ebe03c4215e2d4d58cd1ffdf58b0d20a645e823
failed process: `git checkout -q 1ebe03c4215e2d4d58cd1ffdf58b0d20a645e823` [ProcessExited(128)]
 in run at process.jl:661
 in anonymous at no file:177
 in cd at file.jl:176
 in _resolve at /home/jeff/src/julia2/julia/base/pkg.jl:176
 in anonymous at no file:120
 in cd at file.jl:176
 in cd_pkgdir at /home/jeff/src/julia2/julia/base/pkg.jl:24
 in rm at /home/jeff/src/julia2/julia/base/pkg.jl:98
 in rm at /home/jeff/src/julia2/julia/base/pkg.jl:122
StefanKarpinski commented 11 years ago

Jesus. Ok, please send me a tarball of your .julia directory. I think several other people have had this and I'm now going to sit down and make sure it never happens again.

vtjnash commented 11 years ago

i think you should be able to type a password when prompted now, stdin is being passed to the child process