Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008678TestLinkTest Project Managementpublic2019-06-04 12:312019-06-08 20:33
Reporterheju 
Assigned Tofman 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.9.19 (2019 Q1) 
Fixed in Version1.9.20 Raijing DEV 
Summary0008678: ERROR ON exec_query() when creating new test project from existing test project
DescriptionDear TestLink Team,

when trying to create a new test project from an existing (big) project, I get a
DB Access Error.

Just above the "DB Access Error" error message, I can see some part of code displayed as text:
array(3) { ["copy_requirements"]=> int(1) ["copy_user_roles"]=> int(1) ["copy_platforms"]=> int(1) }

In the System Error log the following log entry appears:
ERROR ON exec_query() - database.class.php
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,'2019-06-04 13:38:42')' at line 2 - /* Class:testproject - Method: copy_as */ INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (6863,,3,4,'2019-06-04 13:38:42')
THE MESSAGE : /* Class:testproject - Method: copy_as */ INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (6863,,3,4,'2019-06-04 13:38:42') Query failed: errorcode[1064] errormsg:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,'2019-06-04 13:38:42')' at line 2
Additional InformationFull Error message displayed:
array(3) { ["copy_requirements"]=> int(1) ["copy_user_roles"]=> int(1) ["copy_platforms"]=> int(1) }

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

 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(/* Class:testproject - Method: copy_as */
                     INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (7208,,3,4,'2019-06-04 14:11:11')) called at [/var/www/html/testlink-1.9.19/lib/functions/testproject.class.php:2697]
#1 testproject->copy_as(25, 7127, 4, copytest4, Array ([copy_requirements] => 1)) called at [/var/www/html/testlink-1.9.19/lib/project/projectEdit.php:422]
0000002 doCreate(stdClass Object ([tprojectName] => copytest4,[color] => ,[notes] => ,[doAction] => doCreate,[tcasePrefix] => cpt4,[api_key] => ,[tprojectID] => 0,[copy_from_tproject_id] => 25,[is_public] => 1,[
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySql
Browser
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Filespng file icon tprojCopy_screenshot.png [^] (16,008 bytes) 2019-06-07 07:47


jpg file icon tl_req_setup.jpg [^] (231,118 bytes) 2019-06-08 09:58

- Relationships
child of 0008549assignedfman Availables hot-fixes for 1.9.19 & How To get full fixed package from GitHub 

-  Notes
(0028889)
fman (administrator)
2019-06-05 08:29

please get branch 1.9.19.01, do fresh install, retest and provide feedback
(0028891)
heju (reporter)
2019-06-05 11:37
edited on: 2019-06-05 11:50

I checked out the branch you suggested (last commit is 370d60577cd13c2b1e586496dc9dc1dd4de85e30).

(Using a duplicate of the data base, same procedure as for TL update. Was this the correct way you suggested?)

Error remains the same:

ERROR ON exec_query() - database.class.php
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,'2019-06-05 13:29:30')' at line 2 - /* Class:testproject - Method: copy_as */ INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (8274,,3,4,'2019-06-05 13:29:30')
THE MESSAGE : /* Class:testproject - Method: copy_as */ INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (8274,,3,4,'2019-06-05 13:29:30') Query failed: errorcode[1064] errormsg:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '3,4,'2019-06-05 13:29:30')' at line 2

(0028899)
fman (administrator)
2019-06-05 21:39

please confirm that you have done fresh install => you start with a db without no data
(0028903)
heju (reporter)
2019-06-06 05:20

Ah understood, I tried the TL branch version using the already populated db.

In case the problem is caused by problematic content in the database, how would I transfer all the data from the (maybe) broken db to the fresh install w/o copying the problematic content? From the error message, is there a chance to find out what db content is wrong, then I can try to fix it manually in mysql.
(0028904)
fman (administrator)
2019-06-06 09:23

Trying to fix manually will be not easy, best way to go is to install a system in parallel and restart the migration process.

Please give me a couple of days to understand if I can reproduce the issue

regards
(0028906)
heju (reporter)
2019-06-07 07:47
edited on: 2019-06-07 07:49

Dear fman,

I was able to copy the project w/o error message by using the following approach.

I noticed that the problem seems to be related to requirement relations.
By investigating the specific IDs stated in the db error messages it seemed that only links to requirements are affected that I recently:
- set to obsolete
- moved to some other requirement spec (the yellow folder symbol)

Now I just deleted all relations to the anyway obsolete reqs and I can copy the project again w/o the db error message.

One issue remains, not sure if it is problematic: I still see some part of php code in the GUI, directly after copying a project (this happens even when copying a completely unrelated testproject), I will attach a screenshot.

Best regards


edit: Screen-shot is attached above.

(0028908)
heju (reporter)
2019-06-08 08:30
edited on: 2019-06-08 09:25

Small update:
Was able to reproduce the problem on a new installation of 1.9.17 (actually I planned to upgrade to 1.9.19 to check if this causes the problem, but was not necessary)

Steps to reproduce:
- create two requirement folders
- create one requirement in each folder
- add relation "related to" linking the two reqs in different folders
- try to generate a new project from the testproject (check requirements of course)

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

 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(/* Class:testproject - Method: copy_as */ INSERT INTO req_relations (source_id, destination_id, relation_type, author_id, creation_ts) values (,120,3,1,'2019-06-08 10:26:02')) called at [/var/www/html/testlink-1.9.17/lib/functions/testproject.class.php:2708]
#1 testproject->copy_as(1, 117, 1, cpy7, Array ([copy_requirements] => 1)) called at [/var/www/html/testlink-1.9.17/lib/project/projectEdit.php:474]
0000002 doCreate(stdClass Object ([tprojectName] => cpy7,[color] => ,[notes] => ,[doAction] => doCreate,[tcase

(0028909)
fman (administrator)
2019-06-08 09:26

Hi
thanks, but that the issue is on 1.9.17 is not any help for me, Because I'm going to fix it only if present on 1.9.19
(0028911)
heju (reporter)
2019-06-08 09:57
edited on: 2019-06-08 10:40

Hi,
understood. Did a fresh install of 1.9.19.01 (from git).
New database.

Was able to reproduce on first try. Steps as described above. I will add a screenshot showing the req folder structure.
-create folder structure as described.
-try to copy test project (incl reqs)


edit: added screenshot: http://mantis.testlink.org/file_download.php?file_id=5159&type=bug [^]


edit2: tested a fresh install of tl 1.9.20: bug can be still reproduced.

(0028913)
fman (administrator)
2019-06-08 13:54

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/132539f13e82bb748c976911dc22f493037bb741 [^]
(0028916)
heju (reporter)
2019-06-08 20:33

Tested latest version from git. Works as expected.

Thank you very much for fixing!

Nice weekend & best regards

- Issue History
Date Modified Username Field Change
2019-06-04 12:31 heju New Issue
2019-06-05 08:29 fman QA Team - Task Workflow Status => TBD
2019-06-05 08:29 fman Additional Information Updated View Revisions
2019-06-05 08:29 fman Note Added: 0028889
2019-06-05 11:37 heju Note Added: 0028891
2019-06-05 11:50 heju Note Edited: 0028891 View Revisions
2019-06-05 21:39 fman Note Added: 0028899
2019-06-06 05:20 heju Note Added: 0028903
2019-06-06 09:23 fman Note Added: 0028904
2019-06-07 07:47 heju Note Added: 0028906
2019-06-07 07:47 heju File Added: tprojCopy_screenshot.png
2019-06-07 07:49 heju Note Edited: 0028906 View Revisions
2019-06-08 08:30 heju Note Added: 0028908
2019-06-08 09:25 fman Note Edited: 0028908 View Revisions
2019-06-08 09:26 fman Note Added: 0028909
2019-06-08 09:57 heju Note Added: 0028911
2019-06-08 09:58 heju File Added: tl_req_setup.jpg
2019-06-08 09:59 heju Note Edited: 0028911 View Revisions
2019-06-08 10:40 heju Note Edited: 0028911 View Revisions
2019-06-08 13:54 fman Note Added: 0028913
2019-06-08 13:54 fman QA Team - Task Workflow Status TBD => READY FOR TESTING
2019-06-08 13:54 fman Status new => resolved
2019-06-08 13:54 fman Fixed in Version => 1.9.20 Raijing DEV
2019-06-08 13:54 fman Resolution open => fixed
2019-06-08 13:54 fman Assigned To => fman
2019-06-08 13:55 fman Relationship added child of 0008549
2019-06-08 20:33 heju Note Added: 0028916



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker