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
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).
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
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).
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
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).
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
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/.