View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0012248 | mantisbt | db postgresql | public | 2010-08-11 13:38 | 2014-12-08 00:34 |
Reporter | nomikon | Assigned To | dregad | ||
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | BSD | OS | FreeBSD | OS Version | 8.0 |
Product Version | 1.1.8 | ||||
Target Version | 1.3.0-beta.1 | Fixed in Version | 1.3.0-beta.1 | ||
Summary | 0012248: Problem updating from 1.1.8 to 1.2.0 | ||||
Description | (Using PostgreSQL 8.4.4, PHP 5.2.12, on FreeBSD 8.0) Attempting to upgrade a current 1.1.8 installation to 1.2.0, when is comes to Database upgrade, we set the Mantis DB details (username and pasword). After clicking the 'upgrade' button we get the following page content: Database Parameters Looking at the PostgreSQL log, it seems that the upgrading process is attempting to connect to 'template1' database: Jul 10 08:19:30 postgres[41626]: [2-1] LOG: received connection: host=127.0.0.1 port=55536 As far as 'Setting Database Name', 'Setting Admin Username' and 'Setting Admin Password' are all found GOOD, the fault doesn't make sense. It seems there is no reason to attempt to connect with the 'template1' database, for which the Mantis DB owner doesn't have privileges. | ||||
Steps To Reproduce | Just following the steps above. | ||||
Tags | No tags attached. | ||||
You mention upgrading to 1.2.0, but that is not the latest version, and I believe there were a few fixes to the upgrade system in 1.2.1 and 1.2.2. Can you please try upgrading directly to 1.2.2 and see if that solves the issue? |
|
Thanks for your quick answer! Before sending the report I reviewed the change logs for 1.2.1 and 1.2.2, looking for a possible fix to that issue. Anyway I have just now attemped the upgrade using a fresh 1.2.2 download, and the problem persists. I keep getting the same red warning: Attempting to connect to database as admin BAD The PostgreSQL log shows the same error as well (the Mantis DB owner is trying to connect to 'template1' database.) |
|
Could you paste the portion of your config_inc.php here that involves the database connection? Thanks |
|
Here is: ... --- Database Configuration ---$g_hostname = 'localhost'; This same DB configuration is running fine in 1.1.8 |
|
Hi, any new about this issue? As far as I can see, the problem is clear: The admin/install.php script (lines 285 and later) ALWAYS try to do a first connection attempt without specifying a database name. In PostgreSQL this means it will attempt to connect to "template1" database, for which the username defined for the Mantis database has no permissions, resulting in the known error. I don't fully understand the reason to do two connections, given that the second one would catch any errors. If you want to be able to create the database, it would suffit changing the logic the other way around: Try connect to the specified database with the normal user and password. Actually, modifying that code to skip the first connection (just for testing) I'm able to go ahead without the known "Attempting to connect to database as admin BAD" error. However, beyond that point I'm now stumped again with a new "APPLICATION ERROR 0000401" Database query failed. Error received from database was #-1: ERROR: invalid input syntax for integer: «» for the query: UPDATE mantis_bug_table SET category_id=? WHERE project_id=? AND category=?. As far as I can remember this is an old known one... Should I open a new ticket for it? |
|
BTW, as far as this issue is blocking the upgrade, should we raise the category of this ticket up to "block"? |
|
I am having the same issue when trying to upgrade from 1.2.8 to 1.2.11 (PostgreSQL 8.4.4, PHP 5.3.2, RHEL 6.0), patching the install.php to include '$f_database_name' in the first call to $g_db->Connect resolved the issue for me. |
|
Unassigned from jreese as he is no longer actively developing. |
|
This should be fixed in master branch; if you are able to reproduce the behavior using a nightly build, feel free to reopen the issue. |
|