noninteractive install fails: "No database user specified."

Bug #560144 reported by shake.chen
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
postfix-policyd (Debian)
Fix Released
Unknown
postfix-policyd (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Binary package hint: postfix-policyd-spf-perl

in Ubuntu 10.04 beta2,
# lsb_release -rd
Description: Ubuntu lucid (development branch)
Release: 10.04

# apt-cache policy postfix-policyd
postfix-policyd:
  Installed: (none)
  Candidate: 1.82-2ubuntu2
  Version table:
     1.82-2ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/universe Packages

I Can't install postfix-policyd with DEBIAN_FRONTEND='noninteractive', error log:
----------
Creating config file /etc/postfix-policyd.conf with new version
sanity check failed for dbc_dbuser.
error encountered creating user:
No database user specified.
dbconfig-common: postfix-policyd configure: aborted.
dbconfig-common: flushing administrative password
dpkg: error processing postfix-policyd (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 postfix-policyd
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Scott Kitterman (kitterman) wrote :

Different postfix policy package is the issue.

affects: postfix-policyd-spf-perl (Ubuntu) → postfix-policyd (Ubuntu)
Revision history for this message
shake.chen (shake-chen) wrote :

# lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10

Now I try to run, it is no problem.

 DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd

but in 10.04 beta2

would get the error

# DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd
Reading package lists... Done
Building dependency tree
Reading state information... Done
postfix-policyd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up postfix-policyd (1.82-2ubuntu2) ...
dbconfig-common: writing config to /etc/dbconfig-common/postfix-policyd.conf
sanity check failed for dbc_dbuser.
error encountered creating user:
No database user specified.
dbconfig-common: postfix-policyd configure: aborted.
dbconfig-common: flushing administrative password
dpkg: error processing postfix-policyd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 postfix-policyd
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Daniel Hahler (blueyed) wrote :

This should get forwarded to Debian probably - will you do this? - let me know if you won't.

I could imagine that DEBIAN_FRONTEND=noninteractive might not be supported anymore?!

summary: - noninteractive install
+ noninteractive install fails: "No database user specified."
Changed in postfix-policyd (Ubuntu):
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Zhang Huangbin (michaelbibby) wrote :

Is it possible to change something in pre/post-install script of postfix-policyd?

Revision history for this message
shake.chen (shake-chen) wrote :

Please help me forward to debian. thanks.

Changed in postfix-policyd (Debian):
status: Unknown → New
Revision history for this message
Daniel Hahler (blueyed) wrote :

Shakre, thanks for forwarding the bug.

It's not required to get it fixed by Debian, but the fix should have to go to Debian anyway.

@Zhang: yes, it's possible to change the pre/post-install scripts, that's likely what is required to get it fixed.

I have no idea though what needs to get done. Should it assume default settings and automatically setup a user and database etc?

Revision history for this message
Zhang Huangbin (michaelbibby) wrote :

Hi, Daniel.

>> I have no idea though what needs to get done. Should it assume default settings and automatically setup a user and database etc?

Creating user account and group is still necessary, just SKIP database setting with 'DEBIAN_FRONTEND=noninteractive'. A warning/notice message should be better.

Revision history for this message
Zhang Huangbin (michaelbibby) wrote :

Any update on this "bug"?

Revision history for this message
Daniel Hahler (blueyed) wrote :

I do not know how to fix it.

But I would happily accept any patch that fixed it - and sponsor it.. :)

Revision history for this message
shake.chen (shake-chen) wrote :

but in Karmic (1.82-2ubuntu1) is no problem.

can you check what have modify in luicd of postfix-policyd?

I only find change from libmysqlclient15off in Karmic to libmysqlclient16 in Luicd.

Revision history for this message
shake.chen (shake-chen) wrote :
Revision history for this message
shake.chen (shake-chen) wrote :
Download full text (5.8 KiB)

Now I try the newest Debian 6, and I found the bug have been fixed.

root@debian6:~# DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  dbconfig-common libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client
  mysql-client-5.1 mysql-common mysql-server mysql-server-5.1
  mysql-server-core-5.1 psmisc
Suggested packages:
  libipc-sharedcache-perl libterm-readkey-perl tinyca
The following NEW packages will be installed:
  dbconfig-common libdbd-mysql-perl libdbi-perl libhtml-template-perl
  libmysqlclient16 libnet-daemon-perl libplrpc-perl mysql-client
  mysql-client-5.1 mysql-common mysql-server mysql-server-5.1
  mysql-server-core-5.1 postfix-policyd psmisc
0 upgraded, 15 newly installed, 0 to remove and 0 not upgraded.
Need to get 26.3MB of archives.
After this operation, 60.1MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://mirrors.geekbone.org squeeze/main mysql-common 5.1.47-1 [407kB]
Get:2 http://mirrors.geekbone.org squeeze/main libnet-daemon-perl 0.43-1 [46.6kB]
Get:3 http://mirrors.geekbone.org squeeze/main libplrpc-perl 0.2020-2 [36.0kB]
Get:4 http://mirrors.geekbone.org squeeze/main libdbi-perl 1.611-1 [827kB]
Get:5 http://mirrors.geekbone.org squeeze/main libmysqlclient16 5.1.47-1 [2,270kB]
Get:6 http://mirrors.geekbone.org squeeze/main libdbd-mysql-perl 4.014-1 [137kB]
Get:7 http://mirrors.geekbone.org squeeze/main mysql-client-5.1 5.1.47-1 [8,625kB]
Get:8 http://mirrors.geekbone.org squeeze/main psmisc 22.11-1 [122kB]
Get:9 http://mirrors.geekbone.org squeeze/main mysql-server-core-5.1 5.1.47-1 [4,276kB]
Get:10 http://mirrors.geekbone.org squeeze/main mysql-server-5.1 5.1.47-1 [8,157kB]
Get:11 http://mirrors.geekbone.org squeeze/main dbconfig-common 1.8.46 [474kB]
Get:12 http://mirrors.geekbone.org squeeze/main libhtml-template-perl 2.9-1 [65.7kB]
Get:13 http://mirrors.geekbone.org squeeze/main mysql-client 5.1.47-1 [401kB]
Get:14 http://mirrors.geekbone.org squeeze/main mysql-server 5.1.47-1 [401kB]
Get:15 http://mirrors.geekbone.org squeeze/main postfix-policyd 1.82-2+b1 [62.1kB]
Fetched 26.3MB in 3min 16s (134kB/s)
Preconfiguring packages ...
Selecting previously deselected package mysql-common.
(Reading database ... 20103 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.1.47-1_all.deb) ...
Selecting previously deselected package libnet-daemon-perl.
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.43-1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.611-1_i386.deb) ...
Selecting previously deselected package libmysqlclient16.
Unpacking libmysqlclient16 (from .../libmysqlclient16_5.1.47-1_i386.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.014-1_i386.deb) ...
Selectin...

Read more...

Revision history for this message
shake.chen (shake-chen) wrote :

# apt-cache policy postfix-policyd
postfix-policyd:
  Installed: 1.82-2+b1
  Candidate: 1.82-2+b1
  Version table:
 *** 1.82-2+b1 0
        500 http://mirrors.geekbone.org squeeze/main Packages
        100 /var/lib/dpkg/status
     1.82-2 0
        500 file: pkgs/ Packages

Revision history for this message
Daniel Hahler (blueyed) wrote :

Shake, the difference between Karmic (1.82-2ubuntu1) and Lucid are really minor (attaching).
You can see them yourself, via:
1. bzr branch lp:ubuntu/postfix-policyd
2. cd postfix-policyd
3. bzr diff -r tag:1.82-2ubuntu1..tag:1.82-2ubuntu5

I suspect this is related to (changes in) dbconfig, which gets used for setting up the MySQL user.

Apart from that, it may be system specific (new install, upgrade, ...).

To debug this further, you may want to look into dbconfig, I cannot help you with that unfortunately.
Also, trying to install the Debian package (.deb) on the Ubuntu system, where the Ubuntu package is failing might give some hint(s).

Revision history for this message
shake.chen (shake-chen) wrote :

Daniel Hahler

thank you for your help, the problem seem cause by dbconfig-common.

when I run

# DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd

Creating config file /etc/postfix-policyd.conf with new version
sanity check failed for dbc_dbuser.
error encountered creating user:
No database user specified.

I check the /etc/dbconfig-common/postfix-policyd.conf files and find

dbc_dbtype='mysql'

# dbc_dbuser: database user
# the name of the user who we will use to connect to the database.
dbc_dbuser=''

# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
dbc_dbpass=''

# dbc_dbserver: database host.
# leave unset to use localhost (or a more efficient local method
# if it exists).
dbc_dbserver=''

# dbc_dbport: remote database port
# leave unset to use the default. only applicable if you are
# using a remote database.
dbc_dbport=''

# dbc_dbname: name of database
# this is the name of your application's database.
dbc_dbname=''

# dbc_dbadmin: name of the administrative user
# this is the administrative user that is used to create all of the above
dbc_dbadmin='root'

the file not create correctly. in ubuntu 910, the flies is below

dbc_dbtype='mysql'

# dbc_dbuser: database user
# the name of the user who we will use to connect to the database.
dbc_dbuser='postfix-policyd'

# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
dbc_dbpass='X1NMSNqVqtJd'

# dbc_dbserver: database host.
# leave unset to use localhost (or a more efficient local method
# if it exists).
dbc_dbserver=''

# dbc_dbport: remote database port
# leave unset to use the default. only applicable if you are
# using a remote database.
dbc_dbport=''

# dbc_dbname: name of database
# this is the name of your application's database.
dbc_dbname='postfixpolicyd'

# dbc_dbadmin: name of the administrative user
# this is the administrative user that is used to create all of the above
dbc_dbadmin='root'

Now when I modify /etc/dbconfig-common/postfix-policyd.conf , add the policyd user and password, and run again.

# DEBIAN_FRONTEND=noninteractive apt-get install postfix-policyd

runing well.

Changed in postfix-policyd (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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