MantisBT

View Issue Details Jump to Notes ] Wiki ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014720Track DBAL replacementdb postgresqlpublic2012-09-19 10:292014-06-16 15:41
Reporterpeeter 
Assigned Tograngeway 
PrioritynormalSeverityblockReproducibilityalways
StatusassignedResolutionopen 
PlatformPCOSUbuntu LinuxOS Version12.04 LTS
Product Version1.2.10 
Target Version1.3.xFixed in Version 
Summary0014720: install.php: INSERT INTO mantis_config_table fails
DescriptionAPPLICATION 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 ReproduceInstall 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 InformationPostgreSQL 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.
Attached Files

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

-  Notes
User avatar (0033288)
grangeway (developer)
2012-10-20 19:18

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.
User avatar (0036223)
grangeway (developer)
2013-04-05 17:56

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch
User avatar (0040504)
grangeway (developer)
2014-05-16 15:02

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
User avatar (0040817)
atrol (developer)
2014-06-16 15:41

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"

- Issue History
Date Modified Username Field Change
2012-09-19 10:29 peeter New Issue
2012-10-20 19:18 grangeway Note Added: 0033288
2012-10-20 19:18 grangeway Status new => resolved
2012-10-20 19:18 grangeway Fixed in Version => 1.3.x
2012-10-20 19:18 grangeway Resolution open => fixed
2012-10-20 19:18 grangeway Assigned To => grangeway
2013-04-05 17:56 grangeway Status resolved => acknowledged
2013-04-05 17:56 grangeway Note Added: 0036223
2013-04-05 18:49 grangeway Relationship added related to 0015721
2013-04-05 20:03 grangeway Status acknowledged => closed
2013-04-06 07:23 grangeway Status closed => acknowledged
2013-04-06 07:26 grangeway Status acknowledged => resolved
2013-04-27 17:37 atrol Assigned To grangeway =>
2013-04-27 17:37 atrol Status resolved => new
2013-04-27 17:37 atrol Resolution fixed => open
2013-04-27 17:37 atrol Fixed in Version 1.3.x =>
2014-04-12 19:38 grangeway Target Version => 1.3.x
2014-04-12 19:57 grangeway Status new => assigned
2014-04-12 19:57 grangeway Assigned To => grangeway
2014-04-26 10:32 grangeway Relationship added child of 0017258
2014-05-16 15:02 grangeway Note Added: 0040504
2014-05-23 15:04 grangeway Project mantisbt => Track DBAL replacement
2014-06-16 15:41 atrol Note Added: 0040817


MantisBT 1.2.17 [^]
Copyright © 2000 - 2014 MantisBT Team
Time: 0.0908 seconds.
memory usage: 3,080 KB
Powered by Mantis Bugtracker