Jump to content


Click here to lend your support to: Traq and make a donation at pledgie.com !
Photo

New, Different Installation Error


  • Please log in to reply
26 replies to this topic

#1 pangloss

pangloss

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 13 April 2011 - 07:33 PM


Once the installation process gets to the part where in adds the data to the database I am getting a series of errors as follows...
---------------------------------------------------------------------

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/xxx.com/traq/system/libraries/db.class.php on line 81

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/xxx.com/traq/system/libraries/db.class.php on line 156

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/xxx.com/traq/system/libraries/db.class.php on line 162
Database error: #:

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /home/xxx/public_html/xxx.com/traq/system/libraries/db.class.php on line 62
---------------------------------------------------------------------

Any ideas? I am using the version 2.2 zip download on an linux machine with PHP 5.2something.




#2 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 14 April 2011 - 11:04 PM

Never had this issue, will do some testing when I get a chance.

#3 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 17 April 2011 - 05:24 AM

Okay, let's see.

I just finished setting up my development environment on my new computer and didn't run into this problem when installing Traq 2.2 on it with Apache 2.2, PHP 5.3.6 and MySQL 5.5 on Windows 7.

What are the details of the server you are trying to install on? (names + version)

#4 pangloss

pangloss

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 17 April 2011 - 04:23 PM

For sure,

I am using: Traq 2.2, Apache 2.2.16, PHP 5.2.14, MySQL 5.0.91 on CentOS 5.5

Thanks!

#5 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 17 April 2011 - 11:33 PM

hmm...

I will try to do a test on a server setup similar to the one your running on and see what happens.

#6 pangloss

pangloss

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 18 April 2011 - 01:12 AM

FYI: The error simply means the database connection is not working - which is a touch odd because the database login test two entry pages before does work. I am still continuing on this one. Will let you know as I find out more.



#7 pangloss

pangloss

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 18 April 2011 - 02:26 AM

Ok. So, here's what I've done to install it and make it operational. I think the problems are on my server but I can't say exactly what and why just yet.

1. There was a problem getting the $dbconf values in the install/index.php script. For some reason, they were always empty at the time for the table creation. So, I executed that stuff in MySQL by hand just to get by it.

2. Once installed, in global.php I changes the line
"require(TRAQPATH.'system/config.php');"
to
"require_once(TRAQPATH.'system/config.php');"
and also had to put the values into the config.php file. The empty values in the config file were due the empty values in the install process, as mentioned above.

So, it works perfectly now. I know this isn't really a solution but maybe that will shed a little more light on the issue.


#8 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 18 April 2011 - 11:12 AM

The installer uses JSON to easily submit the database config array to the next page, does your server have JSON installed with PHP?

#9 kristovaher

kristovaher

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 04 May 2011 - 09:38 AM

Same error here, and my server does have JSON and DB connection is working from any and every other script. Quite disappointed, considering this was my first experience with Traq.

#10 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 04 May 2011 - 10:42 AM

I've not been able to reproduce this error on any of my server setups.

What browser are you using? Perhaps it's not submitting the JSON data correctly.

#11 kristovaher

kristovaher

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 04 May 2011 - 12:02 PM

I'm using Firefox 4. Also tried with Opera 11 now that you mentioned it. Also developer version of latest Chrome fails.

#12 adriano32

adriano32

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 06 May 2011 - 06:21 PM

Never had this issue, will do some testing when I get a chance.


Hi, Jack.
I have similar issue at debian lenny, apache 2.2.9, php 5.2.6, mysql 5.0.51a with Traq2.2 in Firefox4
Of course i have solve it, defining $dbconf after line 247 into install/index.php
Now i'm searching for reason of it

#13 adriano32

adriano32

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 06 May 2011 - 09:13 PM

The installer uses JSON to easily submit the database config array to the next page, does your server have JSON installed with PHP?


Look, Jack.
I have changed type of input fields "step" and "db" from hidden to text in install/index.php, to see, what we have in them at every step.
Here is my investigation:

step==2 -> Database Information page. Entering values into the fields. Pressing Continue

step==3
{"server":"localhost","user":"traq","pass":"[email protected]","dbname":"traq","prefix":"traq_"}
-> Database connection succeeded. Pressing Continue

step==3
{\"server\":\"localhost\",\"user\":\"traq\",\"pass\":\"[email protected]\",\"dbname\":\"traq\",\"prefix\":\"traq_\"}
-> Traq Settings & Admin Account. Entering data into the fields. Pressing Continue

step==4
{\\\"server\\\":\\\"localhost\\\",\\\"user\\\":\\\"traq\\\",\\\"pass\\\":\\\"[email protected]\\\",\\\"dbname\\\":\\\"traq\\\",\\\"prefix\\\":\\\"traq_\\\"}

And now we are pressing install button and receiving
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /var/www/traq/system/libraries/db.class.php on line 81

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /var/www/traq/system/libraries/db.class.php on line 156

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /var/www/traq/system/libraries/db.class.php on line 162
Database error: #:

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /var/www/traq/system/libraries/db.class.php on line 62

You should see how backslashes added to screen quotes.
It's described in php.ini file
; Magic quotes
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = On
Because of default is magic_quotes_gpc = On i and pangloss received errors. After i changed it to magic_quotes_gpc = Off i could succesfully install traq without install/index.php editing (defining $dbconf by hand)

So, now you know what is the problem connected with and should think about fixing or not this.

Thank you for Traq :)

BR, adriano32

#14 yngwi

yngwi

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 20 June 2011 - 07:56 AM

Hi,
I've got the exact same problems on a managed server with no access to php.ini and very little mysql knowledge. Can you help me fix this problem? Which infos would you need? I would very much like to try out traq.
Regards, Daniel

#15 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 20 June 2011 - 08:16 AM

Try opening the 'install/index.php' file and putting this at the top:
ini_set('magic_quotes_gpc', 'off');

If that doesn't work let me know and I will hunt down the code to cleanse the POST data from the magic quotes scourge.

#16 yngwi

yngwi

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 20 June 2011 - 08:40 AM

Try opening the 'install/index.php' file and putting this at the top:

ini_set('magic_quotes_gpc', 'off');

If that doesn't work let me know and I will hunt down the code to cleanse the POST data from the magic quotes scourge.


Thanks for your quick help. Unfortunately it didn't help. I tried two ways, insert it befor the starting "I use Firefox 4, if this information is any help for you (I guess not)
Regards,
Daniel

#17 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 20 June 2011 - 09:10 AM

Okay, try putting this after the license text in the install/index.php, should fix it this time.

// Strip magic quotes from request data.
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
$unescape_function = (empty($quotes_sybase) || $quotes_sybase === 'off') ? 'stripslashes($value)' : 'str_replace("\'\'","\'",$value)';
$stripslashes_deep = create_function('&$value, $fn', '
if (is_string($value)) {
$value = ' . $unescape_function . ';
} else if (is_array($value)) {
foreach ($value as &$v) $fn($v, $fn);
}
');

// Unescape data
$stripslashes_deep($_POST, $stripslashes_deep);
$stripslashes_deep($_GET, $stripslashes_deep);
$stripslashes_deep($_COOKIE, $stripslashes_deep);
$stripslashes_deep($_REQUEST, $stripslashes_deep);
}


#18 yngwi

yngwi

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 20 June 2011 - 12:37 PM

Okay, try putting this after the license text in the install/index.php, should fix it this time.


Worked like a charm! Thanks a lot!
Trying everything out!

#19 clem67

clem67

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 24 June 2011 - 10:01 PM

Okay, try putting this after the license text in the install/index.php, should fix it this time.

// Strip magic quotes from request data.
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
$unescape_function = (empty($quotes_sybase) || $quotes_sybase === 'off') ? 'stripslashes($value)' : 'str_replace("\'\'","\'",$value)';
$stripslashes_deep = create_function('&$value, $fn', '
if (is_string($value)) {
$value = ' . $unescape_function . ';
} else if (is_array($value)) {
foreach ($value as &$v) $fn($v, $fn);
}
');

// Unescape data
$stripslashes_deep($_POST, $stripslashes_deep);
$stripslashes_deep($_GET, $stripslashes_deep);
$stripslashes_deep($_COOKIE, $stripslashes_deep);
$stripslashes_deep($_REQUEST, $stripslashes_deep);
}


hello,
i put this code in the file install/index.php but I still have the same problem :
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /homez.41/clementl/www/BugTracker/system/libraries/db.class.php on line 81

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /homez.41/clementl/www/BugTracker/system/libraries/db.class.php on line 156

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /homez.41/clementl/www/BugTracker/system/libraries/db.class.php on line 162
Database error: #:

Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /homez.41/clementl/www/BugTracker/system/libraries/db.class.php on line 62

Thanks for your help

#20 Jack

Jack

    Project Founder

  • Administrators
  • 673 posts
  • LocationAustralia

Posted 25 June 2011 - 12:44 AM

Do you have the JSON encode and decode functions available on your server?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users