Package: dbconfig-common Version: 1.8.46+squeeze.0 Severity: normal When uninstalling packages using dbconfig-common and "maintainer removal code" (SQL data, no script) described in section "3.2.6. Packages that require extra logic during removal", I am not asked for the dbadmin password.
It looks like this (using DEBIAN_FRONTEND=readline for easier quoting;
normally I use dialog):
| # dpkg -P dbconfig-test
| (Reading database ... 27015 files and directories currently installed.)
| Removing dbconfig-test ...
| Configuring dbconfig-test
| -------------------------
|
| Since you are removing dbconfig-test, it's possible that you no longer want
the
| underlying database.
|
| If you like, database removal can be handled with dbconfig-common.
|
| If you know that you do want to keep this database, or if you want to handle
the
| removal of this database manually, you should refuse this option.
|
| Deconfigure database for dbconfig-test with dbconfig-common? y
|
|
| running maintainer removal sql hook... error encountered running maintainer
removal sql hook:
| mysql said: ERROR 1045 (28000): Access denied for user 'root'@'localhost'
(using password: NO)
| An error occurred while removing the database:
|
| mysql said: ERROR 1045 (28000): Access denied for user 'root'@'localhost'
(using
| password: NO)
|
| For some reason it was not possible to perform some of the actions necessary
to
| remove the database for dbconfig-test. At this point you have two options:
you
| can find out what has caused this error and fix it, or you can refuse the
offer
| for help removing the database (the latter implies you will have to remove the
| database manually).
|
| If at this point you choose "retry", you will be prompted with all the
| configuration questions once more and another attempt will be made at
performing
| the operation. "retry (skip questions)" will immediately attempt the operation
| again, skipping all questions. If you choose "abort", the operation will fail
| and you will need to downgrade, reinstall, reconfigure this package, or
| otherwise manually intervene to continue using it.
|
| 1. abort 2. retry
|
| Next step for database removal:
As far as I can see in the debug output ("set -x" in
/usr/share/dbconfig-common/dpkg/common), dbconfig-common notices it will
need to ask. I believe the "maintainer removal code" is just run too
early.
| + echo mysql pgsql
| + need_admin_pw=yup
| + [ remove = remove ]
When I delete the removal code from my test package, I get asked for the
password again.
Other things I tried to get the removal code running:
* set the debconf priority to low
* update to dbconfig-common (1.8.47+nmu1) from wheezy/sid
In both cases dbconfig-common ran into the problem above and did not ask
for the dbadmin password.
* set dbconfig-common/remember-admin-pass: true and reinstall the
package
I got asked for the password on installation, but still got the "Access
denied" message on removal of the package. The password shows up in
/var/cache/debconf/passwords.dat, but is apparrently not used for the
removal code.
I will add a simple package source code to reproduce the problem.
Christoph
-- System Information:
Debian Release: 6.0.7
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages dbconfig-common depends on:
ii debconf [debconf-2.0] 1.5.36.1 Debian configuration management sy
ii ucf 3.0025+nmu1 Update Configuration File: preserv
dbconfig-common recommends no packages.
Versions of packages dbconfig-common suggests:
ii mysql-client-5.1 [virt 5.1.66-0+squeeze1 MySQL database client binaries
ii postgresql-client 8.4.17-0squeeze1 front-end programs for PostgreSQL
ii postgresql-client-8.4 8.4.17-0squeeze1 front-end programs for PostgreSQL
-- debconf information:
dbconfig-common/remote-questions-default: false
dbconfig-common/db/basepath:
dbconfig-common/pgsql/revertconf: false
dbconfig-common/install-error: abort
dbconfig-common/pgsql/no-empty-passwords:
dbconfig-common/pgsql/admin-user: postgres
dbconfig-common/dbconfig-install: true
dbconfig-common/internal/skip-preseed: false
dbconfig-common/db/dbname:
dbconfig-common/dbconfig-reinstall: false
dbconfig-common/remote/host:
dbconfig-common/pgsql/manualconf:
dbconfig-common/pgsql/changeconf: false
dbconfig-common/remote/newhost:
dbconfig-common/dbconfig-remove: true
dbconfig-common/missing-db-package-error: abort
dbconfig-common/dbconfig-upgrade: true
dbconfig-common/mysql/method: unix socket
dbconfig-common/pgsql/no-user-choose-other-method:
dbconfig-common/upgrade-backup: true
dbconfig-common/internal/reconfiguring: false
dbconfig-common/passwords-do-not-match:
dbconfig-common/pgsql/authmethod-admin: ident
dbconfig-common/remove-error: abort
dbconfig-common/remember-admin-pass: false
dbconfig-common/mysql/admin-user: root
dbconfig-common/pgsql/method: unix socket
dbconfig-common/pgsql/authmethod-user:
dbconfig-common/upgrade-error: abort
dbconfig-common/database-type:
dbconfig-common/db/app-user:
dbconfig-common/remote/port:
dbconfig-common/purge: false
dbconfig-test.tar.gz
Description: GNU Zip compressed data
dbc_set_dbtype_defaults() mysql. + printf dbc_set_dbtype_defaults() mysql.\n + [ mysql ] + dbc_dbtype=mysql + dbc_default_basepath= + dbc_db_installed_cmd=dbc_mysql_db_installed + . /usr/share/dbconfig-common/internal/mysql + . /usr/share/dbconfig-common/internal/common + [ /var/log/dbconfig-common/dbc.log ] + dbc_createuser_cmd=dbc_mysql_createuser + dbc_checkuser_cmd=dbc_mysql_check_user + dbc_createdb_cmd=dbc_mysql_createdb + dbc_dropdb_cmd=dbc_mysql_dropdb + dbc_dropuser_cmd=dbc_mysql_dropuser + dbc_sqlexec_cmd=dbc_mysql_exec_command + dbc_sqlfile_cmd=dbc_mysql_exec_file + dbc_dump_cmd=dbc_mysql_dump + dbc_register_templates=database-type dbconfig-install dbconfig-upgrade dbconfig-remove dbconfig-reinstall password-confirm app-password-confirm purge upgrade-backup passwords-do-not-match install-error upgrade-error remove-error internal/reconfiguring internal/skip-preseed missing-db-package-error mysql/method remote/host remote/newhost mysql/app-pass mysql/admin-user mysql/admin-pass remote/port db/dbname db/app-user + dbc_default_admin=root + cut -c -16 + tr -d +. + echo dbconfig-test + dbc_default_dbuser=dbconfig-test + dbc_dbvendor=MySQL + dbc_dbpackage=mysql-server + dbc_dbclientpackage=mysql-client + [ ] + grep -q mysql + echo mysql pgsql + need_admin_pw=yup + [ remove = remove ] + [ true != true ] + [ ] + db_fset dbconfig-test/dbconfig-remove seen false + _db_cmd FSET dbconfig-test/dbconfig-remove seen false + IFS= printf %s\n FSET dbconfig-test/dbconfig-remove seen false + IFS= read -r _db_internal_line + RET=false + return 0 + db_input high dbconfig-test/dbconfig-remove + _db_cmd INPUT high dbconfig-test/dbconfig-remove + IFS= printf %s\n INPUT high dbconfig-test/dbconfig-remove + IFS= read -r _db_internal_line + RET=question will be asked + return 0 + db_go + _db_cmd GO + IFS= printf %s\n GO + IFS= read -r _db_internal_line [Rückfrage, ob man die DB entfernen will] + RET=ok + return 0 + db_get dbconfig-test/dbconfig-remove + _db_cmd GET dbconfig-test/dbconfig-remove + IFS= printf %s\n GET dbconfig-test/dbconfig-remove + IFS= read -r _db_internal_line + RET=true + return 0 + dbc_remove=true + [ true != true ] + rmscript=/usr/share/dbconfig-common/scripts/dbconfig-test/remove/mysql + rmsql=/usr/share/dbconfig-common/data/dbconfig-test/remove/mysql + [ -f /usr/share/dbconfig-common/scripts/dbconfig-test/remove/mysql ] + [ -f /usr/share/dbconfig-common/data/dbconfig-test/remove/mysql ] + dbc_logpart running maintainer removal sql hook... + printf running maintainer removal sql hook... running maintainer removal sql hook... + printf running maintainer removal sql hook... + [ ! ] + dbc_mysql_exec_file /usr/share/dbconfig-common/data/dbconfig-test/remove/mysql + local l_sqlfile l_retval l_error l_dbname l_errfile + l_sqlfile=/usr/share/dbconfig-common/data/dbconfig-test/remove/mysql + dbc_mktemp dbconfig-common_sql_exec_error.XXXXXX + local tfile ttemplate + [ dbconfig-common_sql_exec_error.XXXXXX ] + ttemplate=dbconfig-common_sql_exec_error.XXXXXX + mktemp -t dbconfig-common_sql_exec_error.XXXXXX + tfile=/tmp/dbconfig-common_sql_exec_error.wkXdb0 + [ ! -f /tmp/dbconfig-common_sql_exec_error.wkXdb0 ] + echo /tmp/dbconfig-common_sql_exec_error.wkXdb0 + l_errfile=/tmp/dbconfig-common_sql_exec_error.wkXdb0 + l_retval=0 + [ ! /usr/share/dbconfig-common/data/dbconfig-test/remove/mysql ] + [ ! -f /usr/share/dbconfig-common/data/dbconfig-test/remove/mysql ] + l_dbname= + [ ! ] + l_dbname=wlan_control + _dbc_generate_mycnf + local mycnf l_date + dbc_mktemp dbconfig-common_my.cnf.XXXXXX + local tfile ttemplate + [ dbconfig-common_my.cnf.XXXXXX ] + ttemplate=dbconfig-common_my.cnf.XXXXXX + mktemp -t dbconfig-common_my.cnf.XXXXXX + tfile=/tmp/dbconfig-common_my.cnf.PlP56F + [ ! -f /tmp/dbconfig-common_my.cnf.PlP56F ] + echo /tmp/dbconfig-common_my.cnf.PlP56F + mycnf=/tmp/dbconfig-common_my.cnf.PlP56F + date + l_date=Wed Apr 10 15:20:02 CEST 2013 + cat + echo /tmp/dbconfig-common_my.cnf.PlP56F + mycnf=/tmp/dbconfig-common_my.cnf.PlP56F + echo /tmp/dbconfig-common_my.cnf.PlP56F + mycnf=/tmp/dbconfig-common_my.cnf.PlP56F + mysql --defaults-extra-file=/tmp/dbconfig-common_my.cnf.PlP56F wlan_control + l_retval=1 + cat /tmp/dbconfig-common_sql_exec_error.wkXdb0 + dbc_error=mysql said: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) + rm -f /tmp/dbconfig-common_my.cnf.PlP56F /tmp/dbconfig-common_sql_exec_error.wkXdb0 + return 1

