-
Notifications
You must be signed in to change notification settings - Fork 74
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
Failure to install packages with "sudo: no tty present and no askpass program specified" error #199
Comments
Hi Mark, I got the same problem when Pkg.add("HDF5"). Could you please give more details about how "manually install the packages" ? Thank you. |
|
Yichao, thanks for the quick reply. Here is the following problem. I found hdf5 was actually installed along with my anaconda, so I include the following command in .juliarc.jl push!(Libdl.DL_LOAD_PATH, "/home/zhenpan/code/anaconda2/pkgs/hdf5-1.8.15.1-2/lib") then Pkg.build("HDF5") signal (15): Terminated Did I point julia to a wrong lib path? |
The error suggests that you havent add HDF5 yet |
Thanks, Yichao. Problem fixed. After sudo apt-get install hdf5-tools and point julia to the system-wide hdf5 lib, and Pkg.build("HDF5") it works (though with another error in building Blosc, which was solved by Jingpeng [https://github.com/JuliaIO/HDF5.jl/issues/234] ) |
I'm seeing the same sudo error here on both 0.4.7 and master. Looks like it's not attached to the Julia terminal as it should, and therefore cannot ask for password. EDIT: I'm on Fedora 24, so this isn't specific to EDIT2: |
It looks like the problem happens with
|
Your analysis looks correct. This is a likely unintended side-effect of the fix for JuliaLang/julia#13458 We now have functionality to securely ask for passwords on all platforms (I think, see here and related links), so prompting could potentially be done by Julia. However, this would require some architectural changes, and Pkg is being redesigned right now anyway. For now the best option is probably to run installers manually before calling cc @StefanKarpinski -- not sure if this should go to the main Julia repo or the Pkg dev planner. |
We could also use PackageKit (#66). |
The problem is that detach no longer sets the controlling terminal. Blame @vtjnash ;) |
FWIW, this was the intended effect. Our build slave should never become the controlling terminal master. Probably not a bad thing to prevent usage of |
Surely breaking BinDeps was not the intended effect. I also don't see what's wrong with passing the controlling terminal through to apt. |
So, do I get this right, that the current fix is to install things manually? |
If someone can propose a fix we can try it. No one is actively working on this right now to my knowledge. I have plans to entirely replace bindeps in a way that doesn't rely on sudo or system package managers at all (at user Julia-package install time), but will certainly review any proposed changes here and try to keep it at least not getting any worse until a replacement is ready and widely usable (which is still a ways out). |
So I was getting it to work by starting julia with sudo and passing -y to the apt-get command.... That'd be a bit better, but I heard people don't like either of these to be a default in a binary dependency installation... |
No, starting julia with sudo is a bad idea. |
is there a way to figure out if we have the tty/askpass available, and if not replace the sudo command with an instruction? |
The right solution is to pass through the controlling terminal as mentioned above. |
never / not not supposed to be possible
no. we called However, we could open a pseudo-tty pair (or use |
We called detach before that stopped giving it a controlling terminal. What would be the purpose of doing this other than breaking people's installation of packages. |
The problem is you won't get it back. When |
Are you sure that's not a process-group related problem rather than a controlling terminal problem? |
Yes. They get SIGPIPE not SIGHUP. |
Can you elaborate by what mechanism you think this happens? |
Certainly apt can't kill all processes with the same controlling terminal, because otherwise you couldn't use it from bash. |
by watching it happen in the debugger, and wondering why the whole process was crashing down without printing any error messages (because it couldn't - stderr was closed). |
you can argue with the lawyer-ees all you will, but #199 (comment) |
Ok, so your claim is that when a session leader exits, all file descriptors associated with that session leader's controlling terminal thereafter produce SIGPIPE? |
Yes, that it what happened. |
Also, the user loses the ability to interrupt or signal the host process (the REPL) via the keyboard as soon as the controlling terminal is lost. |
Sorry, made a mistake, hold on. |
Actually, I'm confused. The terminal should already be the controlling terminal of some other process group. Why did it used to get stolen at all? |
It didn't, except for a couple of months on master. There was a libuv bug I accidentally didn't prevent from becoming a Julia bug when moving from v0.9 -> v1.7 (I was aware of it before then, which is why it wasn't a bug in our fork of v0.9, but mistakenly thought I could drop the revert commit during the rebase). |
Ok, but this worked at some point after we started detaching, but before we stopped setting ctty, so somehow it got a controlling terminal. |
Also, I'm not sure what you're end goal is here. That we should badly emulate the effect of not calling |
Yes, that's when / how I noticed the libuv bug had been introduced to master. |
The goal is for sudo to be able to get at the controlling terminal so it can ask the user for a password. |
I don't understand this mechanism though. Why was that terminal not already associated with a process group? |
If that's the goal, then Pkg.build needs to stop being the daemon it was implemented to be (JuliaLang/julia#13506). Daemon's aren't supposed to be the controlling leader, or they wouldn't be daemons. |
I thought somebody had good reasons for putting detach there. If not, then yes, it should be removed. |
I don't understand the question. It was associated with the process leader (Julia). The detached child process (libuv) was explicitly taking steps to ensure that it would steal the process leader away from its parent. |
ctty stealing is not allowed unless you're root on linux. |
While you're writing your fancy C programs, I would perhaps be remiss if I failed to point out that the original submitter of the bug report noting the breakage caused by libuv was a guy named loladiro (JuliaLang/julia#16398). 😉 |
That's under lldb IIRC |
In reading through this thread again I find myself very confused. Is this affecting all binary dependencies on Ubuntu? How is, for example, Gtk.jl, successfully installed via its build.jl script (it's clear that it is)? I've tried to port my package to linux but have run into this problem. (Granted I am doing so via a VirtualBox install of Ubuntu, so maybe there is something specific to my environment that I'm running into...??). |
PkgEval gets around this by setting apt-get to always install things without bothering to ask for confirmation: https://github.com/JuliaCI/PackageEvaluator.jl/blob/60823fb6eebc69830368aa2a8ea6c84b26722695/scripts/setup.sh#L19-L27 |
Got it! Thanks, that makes more sense. |
I'm consistently getting this error on travis, but only on Linux. It was working fine five days ago. I don't think I've made any change to my package that would affect this. Did anything else change? |
@cstjean I think your issue is unrelated. the passed build is on precise the failed build is on trusty which is the container-based runner. IIRC, |
I've run into an odd problem with building packages with apt dependencies, in which the password prompt for the sudo apt-get fails. At the moment a simple workaround is just installing the packages manually, but I'm posting what I've got in case you guys can see an easy fix.
The problem occurs on Lubuntu 15.10, when running julia 0.4.2 (staticfloat ppa release) from a local LXterminal session. I've observed it on Cairo.jl (_jl_libcairo error with Gadfly + Cairo #124 ) and HDF5.jl (see code block following).
Hope that's of some use. Let me know if you need any more logs etc. -- I know Lubuntu isn't a very common distro! Thanks.
The text was updated successfully, but these errors were encountered: