selects Teletype frontend on non-ttys

Bug #130519 reported by Fabien Tassin on 2007-08-05
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
debconf (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: debconf

Since July 17th, Gutsy's debconf complain when apt-get is run within a script:

# /usr/bin/apt-get -q -y -u upgrade
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  apt apt-utils binutils dhcp3-client dhcp3-common dpkg dpkg-dev e2fslibs
  e2fsprogs gcc-4.2-base libblkid1 libc6 libc6-dev libc6-i686 libcomerr2
  libcurl3-gnutls libdevmapper1.02.1 libgcc1 libss2 libstdc++6 libuuid1
  libvolume-id0 linux-libc-dev perl perl-base perl-modules python2.5
  python2.5-minimal udev vim-common vim-tiny volumeid
32 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 4258kB/28.3MB of archives.
After unpacking 20.5kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com gutsy/main python2.5 2.5.1-1ubuntu4 [3090kB]
Get:2 http://archive.ubuntu.com gutsy/main python2.5-minimal 2.5.1-1ubuntu4 [1168kB]
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:
Fetched 4258kB in 0s (9401kB/s)
(Reading database ... 12243 files and directories currently installed.)
Preparing to replace dpkg 1.14.4+svn20070602r802-0ubuntu3 (using .../dpkg_1.14.5ubuntu1_i386.deb) ...
Unpacking replacement dpkg ...
Setting up dpkg (1.14.5ubuntu1) ...

It worked up to July 17th, now it's broken.
100% reproducible.

Colin Watson (cjwatson) wrote :

What does 'echo $TERM' say?

        elsif ($ENV{TERM} eq 'dumb' || $ENV{TERM} eq 'unknown') {
                die gettext("Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.")."\n";
        }

What terminal emulator are you running?

Changed in debconf:
assignee: nobody → kamion
status: New → Incomplete
Colin Watson (cjwatson) wrote :

Hmm, no, never mind, I think it might be this change:

r2183 | joeyh | 2006-12-20 18:53:36 +0000 (Wed, 20 Dec 2006) | 4 lines

* Add need_tty field to frontend objects. dpkg-preconfigure can test
  this if it fails to reopen /dev/tty, and avoid dying if the frontend
  doesn't care about the tty, as happens in g-i when preconfiguring using
  the passthrough frontend. Closes: #401876

I think the bug here is that debconf selects the Teletype frontend for you; it should really select Noninteractive instead.

I still think something else must have changed in your environment on July 17th, since this change has been in debconf since before 7.04, but never mind ...

Changed in debconf:
status: Incomplete → Triaged
Adam Thompson (athompson) wrote :

Oddly enough, this works on my Mythbuntu (gutsy) system at home, but breaks on my Ubuntu (gutsy) system at work. Obviously those two environments are completely different, lending credence to the belief that it's dependant on something local to the system.
I see this all the time from inside Update Manager, where it's rather impossible to run commands in the terminal window to find out $TERM, etc...
Running debconf-preconfigure from a terminal does seem to work properly, regardless, so I presume it's something to do with having its I/O redirected...?

Tom_OConnor (tom-twinhelix) wrote :

I get this within hardy also.
When running apt-get install foo from within a SSH connection to a headless server
debconf: Unable to initialise frontend: Dialog
debconf: (TERM is not set so the dialogue frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: Unable to initialise frontend: Readline
debconf: (This frontend requires a controlling tty.)

Feanor's Curse (suepke) wrote :

Same here, on a hardy vServer. Updates are done automatically via a cronjob, but print out the debconf error messages.

Kent Tong (kent-tong) wrote :

Same problem with Ubuntu 8.04.3 LTS.

Feanor's Curse (suepke) wrote :

Possible workaround:
I added the following to the update-script:
  export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
  export TERM=linux

This seems to be working, but to confirm, I'll have to wait for another update.

I solved this by installing 'dialog' as recommended here: http://forum.doozan.com/read.php?2,502,502,quote=1

I still don't really understand the error message, so I'm not sure if I should not be doing what I'm doing, but at least it's silent now. ;)

In my case, I'm running apt-get remotely from a deployment script (Fabric), so I definitely can't interact with it. I'm (totally not) looking forward to finding out what happens the first time apt-get expects input from me during the process... :(

I take that back, it doesn't make a difference, the messages are still there.

They just only appear if there are actually packages to update, that's why I mistakenly thought it was fixed.

Colin Watson (cjwatson) on 2011-02-16
Changed in debconf (Ubuntu):
assignee: Colin Watson (cjwatson) → nobody
eixmg (ei-xmg) wrote :

In my terminal i noticed:

debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline

what does it mean? 0_o

Trevor Robinson (scurrilous) wrote :

My workaround is to prepend DEBIAN_FRONTEND=noninteractive to the apt-get command line when calling it from ssh.

I don't really know what that does, but DEBIAN_FRONTEND=noninteractive seems to get rid of the warnings and that's exactly what I was looking for. ;)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers