Skip to content

Testlink 1.9.20 fixed db sample upgrade#362

Merged
fmancardi merged 5 commits intoTestLinkOpenSourceTRMS:testlink_1_9_20_fixedfrom
dcoomber:testlink_1_9_20_fixed_db_sample_upgrade
Oct 20, 2024
Merged

Testlink 1.9.20 fixed db sample upgrade#362
fmancardi merged 5 commits intoTestLinkOpenSourceTRMS:testlink_1_9_20_fixedfrom
dcoomber:testlink_1_9_20_fixed_db_sample_upgrade

Conversation

@dcoomber
Copy link
Contributor

@dcoomber dcoomber commented Feb 4, 2024

  1. Removed references to deleted / deprecated PostgreSQL dump
  2. Updated MySQL dump to 1.9.20 (with some poetic license to insert missing data for new columns)

@dcoomber dcoomber changed the base branch from testlink_1_9 to testlink_1_9_20_fixed February 4, 2024 15:39
@fabisento
Copy link

Hello, maybe you can help me?!

When I search a test suite in the search function in Testlink, I get this error message

==============================================================================

DB Access Error - debug_print_backtrace() OUTPUT START

ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)

        Having this additional Information could be useful for reporting 

        issue to development TEAM. 

==============================================================================

#0 database->exec_query() called at [C:\xampp\htdocs\testlinkfix\lib\functions\database.class.php:644]
#1 database->fetchRowsIntoMap() called at [C:\xampp\htdocs\testlinkfix\lib\search\searchCommands.class.php:781]
#2 searchCommands->searchTestSuites() called at [C:\xampp\htdocs\testlinkfix\lib\search\search.php:99]

Thank you

@dcoomber
Copy link
Contributor Author

dcoomber commented Feb 14, 2024

Hello, maybe you can help me?!

When I search a test suite in the search function in Testlink, I get this error message

==============================================================================

DB Access Error - debug_print_backtrace() OUTPUT START

ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)

        Having this additional Information could be useful for reporting 

        issue to development TEAM. 

==============================================================================

#0 database->exec_query() called at [C:\xampp\htdocs\testlinkfix\lib\functions\database.class.php:644] #1 database->fetchRowsIntoMap() called at [C:\xampp\htdocs\testlinkfix\lib\search\searchCommands.class.php:781] #2 searchCommands->searchTestSuites() called at [C:\xampp\htdocs\testlinkfix\lib\search\search.php:99]

Thank you

Thank you for your input.

It would assist if you could share the relevant content of the underlying log file(s) in the log directory of your instance of the app.

Here's an example from the userlog1.log on my installation.

	[24/Feb/14 17:50:35][ERROR][4u1jb7quupeh336m1aj69j5qu5][DATABASE]
		ERROR ON exec_query() - database.class.php <br />1370 - execute command denied to user 'testlink'@'%' for routine 'testlink_sample.UDFStripHTMLTags' -  <<REDACTED>>
Query failed: errorcode[1370]
	errormsg:execute command denied to user 'testlink'@'%' for routine 'testlink_sample.UDFStripHTMLTags' 
[<<][65ccfd6b2f8da601625549][DEFAULT][/lib/search/search.php][24/Feb/14 17:50:35][24/Feb/14 17:50:35][took 0.040442 secs]

Assuming that you are experiencing the same issue as I am, I resolved the error by running the following SQL statement as the MySQL root user (replace the DB and user name with the values for your environment):

use testlink_sample;
grant execute on function UDFStripHTMLTags TO 'testlink'@'%';

I'll add an instruction to docs/db_sample/README.TXT.

…ECUTE permissions needed on UDFStripHTMLTags)
@fabisento
Copy link

Hello, thank you very much for your help :)
i found this in the loguserlog2.log

Query failed: errorcode[1305]
errormsg:FUNCTION testlink2024.UDFStripHTMLTags does not exist
[<<][65ccba26051e9900662529][DEFAULT][/testlinkfix/lib/search/search.php][24/Feb/14 13:03:34][24/Feb/14 13:03:34][took 0.032426 secs]
[<<][65ccba2935174871281961][DEFAULT][/testlinkfix/lib/search/searchMgmt.php][24/Feb/14 13:03:37][24/Feb/14 13:03:37][took 0.032218 secs]

ERROR ON exec_query() - database.class.php <br />1305 - FUNCTION testlink2024.UDFStripHTMLTags does not exist -  SELECT NH_TS.name, TS.id, TS.details  FROM nodes_hierarchy NH_TS  JOIN testsuites TS ON TS.id = NH_TS.id  WHERE TS.id IN (2) AND ( 1=0  OR (  1=0 or UDFStripHTMLTags(TS.details) LIKE '%fdsfsdasd%' ) OR (  1=0 or NH_TS.name LIKE '%fdsfsdasd%' ))<br />THE MESSAGE :  SELECT NH_TS.name, TS.id, TS.details  FROM nodes_hierarchy NH_TS  JOIN testsuites TS ON TS.id = NH_TS.id  WHERE TS.id IN (2) AND ( 1=0  OR (  1=0 or UDFStripHTMLTags(TS.details) LIKE '%fdsfsdasd%' ) OR (  1=0 or NH_TS.name LIKE '%fdsfsdasd%' ))

@dcoomber
Copy link
Contributor Author

Hello, thank you very much for your help :) i found this in the loguserlog2.log

Query failed: errorcode[1305] errormsg:FUNCTION testlink2024.UDFStripHTMLTags does not exist [<<][65ccba26051e9900662529][DEFAULT][/testlinkfix/lib/search/search.php][24/Feb/14 13:03:34][24/Feb/14 13:03:34][took 0.032426 secs] [<<][65ccba2935174871281961][DEFAULT][/testlinkfix/lib/search/searchMgmt.php][24/Feb/14 13:03:37][24/Feb/14 13:03:37][took 0.032218 secs]

ERROR ON exec_query() - database.class.php <br />1305 - FUNCTION testlink2024.UDFStripHTMLTags does not exist -  SELECT NH_TS.name, TS.id, TS.details  FROM nodes_hierarchy NH_TS  JOIN testsuites TS ON TS.id = NH_TS.id  WHERE TS.id IN (2) AND ( 1=0  OR (  1=0 or UDFStripHTMLTags(TS.details) LIKE '%fdsfsdasd%' ) OR (  1=0 or NH_TS.name LIKE '%fdsfsdasd%' ))<br />THE MESSAGE :  SELECT NH_TS.name, TS.id, TS.details  FROM nodes_hierarchy NH_TS  JOIN testsuites TS ON TS.id = NH_TS.id  WHERE TS.id IN (2) AND ( 1=0  OR (  1=0 or UDFStripHTMLTags(TS.details) LIKE '%fdsfsdasd%' ) OR (  1=0 or NH_TS.name LIKE '%fdsfsdasd%' ))

Well this was a bit sneaky of you... it appears that you're asking for support that isn't related to the changes that I made (i.e. you didn't restore the DB dump in my PR). Naughty, naughty! 🤣

I'm joking, though. Your report helped me uncover and submit an improvement.

Here's the explanation of the problem you're facing now:

  • When you setup TL the first time, the final setup screen provides an instruction to create this User-Defined Function - a step that it appears you missed.
  • You can use the script in install/sql/mysql/testlink_create_udf0.sql to create this UDF. You may need to repeat the steps in my previous message to set the correct EXECUTE permissions.

@fabisento
Copy link

fabisento commented Feb 15, 2024

Wow! Thank you, I actually missed it!
I know it was a bit sneaky :D but I didn't know what else to do

Anyway, thank you very much for your help

I have now tried to import the script manually into the database via phpmyadmin, unfortunately I get this error

TestLink Open Source Project - http://testlink.sourceforge.net/# This script is distributed under the GNU General Public License 2 or later.# ---------------------------------------------------------------------------------------# @filesource testlink_create_udf0.sql##USE YOUR_TL_DBNAME;

#1049 - Unknown database 'your_tl_dbname'

Thx for your Help!!

@fabisento
Copy link

okay my bad, I forgot to change the database name in the .sql!

it works !

THX! <3
made my day

@dcoomber
Copy link
Contributor Author

okay my bad, I forgot to change the database name in the .sql!

it works !

THX! <3 made my day

Great show, @fabisento .

I'm thrilled that you're up-and-running (and that I got to help someone).

Have a great week ahead!

@dcoomber
Copy link
Contributor Author

@fmancardi please may I have your thoughts on this PR

@fmancardi fmancardi merged commit f2ecd28 into TestLinkOpenSourceTRMS:testlink_1_9_20_fixed Oct 20, 2024
@fmancardi
Copy link
Contributor

Thanks for your contribution
Changes has been merged in branch testlink_1_9_20_fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants