Closed Bug 388326 Opened 19 years ago Closed 19 years ago

checksetup.pl checks DB access without specifying a DB name

Categories

(Bugzilla :: Database, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: chase, Unassigned)

Details

Attachments

(1 file)

checksetup.pl runs Bugzilla::DB::bz_check_requirements as the first step in verifying the DB configuration specified in localconfig. In my configuration, I specified db_check as 1 (the default), and entered the rest of my DB configuration details. db_name was set to 'meraki_bugs'. When I ran ./checksetup.pl, the DB connection attempt failed with a PG error that the DB named 'template1' could not be accessed. Digging further, I found that template1 is the default DB name in the PG driver (Bugzilla::DB::Pg) and is used when no DB name is specified in its place. As it turns out, Bugzilla::DB::bz_check_requirements calls _get_no_db_connection, which calls _connect with an unspecified DB name. When I changed line 229 to specify a DB name, ./checksetup.pl completed successfully for me. Patch against stock Bugzilla 3.0 is attached.
This behavior is intentional. This connection happens before the Bugzilla database exists, when Bugzilla is assuring that you have the correct version of the DB. You can set $db_check = 0 in localconfig to skip that check. template1 should exist in all Pg DBs, and if it doesn't, then something is wrong. If you don't have access to it, then you're just on shared hosting, and you'll have to set $db_check = 0.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
The exact error checksetup.pl returned was that template1 could not be accessed using the specified username and password. template1 exists but we're using a locked down pg_hba.conf for security of the DB system. Here are the sections in QUICKSTART that fooled me: 4. Edit the localconfig file, in particular the $webservergroup and $db_* variables. In particular, $db_name and $db_user will define your database setup in step 5. If you want to change platforms, operating systems, severities and priorities, this can also be done in localconfig at this time. 5. Using the name you provided as $db_name above, create a MySQL database for Bugzilla. You should also create a user permission for the name supplied as $db_user with read/write access to that database. Did I misread step 5? It says 'create a MySQL database for Bugzilla,' but looking at checksetup.pl that code appears to want to create the DB itself. Also, in our environment, I created the Bugzilla DB user so that it can create, alter, and delete tables, but not create new databases.
Ah, yeah. In your case you'd have to just disable $db_check. Quickstart is out of date, although in your case you would have to create the DB, anyhow.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: