Closed Bug 292715 Opened 19 years ago Closed 19 years ago

checksetup says PostgreSQL is version 00.00.0000

Categories

(Bugzilla :: Installation & Upgrading, defect)

defect
Not set
trivial

Tracking

()

RESOLVED INVALID

People

(Reporter: osirven, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.6) Gecko/20050406 Firefox/1.0.2 (Debian package 1.0.2-3)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.7.6) Gecko/20050406 Firefox/1.0.2 (Debian package 1.0.2-3)

When running checksetup.pl with a database configured to use PostgreSQL, the
script will fail on the version detection of the database. It seems that the
Bugzilla/DB/Pg.pm file lacks a
function nammed "get_info" called in Bugzilla/DB.pm file
with this line :
return $self->get_info(18); # SQL_DBMS_VER

So whatevery your version of PostgreSQL is, it will return a error like the
following :
# ./checksetup.pl
[...]
Checking for      PostgreSQL (v7.03.0000)
Your PostgreSQL v00.00.0000 is too old.
   Bugzilla requires version 7.03.0000 or later of PostgreSQL.
   Please download and install a newer version.

I am not sure if it is related but my database server and my bugzilla
installation are not on the same computer.

Reproducible: Always

Steps to Reproduce:
1. run once the checksetup.pl script to configure the localconfig file with the
PostgreSQL information
2. just re-run checksetup.pl and so what appens...

Actual Results:  
checksetup will fails as shown here:
# ./checksetup.pl
[...]
Checking for      PostgreSQL (v7.03.0000)
Your PostgreSQL v00.00.0000 is too old.
   Bugzilla requires version 7.03.0000 or later of PostgreSQL.
   Please download and install a newer version.

Expected Results:  
The version test should be successfull as my database version is 8.0.2 so I hope
it is greater than 7.03.0000 ;)

I could write a patch to correct it but I am not sure to understand the meaning
of the parameter of the function get_info...So if anyone can answer me, I will
write a quick patch for it.
Blocks: bz-postgres
The problem is most likely that your DBD::Pg is too old. You need at least 1.31.
Sorry that checksetup doesn't yet inform you of that.
Summary: undefined function get_info in Bugzilla/DB/Pg.pm will prevent any installation with PostgreSQL → checksetup dies with "undefined function get_info in Bugzilla/DB/Pg.pm"
(In reply to comment #1)
> The problem is most likely that your DBD::Pg is too old. You need at least 1.31.
> Sorry that checksetup doesn't yet inform you of that.

I have the version 1.41 installed and I though version >=1.31 was required?
(In reply to comment #2)
> I have the version 1.41 installed and I though version >=1.31 was required?

  Yeah, version 1.41 should definitely be new enough; it's practically
brand-new. :-) What version of DBI do you have? Try upgrading to the latest.
The version of DBI installed is 1.46
Wait... I don't see any "undefined function" error in your output. Is the
problem just that it's returning 00.0000.0000 instead of the correct version?
That might be a DBD::Pg bug, perhaps...?

Anyhow, you can create the database your self (just connect to template1 and
'CREATE DATABASE bugs' using the "bugs" user, so that the "bugs" user is the DB
owner), and then set $db_check to 0 in localconfig. That will get around this
until we determine what the actual problem is.
(In reply to comment #5)
> Wait... I don't see any "undefined function" error in your output. Is the
> problem just that it's returning 00.0000.0000 instead of the correct version?
> That might be a DBD::Pg bug, perhaps...?

The fact is there is *no* warning about that missing function. But if I write it
myself this way for example:
sub get_info {
   my ($self) = @_;

   return ('8.0.0');
}

It will work just fine. So I think this function should do a query the database
to extract version information with a query like "SELECT version();" and then
parse the output to get version from the generated output.

> Anyhow, you can create the database your self (just connect to template1 and
> 'CREATE DATABASE bugs' using the "bugs" user, so that the "bugs" user is the DB
> owner), and then set $db_check to 0 in localconfig. That will get around this
> until we determine what the actual problem is.

To manage that issue, I have added the little function I have written above so
that the version control could be passed and everything worked just fine.
(In reply to comment #6)
> The fact is there is *no* warning about that missing function. 

  That's because the function isn't missing. The Bugzilla::DB drivers all extend
DBI. get_info is a DBI function. In fact, the DBI docs say that get_info must be
able to return the DB version in order for DBI itself to function properly.
(In reply to comment #7)
> (In reply to comment #6)
> > The fact is there is *no* warning about that missing function. 
> 
>   That's because the function isn't missing. The Bugzilla::DB drivers all extend
> DBI. get_info is a DBI function. In fact, the DBI docs say that get_info must be
> able to return the DB version in order for DBI itself to function properly.

So what's next?
The DBD version installed is a debian package so do I have to fill a bug entry
for this package?
(In reply to comment #8)
> So what's next?
> The DBD version installed is a debian package so do I have to fill a bug entry
> for this package?

  You might want to do some experiments, but yeah, get_info(18) shouldn't be
returning 0. It could be a DBD::Pg bug against PostgreSQL 8, perhaps. It could
also be a problem with your server being remote, like you said.

  Would it be possible to install a local copy of Pg8 on the machine and try to
run checksetup against it, just for testing? That would at least tell you where
the bug was. And then yeah, you might want to either contact the Debian
maintainer and ask them about it, or contact the DBD::Pg people through the perl
RT and ask them about it.
After some tests, I have found that's it's a debian related bug. On an other
computer with a dbd module compiled by hand, it founds the right version number
of my database. So I think you can close this bug, I will fill a bug report for
Debian. Thanks for your help
You're welcome! Glad you figured it out. :-)
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Summary: checksetup dies with "undefined function get_info in Bugzilla/DB/Pg.pm" → checksetup says PostgreSQL is version 00.00.0000
Severity: major → trivial
You need to log in before you can comment on or make changes to this bug.