Bugzilla installation fails to create a database

Bug #55747 reported by Janne Jokitalo
10
Affects Status Importance Assigned to Milestone
bugzilla (Ubuntu)
Fix Released
Undecided
Martin Pitt

Bug Description

Trying to install bugzilla on Dapper results with these errors:

Setting up bugzilla (2.20-1) ...
Creating a new default bugzilla database...
DBD::mysql::db do failed: Access denied for user 'debian-sys-maint'@'localhost' to database 'bugzilla' at /usr/share/bugzilla/debian/postinst-db.pl line 357, <STDIN> line 2.
DBD::mysql::db do failed: Access denied for user 'debian-sys-maint'@'localhost' to database 'bugzilla' at /usr/share/bugzilla/debian/postinst-db.pl line 357, <STDIN> line 2.
dpkg: error processing bugzilla (--configure):
 subprocess post-installation script returned error exit status 2

I don't know why this happens, since from the bugzilla changelog, I find this:

bugzilla (2.16.7-1) unstable; urgency=low

  * Major rewriting of the postinst.
    Better process, for the automatic mode, we now create a default bugzilla
    user instead of using debian-sys-maint.

Changelog suggests that this user (debian-sys-maint) isn't needed anymore. This error was stumbled upon by choosing the Automatic installation routine in debconf.

Will have to check the code, next...

Revision history for this message
Janne Jokitalo (astraljava) wrote :

Here's how I see it happening, someone who understands this better can correct my reasoning:

in file:

/usr/share/bugzilla/debian/postinst-db.pl

it says:

...
# according to installation way user choosed,
# we'll do different things.
my $install_way;
my $default_file = '/etc/mysql/debian.cnf';
...

and

...
# The Automatic way will read /etc/mysql/default.cnf
# and will use the values found there.
if ($install_way eq 'Automatic') {

        # At this time, Debian MySQL user must be available.
        init_default_vars();
        debug "Debian MySQL maintainer is : $DEBIAN_DBUSER";

        # At this time, we have to set the good values
        # for accessing the MySQL database.
        $mysql_host = $BUGZILLA_DBHOST;
        $mysql_port = $BUGZILLA_DBPORT;
        $mysql_name = $BUGZILLA_DBNAME;
        $mysql_name_escaped = $mysql_name;
        $mysql_user = $BUGZILLA_DBUSER;
        $mysql_user_pwd = $BUGZILLA_DBPASS;
        $mysql_need_root = 'true';
        $mysql_root_name = $DEBIAN_DBUSER;
        $mysql_root_pwd = $DEBIAN_DBPASS;
...

which to me seems to indicate choosing user 'debian-sys-maint' as the $mysql_root_name, contrary to the changelog entry (which is a bit short, I must admit).

After granting all privileges to user 'debian-sys-maint' and trying "sudo aptitude reinstall bugzilla" the installation procedure says:

jaska@jjod600n:~$ sudo aptitude reinstall bugzilla
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
The following packages will be REINSTALLED:
  bugzilla
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up bugzilla (2.20-1) ...
Database bugzilla already exists, skipping database creation.

...at which point it stays probably until the end of time. Some 15 minutes later I got this pop-up box in the bottom right corner of my desktop saying "partition / is 95% full", which caused me to panic and hit ctrl+c in the terminal that was reinstalling bugzilla, because that partition had 7.9GB of free space before reinstalling. I was afraid the / partition would fill up, which wouldn't be nice...

After reading more stuff in the 'net I cannot be sure whether this was a desired effect. It sounds a bit stunning that it would eat up that much disk space, but I'll let that one pass, and study more about the package.

Revision history for this message
Lionel Porcheron (lionel.porcheron) wrote :

Thanks for you bug report.

Which option did you choose atinstallation ? When i use "apt-get install bugzilla", I have to options : manual and latter.

Manual ask me lot of questions (user name, database name, etc.) and later does nothing more than telling me to dpkg-reconfigure bugzilla later.

Changed in bugzilla:
status: Unconfirmed → Needs Info
Revision history for this message
Janne Jokitalo (astraljava) wrote :

Hello Lionel, thanks for taking the time to check up on it!

Actually, I mentioned in the initial report that I chose the Automatic choice. But I learnt that it can't be selected if at the same time you pull mysql as a dependency. I had mysql installed earlier, so that's why I could choose it at first attempt.

I have since then tried a clean install of Dapper in debootstrap, and I can't install bugzilla there either. So my thoughts about this lappie being dist-upgraded all the way from hoary making a difference were wrong. I have now installed bugzilla from sources, so it's got to be something in the postinst-db.pl script, which is under investigation at the moment, since I thought because this package doesn't have a real maintainer in Ubuntu community, I could step up and claim it for me. :) When I've debugged the script and (hopefully, perl is new to me) found the error, I'll post the results and start building the package, a new skill as well... Don't hold your breath. :)

Revision history for this message
Aaron Klotz (dblohm7) wrote :

Take a look at Debian bug track #360617
They claim in that ticket that this issue was fixed for 2.20-1-2

Revision history for this message
Christoph Langner (chrissss) wrote :

This bug is still relevant for Ubuntu Edgy and Feisty. Installing bugzilla via the repositories fails. The Database can't be set up automatically via dbconfig-common.

Revision history for this message
Max Luebbe (max-luebbe) wrote :

This is still broken in Dapper as well.

Exactly as described above.

Revision history for this message
wren (8to8) wrote :

Hi,
still on issue.
Ubuntu lost at least 1 business user.
further information can be found at the http://forum.ubuntuusers.de/topic/79244/ thread "Bugzilla Server installieren" (in German) with time stamp " 19.03.2007, 19:36 "
reported at: 2006-08-09
Assigned to "Nobody"
Importance "Undecided"
Status "Incomplete"

Changed in bugzilla:
assignee: nobody → pitti
Revision history for this message
Henry78 (henry78) wrote :

This is still an issue on dapper....

Revision history for this message
andrewguy9 (adthomson) wrote : bump

I've just tried this on Aug 3, still no dice.

Revision history for this message
wren (8to8) wrote :

Could somebody check this with an original Debian system? I have no disk space left for such an experiment. Running a Debian VMWare image from the http://www.vmware.com/appliances/ webpage should be fine, too.

Debian Bugzilla package maintainer can be found at http://packages.qa.debian.org/b/bugzilla.html

Revision history for this message
andrewguy9 (adthomson) wrote : Trial with stock debian

Ok, I just got a virtual machine up with Debian Etch:

I ussued the following commands
apt-get install apache2
apt-get install mysql-server
apt-get install phpmyadmin - just so i had easy access to database
apt-get install bugzilla

I chose to use dbconfig-common to setup the database connection.

apt reported the following error:
<p>
Setting up bugzilla (2.22.1-2) ...
dbconfig-common: writing config to /etc/dbconfig-common/bugzilla.conf

Creating config file /etc/dbconfig-common/bugzilla.conf with new version

Creating config file /etc/bugzilla/dbconfig-params with new version
granting access to database bugzilla for bugzilla@localhost: success.
verifying access for bugzilla@localhost: success.
creating database bugzilla: success.
verifying database bugzilla exists: success.
dbconfig-common: flushing administrative password

Can't connect to the database.
Error: Access denied for user 'bugzilla'@'localhost' (using password: YES)
  Is your database installed and up and running?
  Do you have the correct username and password selected in localconfig?

So when I checkout the database in phpmyadmin I find an empty bugzilla db, and a bugzilla user with password hash.

So I went into /etc/bugzilla/localconfig and saw that $db_pass = "secret", which is NOT what I set it to. So I changed it to my password and tried out the site.

Bugzilla reported the following error:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
 webmaster@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 Server at localhost Port 80</address>
</body></html>

So I checked out the log in /var/log/apache2/error.log it it reported the following error:

[Tue Aug 07 04:02:34 2007] [notice] Apache/2.2.3 (Debian) PHP/5.2.0-8+etch7 configured -- resuming normal operations
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] No value for param user_verify_class (try running checksetup.pl again) at /usr/share/perl5/Bugzilla/Config.pm line 225.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at /usr/share/perl5/Bugzilla/Auth.pm line 43.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] Compilation failed in require at /usr/share/bugzilla/Bugzilla.pm line 28.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at /usr/share/bugzilla/Bugzilla.pm line 28.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] Compilation failed in require at /usr/share/bugzilla/globals.pl line 803.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] BEGIN failed--compilation aborted at /usr/share/bugzilla/globals.pl line 803.
[Tue Aug 07 04:02:46 2007] [error] [client 127.0.0.1] Compilation failed in require at /usr/lib/cgi-bin/bugzilla/index.cgi line 33.

Revision history for this message
Aaron Klotz (dblohm7) wrote :

In dapper my problem was identical to the bug description. What I found was that the bugzilla package expects more privileges for debian-sys-maint than that user was actually given when the mysql packages were installed. I gave debian-sys-maint full privileges, flushed the privileges (this is CRITICAL -- otherwise mysql won't recognize the updated privileges), purged bugzilla and then installed it again successfully. Then I removed those extra privileges for debian-sys-maint.

Revision history for this message
Christoph Langner (chrissss) wrote :

The issue is solved in Ubuntu Gutsy Gibbon

# sudo apt-get install apache2 mysql-server postifx bugzilla

and a couple of questions later bugzilla is up and running.

Martin Pitt (pitti)
Changed in bugzilla:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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