View Issue Details

IDProjectCategoryView StatusLast Update
0014720mantisbtdb postgresqlpublic2015-03-25 17:50
Reporterpeeter Assigned Todregad  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformPCOSUbuntu LinuxOS Version12.04 LTS
Product Version1.2.10 
Summary0014720: install.php: INSERT INTO mantis_config_table fails
Description

APPLICATION ERROR 0000401
Database query failed. Error received from database was #-1: ERROR: could not determine data type of parameter $1 for the query: INSERT INTO mantis_config_table
( value, type, access_reqd, config_id, project_id, user_id )
VALUES
($4, $5, $6, $7, $8,$9 ).

Steps To Reproduce

Install mantis package 1.2.10-1.
Make the following two changes to install.php in order to get through two early installation errors:

$ diff -c install.php install.php.orig
*** install.php 2012-09-18 02:16:46.000000000 -0400
--- install.php.orig 2012-09-18 02:16:42.974370098 -0400


* 776,787 **

            case 'pgsql' : 
                //create user 

! $t_query_create ="CREATE USER ".$f_db_username." WITH PASSWORD '".$f_db_password."' ";
$t_create = @$g_db->Execute ( $t_query_create );

                if ($t_create == true) { 
                    //grant privileges on database 

! $t_query_grant ="GRANT ALL PRIVILEGES ON DATABASE ".$f_database_name." TO ".$f_db_username." ";
$t_grant = @$g_db->Execute ( $t_query_grant );

                    if ($t_grant == true) { 

--- 776,787 ----

            case 'pgsql' : 
                //create user 

! $t_query_create ="CREATE USER '".$f_db_username."' WITH PASSWORD '".$f_db_password."' ";
$t_create = @$g_db->Execute ( $t_query_create );

                if ($t_create == true) { 
                    //grant privileges on database 

! $t_query_grant ="GRANT ALL PRIVILEGES ON DATABASE '".$f_database_name."' TO '".$f_db_username."' ";
$t_grant = @$g_db->Execute ( $t_query_grant );

                    if ($t_grant == true) { 

(The change in both cases is to remove some single quotes.)

Running the modified install.php, I get success with the two early errors, but now I get the following error:

APPLICATION ERROR 0000401
Database query failed. Error received from database was #-1: ERROR: could not determine data type of parameter $1 for the query: INSERT INTO mantis_config_table
( value, type, access_reqd, config_id, project_id, user_id )
VALUES
($4, $5, $6, $7, $8,$9 ).
Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

Additional Information

PostgreSQL 9.1.5 on i686-pc-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 32-bit
PHP Version 5.3.10-1ubuntu3.2
Apache/2.2.22 (Ubuntu)

PostgreSQL error log says:
2012-09-18 01:27:17 EDT FATAL: database "mantis" does not exist
2012-09-18 01:27:17 EDT FATAL: database "mantis" does not exist
2012-09-18 01:27:18 EDT FATAL: password authentication failed for user "mantis_user"
2012-09-18 01:27:18 EDT FATAL: password authentication failed for user "mantis_user"
2012-09-18 01:27:18 EDT ERROR: could not determine data type of parameter $1
2012-09-18 01:27:18 EDT STATEMENT: INSERT INTO mantis_config_table
( value, type, access_reqd, config_id, project_id, user_id )
VALUES
($4, $5, $6, $7, $8,$9 )

With regard to the “authentication failed for user mantis_user” error, I am still able to log in as mantis_user using psql and with the same password I supplied to install.php:
$ psql --username=mantis_user mantis
Password for user mantis_user:
psql (9.1.5)
Type "help" for help.
mantis=> select * from mantis_config_table;
ERROR: permission denied for relation mantis_config_table

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

grangeway

grangeway

2012-10-20 19:18

reporter   ~0033288

The mantis-2.x development branch removes the direct INSERT query and offers the user to create a admin user at the end of the install, which avoids this issue.

grangeway

grangeway

2013-04-05 17:56

reporter   ~0036223

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

grangeway

grangeway

2014-05-16 15:02

reporter   ~0040504

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

atrol

atrol

2014-06-16 15:41

developer   ~0040817

Reminder sent to: dregad, grangeway

Not sure, maybe this issue should be moved back to project mantis.
If so, grangeway could make a copy of it in project "Track DBAL replacement"

dregad

dregad

2015-03-10 18:25

developer   ~0049169

The referenced code does not exist in any official release of Mantis. Looking at steps to reproduce

Install mantis package 1.2.10-1.

Leads me to believe that this refers to the debian package, so it's likely that the installer's code has been modified by the package maintainer.

Please report the issue on the debian issue tracker https://packages.debian.org/wheezy/mantis