MantisBT - TestLink
View Issue Details
0006193TestLinkDatabase Postgrespublic2014-02-07 17:312014-04-25 17:38
nutek 
fman 
normalminoralways
closedfixed 
1.9.9 (2013 Q4 - bug fixing) 
1.9.10 (2014 Q1 - bug fixing) 
Potgres 9.2.4
All
5.4
READY FOR TESTING
0006193: DB Access Error after upgrade 1.9.7->1.9.8->1.9.9
As show on screenshot as i attached
No tags attached.
related to 0006197closed fman 1.9.8 Upgrade - req_coverage table 
child of 0006048closed fman Availables hot-fixes for 1.9.9 & How To get full fixed package from gitorious 
png snapshot1.png (177,515) 2014-02-07 17:31
http://mantis.testlink.org/file_download.php?file_id=3611&type=bug
png

png snapshot2.png (69,568) 2014-02-07 17:33
http://mantis.testlink.org/file_download.php?file_id=3612&type=bug
png

? fix_pgsql_db_1.9.8_db_schema_update.sql (1,950) 2014-02-11 17:41
http://mantis.testlink.org/file_download.php?file_id=3615&type=bug
Issue History
2014-02-07 17:31nutekNew Issue
2014-02-07 17:31nutekFile Added: snapshot1.png
2014-02-07 17:32nutekNote Added: 0020392
2014-02-07 17:33nutekFile Added: snapshot2.png
2014-02-07 19:27fmanNote Added: 0020398
2014-02-07 19:28fmanNote Edited: 0020398bug_revision_view_page.php?bugnote_id=20398#r3341
2014-02-07 19:28fmanNote Edited: 0020398bug_revision_view_page.php?bugnote_id=20398#r3342
2014-02-10 20:09lczubNote Added: 0020416
2014-02-10 20:55lczubNote Added: 0020417
2014-02-10 21:53fmanNote Added: 0020419
2014-02-10 21:55fmanNote View State: 0020419: public
2014-02-10 21:57fmanNote Added: 0020420
2014-02-10 21:57fmanQA Team - Task Workflow Status => READY FOR TESTING
2014-02-10 21:57fmanStatusnew => resolved
2014-02-10 21:57fmanFixed in Version => 1.9.10 (2014 Q1 - bug fixing)
2014-02-10 21:57fmanResolutionopen => fixed
2014-02-10 21:57fmanAssigned To => fman
2014-02-10 21:58fmanRelationship addedchild of 0006048
2014-02-11 16:51lczubNote Added: 0020423
2014-02-11 17:41lczubFile Added: fix_pgsql_db_1.9.8_db_schema_update.sql
2014-02-11 17:46lczubNote Added: 0020424
2014-02-11 19:13fmanNote Added: 0020425
2014-02-11 19:15fmanNote Edited: 0020425bug_revision_view_page.php?bugnote_id=20425#r3353
2014-02-11 19:20fmanIssue cloned: 0006197
2014-02-11 19:20fmanRelationship addedrelated to 0006197
2014-02-12 17:13nutekNote Added: 0020429
2014-04-25 17:38fmanNote Added: 0020839
2014-04-25 17:38fmanStatusresolved => closed

Notes
(0020392)
nutek   
2014-02-07 17:32   
Add logs from userlog24.log
(0020398)
fman   
2014-02-07 19:27   
(edited on: 2014-02-07 19:28)
unfortunately level of details provided is not enough.
(see forum for our guidelines). I do not work only with screenshots.

To do this kind of migration you have to follow the advice we have provided on forum:

1. migrate form 1.9.7 to 1.9.8 => test that everything is OK
2. migrate form 1.9.8 to 1.9.9 + apply latest available fixes (see issue on mantis regarding how to proceed) => test that everything is OK

have you looked for similar issues (i.e. regarding crash on requirements) before reporting ?

(0020416)
lczub   
2014-02-10 20:09   
I could reproduce this problem with an equal postgresql environment, upgraded from 1.9.7 via 1.9.8 to 1.9.9.

additional information:
DB Access Error already occurs with TL 1.9.8 and still exists with latest TL 1.9.10-DEV code from GITORIOUS (without performing additional upgrade steps)
With TL 1.9.8 it was possible to assign requirements to test cases, while DB Access Error are occurs.
With TL 1.9.10-DEV it is not possible any more.

Reproduction
Test Project Management
- Create new Project ProjA
  - Enabled Requirements Features
  - Active, Public
Requirement Specification
- Create Requirements Specification SRS-01 for Test Project ProjA
  - Type = User Specification
- Create Requirement REQ-01 for Req-Spec SRS01
  - Type Use Case
- select Requirement REQ-01
  - Requirement details are shown, but also presents the error message
      
 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ==============================================================================
#0 database->exec_query() called at [/usr/local/www/testlink-git/lib/functions/database.class.php:750]
#1 database->get_recordset() called at [/usr/local/www/testlink-git/lib/functions/requirement_mgr.class.php:687]
0000002 requirement_mgr->get_coverage() called at [/usr/local/www/testlink-git/lib/requirements/reqView.php:115]
0000003 initialize_gui() called at [/usr/local/www/testlink-git/lib/requirements/reqView.php:27]
 ==============================================================================

Test Specification
- create Test Suite TS-01 for Test Project ProjA
- create Test Case TC-01 for Test Suite TS-01

Assign Requirements
- expand tree, select Test Case TC-01
 
Behaviour TL 1.9.10-GIT
  - available requirements are shown, NO error message
  - assign requirement REQ-01 does not work, error message is presented
 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ==============================================================================
#0 database->exec_query() called at [/usr/local/www/testlink-git/lib/functions/requirement_mgr.class.php:1006]
#1 requirement_mgr->assign_to_tcase() called at [/usr/local/www/testlink-git/lib/requirements/reqTcAssign.php:235]
0000002 doSingleTestCaseOperation() called at [/usr/local/www/testlink-git/lib/requirements/reqTcAssign.php:54]
 ==============================================================================
   
Behaviour TL 1.9.8
  - available requirements are shown, but also presents the error message
  
 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ==============================================================================
#0 database->exec_query() called at [/usr/local/www/testlink-1.9.8/lib/functions/database.class.php:639]
#1 database->fetchRowsIntoMap() called at [/usr/local/www/testlink-1.9.8/lib/functions/requirement_spec_mgr.class.php:2239]
0000002 requirement_spec_mgr->getAssignedCoverage() called at [/usr/local/www/testlink-1.9.8/lib/requirements/reqTcAssign.php:305]
0000003 processTestCase() called at [/usr/local/www/testlink-1.9.8/lib/requirements/reqTcAssign.php:74]
 ==============================================================================
 
- assign and unassign the requirement REQ-01 works, but also presents the error message

 ==============================================================================
 DB Access Error - debug_print_backtrace() OUTPUT START
 ==============================================================================
#0 database->exec_query() called at [/usr/local/www/testlink-1.9.8/lib/functions/requirement_mgr.class.php:1000]
#1 requirement_mgr->assign_to_tcase() called at [/usr/local/www/testlink-1.9.8/lib/requirements/reqTcAssign.php:225]
0000002 doSingleTestCaseOperation() called at [/usr/local/www/testlink-1.9.8/lib/requirements/reqTcAssign.php:54]
 ==============================================================================
(0020417)
lczub   
2014-02-10 20:55   
The userlog files includes more details:
...
pg_query(): Query failed: FEHLER: Spalte author_id von Relation req_coverage existiert nicht
LINE 1: INSERT INTO req_coverage (req_id,testcase_id,author_id,creat...
                                                     ^ - in /usr/local/www/testlink-git/third_party/adodb/drivers/adodb-postgres7.inc.php - Line 167
...

Checking the structure of table req_coverage shows, it only has two fields
- req_id, testcase_id

The other fields
- author_id, creation_ts, review_requester_id, review_request_ts
defined in sql\postgres\testlink_create_tables.sql, does not exist.
(0020419)
fman   
2014-02-10 21:53   
just tested with latest code from gitoriuos worked as expected

1. create test project TPRJ01, with req management enabled
2. create test suite TS100
3. create inside TS100, TC-A and TC-B
4. create req spec - RSPEC-100
5. create inside RSPEC-100, REQ-01, REQ-02
6. assign REQ-01 and REQ-02 to TC-A
(0020420)
fman   
2014-02-10 21:57   
sql script that creates req_coverage table on 1.9.8 is wrong (there is a merge request on gitorious),
fields:
- author_id, creation_ts, review_requester_id, review_request_ts

are missing, and have bein added to a wrong table
(0020423)
lczub   
2014-02-11 16:51   
Hello fman,
your change https://gitorious.org/testlink-ga/testlink-code/commit/81fe9f55343a9785da9e637b3cfb6b981f6f1e2e [^] fixes the postgresql 1.9.8 upgrade.

Taking a look into the mssql 1.9.8 upgrade shows, that there are also no ALTER TABLE for the req_coverage table. Mustn't it be changed in an equal way like postgresql and mysql?
Luiko
(0020424)
lczub   
2014-02-11 17:46   
Hello fman,
I have added the script fix_pgsql_db_1.9.8_db_schema_update.sql, which removes the fields from the executions table and add them to the req_coverage table.

Hope that helps people like me, who has still capture new data and could not redo the 1.9.8 upgrade with the latest gitorious code.
After this fix, I was able to capture and assign requirements.
Luiko
(0020425)
fman   
2014-02-11 19:13   
(edited on: 2014-02-11 19:15)
@Luiko
thanks for your help

>> Taking a look into the mssql 1.9.8 upgrade shows, that there are also no
>> ALTER TABLE for the req_coverage table. Mustn't it be changed in an equal way >> like postgresql and mysql?
I'm going to fix it, but as you can understand if someone report issue on postgres due to available time I can only focus on this db.

(0020429)
nutek   
2014-02-12 17:13   
Thank You fman! Im add your sql code to database. Now everythink works ok!
(0020839)
fman   
2014-04-25 17:38   
1.9.10 released