Debian Bug report logs - #487300
debconf: purging a package doesn't always purge the template space if d-s-s is run after package installation

version graph

Package: debconf; Maintainer for debconf is Debconf Developers <[email protected]>; Source for debconf is src:debconf (PTS, buildd, popcon).

Reported by: Bryan McLellan <[email protected]>

Date: Fri, 20 Jun 2008 21:12:01 UTC

Severity: minor

Tags: patch

Found in versions debconf/1.5.11etch1, debconf/1.5.59

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#487300; Package debconf. (full text, mbox, link).


Acknowledgement sent to Bryan McLellan <[email protected]>:
New Bug report received and forwarded. Copy sent to Debconf Developers <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Bryan McLellan <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: debconf: purging a package doesn't always purge the template space if d-s-s is run after package installation
Date: Fri, 20 Jun 2008 14:42:06 -0700
Package: debconf
Version: 1.5.11etch1
Severity: minor


While trying to preseed ocsinventory-server_1.01-5_all to use a remote mysql server I found under certain circumstances I would receive:

  error: Cannot find a question for ocsinventory-server/mysql/admin-pass

Shortest steps to reproduce seem to be:
  installing the package, using dbconfig-common but letting it fail, choose ignore.
  run debconf-set-selections against a seed file
  purge the package
  trying to run debconf-set-selections again produces the above error

Running '/usr/share/debconf/fix_db.pl' will correct the problem and produces:
  debconf: template "ocsinventory-server/mysql/admin-pass" claims to be used by nonexistant question "ocsinventory-server/mysql/admin-pass"; removing 
that.

If debconf-set-selections is run before package installation rather than after, the problem doesn't appear.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages debconf depends on:
ii  debconf-i18n                1.5.11etch1  full internationalization support 
ii  perl-base                   5.8.8-7etch3 The Pathologically Eclectic Rubbis

Versions of packages debconf recommends:
ii  apt-utils                   0.6.46.4-0.1 APT utility programs

-- debconf information:
  debconf-apt-progress/preparing:
  debconf-apt-progress/title:
  debconf-apt-progress/info:
  debconf-apt-progress/media-change:
* debconf/frontend: Dialog
* debconf/priority: high

-- partial debconf_debug on dpkg -P package
debconf (developer): <-- UNREGISTER ocsinventory-server/mysql/admin-pass
debconf (db configdb): trying to getfield(ocsinventory-server/mysql/admin-pass template) ..
debconf (db config): cache miss on ocsinventory-server/mysql/admin-pass
debconf (db configdb): getfield done by passwords
debconf (db configdb): trying to removeowner(ocsinventory-server/mysql/admin-pass ocsinventory-server) ..
debconf (db configdb): passing to passwords ..
debconf (developer): --> 0




Information forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#487300; Package debconf. (Wed, 16 Nov 2016 22:00:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vaclav Ovsik <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <[email protected]>. (Wed, 16 Nov 2016 22:00:03 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Vaclav Ovsik <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: debconf: preseeding values for questions with template of other name (from dbconfig-common)
Date: Wed, 16 Nov 2016 22:56:30 +0100
Package: debconf
Version: 1.5.59
Followup-For: Bug #487300

I work on scripts for unattended installing OpenStack instance for
testing (work-in-progress) and I use debconf preseeding using
debconf-set-selections.
https://anonscm.debian.org/cgit/users/zito-guest/setup-openstack.git/
Packages use dbconfig-common for database setup. The first such package
in sequence is keystone in script os-controller-install.
Before installing keystone I feed debconf-set-selections with e.g.

  keystone        keystone/database-type          select  mysql

this creates following record in config.dat file

  Name: keystone/database-type
  Template: keystone/database-type
  Value: mysql
  Owners: keystone
  Flags: seen

and record in templates.dat file:

  Name: keystone/database-type
  Description: Dummy template
  Extended_description: This is a fake template used to pre-seed the debconf database. If you are seeing this, something is probably wrong.
  Type: select
  Owners: keystone/database-type


After installing keystone, records are transformed into:

config.dat contains:

  Name: keystone/database-type
  Template: dbconfig-common/database-type
  Value: mysql
  Owners: keystone
  Flags: seen
  Variables:
   database_types = sqlite3, mysql
   dbvendor = MySQL
   pkg = keystone
  
templates.dat contains:

  Name: dbconfig-common/database-type
  Choices: ${database_types}
  Description: Database type to be used by ${pkg}:
  ...
  Type: select 
  Owners: dbconfig-common/database-type, keystone/database-type 


So far so good, But because some values are removed from debconf database by
postinst maintainer script (e.g. password of database admin) I need to preseed
some values with keystone installed again so I can do unattended package
removal. This second preseeding doesn't affect record in config.dat
(because value is the same), but debconf-set-selections creates one more
time "Dummy template". After purging the package keystone, this dummy
value left in templates db.

This dummy template (orphaned) now breaks the next try to preseed values
again, because debconf-set-selections fails:

  error: Cannot find a question for keystone/database-type

Dummy template must be removed, to preseed values again.
Hope this helps a bit.
Cheers
-- 
Zito



Information forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#487300; Package debconf. (Tue, 06 Aug 2019 06:12:19 GMT) (full text, mbox, link).


Acknowledgement sent to Sunil Mohan Adapa <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <[email protected]>. (Tue, 06 Aug 2019 06:12:19 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Sunil Mohan Adapa <[email protected]>
To: [email protected]
Subject: Re: debconf: preseeding values for questions with template of other name (from dbconfig-common)
Date: Mon, 5 Aug 2019 22:58:16 -0700
[Message part 1 (text/plain, inline)]
Hello,

In the context of FreedomBox, we are also seeing this problem. This time
it is with the tt-rss package. To reproduce:

# apt install tt-rss
# echo 'tt-rss tt-rss/database-type string pgsql' | debconf-set-selections
# apt purge tt-rss
# echo 'tt-rss tt-rss/database-type string pgsql' | debconf-set-selections
error: Cannot find a question for tt-rss/database-type

Running /usr/share/debconf/fix_db.pl corrects the problem

Thanks,

-- 
Sunil

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to [email protected], Debconf Developers <[email protected]>:
Bug#487300; Package debconf. (Fri, 23 Aug 2019 04:48:06 GMT) (full text, mbox, link).


Acknowledgement sent to Sunil Mohan Adapa <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debconf Developers <[email protected]>. (Fri, 23 Aug 2019 04:48:06 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Sunil Mohan Adapa <[email protected]>
To: [email protected], Debconf Developers <[email protected]>
Cc: Colin Watson <[email protected]>
Subject: Re: debconf: preseeding values for questions with template of other name (from dbconfig-common)
Date: Thu, 22 Aug 2019 21:44:39 -0700
[Message part 1 (text/plain, inline)]
Hello,

This bug due to an assumption that template name would be the same as
the question name in debconf-set-selections. The database get corrupted
as a result requiring the run of fix_db.pl.

The attached patch fixes the problem and ensures that database does not
get corrupted. Please consider applying the patch.

Thank you,

-- 
Sunil
[0001-Fix-setting-answers-when-template-name-is-not-same-a.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, attachment)]

Added tag(s) patch. Request was from Sunil Mohan Adapa <[email protected]> to [email protected]. (Fri, 23 Aug 2019 05:00:03 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Fri May 16 09:32:16 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.