sudo hangs when localhost can not be resolved

Bug #234879 reported by PowerUser
14
Affects Status Importance Assigned to Milestone
sudo (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

What has been done?
 1) Ubuntu x64 8.04 (desktop version from live CD) has been installed with almost default settings to 20Gb JFS partition.
 No network was available during install.
 2) Network has been configured.
 3) System->Administration->Update Manager launched and I'm attempted to perform system update.

What happened?
 Update Manager has hanged at point where it must request user's password to gain root rights so it can proceed.
 Actually, gksu has hanged.Update Manager resumed operation when gksu has been killed with task manager.Actually looks like one of these nasty gksu deadlocks.

Extra steps:
 When Update Manager resumed operation, system has been updated and rebooted (as requested by updater).
 Then I'd attempted to use Update Manager again.And it again hanged due to same issue aka gksu hanged invisible, no enter password dialog appeared.Looks like gksu fails to display dialog or it's invisible and Update Manager have to wait forever since it is impossible to enter user's password anyway.

Tags: gksu hang
PowerUser (i-am-sergey)
description: updated
description: updated
Revision history for this message
Paul Harriman (paul-harriman4) wrote :

Ubuntu Studio on a Sony PCG-GRT815M upgraded from earlier versions (at least 2 major upgrades)

in 8.04 I am having this same problem. However, I found that as a workaround, killing the sudo process and trying to perform the update again got the password prompt.

Today, after applying kernel patches etc from yesterday (27 May 2008) batch, now that workaround isn't working either.

trying to start update manager from a root shell gives "cannot connect to display". Which is fair enough I guess.

It looks to me like Synaptic is broken, I can't even start Synaptic in the administration window, it hangs too. and trying to start it in a shell gives "cannot open display"

I suppose I can work around this with playing with X but it might be helpful to check this. thanks

Revision history for this message
Paul Harriman (paul-harriman4) wrote :

Sorry, one last comment.

apt-get upgrade from a root window works fine. So I can workaround this problem.

Revision history for this message
Gary Beebe (beebe-gary) wrote : same here.

Same thing here. I get "Starting Administrative Application" in the window list, which I presume is the window that asks for a password, but that goes away leaving me hanging with a frozen update manager window. If I open a terminal and SU, I can then type update-manager and it'll work fine, it's just annoying... This is also a problem with the Package Manager.

Revision history for this message
Jacob Fugal (lukfugl) wrote : Re: Update manager could hang when user wants to perform update

I've also experienced this bug for a few months now (both in gutsy and hardy). FWIW, it appears to be independent of the update-manager; I've run into the hang (which does not always occur) with various applications using gksu to enable administrative access. This is a bug with gksu, not with the update-manager. The fact that update-manager might be able to detect the hang and report an error is something that might be addressed here, though.

Revision history for this message
Michael Wilson (mwilsonemt) wrote :

I am now experiencing similar problems, but I can not update from terminal either. I have killed gsku and was able to close Update Manager, but I still can't update.

Revision history for this message
Joel Murphy (joel-murphy) wrote :

Both Update Manager and Add/Remove Applications were doing the same thing to me.

The problem (and solution) was in /etc/hosts. You'll find a line:
127.0.1.1 <hostname>.<domain>

Either remove the domain or add a space and a second hostname to the end, like this:
127.0.1.1 <hostname>.<domain> <hostname>

Revision history for this message
Joe Duffus (joeduffus) wrote : Re: Update manager hangs when localhost can not be resolved

Thanks Joel. Your solution worked perfectly for me. I was seeing the hang on update manager as well as a prompt when executing a command in the terminal saying "Could not resolve host *******".

I think this occurred because after installation and the initial configuration I added the domain name to Ubuntu in the network setup program on the General tab. That change didn't get added to the hosts file.

Revision history for this message
barbed_saber (harryallington) wrote :

I think I have the same problem (then again, I may have miss-understood it entirely)
Whenever anything gksudo comes up, it just hangs. Normal sudo takes ages (type command, wait wait wait, host could not be resolved, enter password) I have to do everything from the command line, and it takes ages to wait for the password prompt. The host could not be resolved, because I changed my computer name after setup.

Revision history for this message
Martin Pitt (pitti) wrote :

This sounds very similar to bug 32906, but this was fixed in hardy (8.04).

I cannot reproduce this at all, if I remove "localhost" and my hostname from /etc/hosts, both sudo and gksu still work fine.

To debug this on your side: do you also get the hang if you run "sudo" in a root terminal? I. e. do

  sudo -i
  [ wait until you have a root prompt ]
  sudo id

The second sudo shouldn't ask you for a password, but just print "uid=0(root) ...". Does it hang? Does it give you any error message? If it hangs, please do (in that root shell)

  strace -o /tmp/sudo.trace sudo true

and attach /tmp/sudo.trace here.

Changed in sudo:
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Sorry, please make that

  strace -tt -o /tmp/sudo.trace sudo true

to include timestamps into the log. Also, please give the output of

  hostname

and attach your /etc/hosts.

Revision history for this message
Martin Pitt (pitti) wrote :

Also, do you have sudo version 1.6.9p10-1ubuntu3.3? This bug was fixed in 8.04 in a post-release update.

Revision history for this message
Victor Vargas (kamus) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in sudo (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.