MantisBT - TestLink
View Issue Details
0005534TestLinkUser Interface Generalpublic2013-02-19 12:202019-06-12 07:20
Lukas Mencl 
x86-64Windows 8Pro 64-bit
1.9.3 (2011 Q3 - bug fixing) 
Firefox 18.0.2
0005534: Testlink web interface stops working - Size of a request header field exceeds server limit.
Testlink web interface stops working after about two weeks of usage. I need to delete all testlink related cookies to get it working again.

It seems that this issue is only Firefox related as other people using Firefox in the company have also experienced it but people using IE or Chrome have not.

The following error is displayed in Firefox browser instead of content when the issue appear:

Bad Request

Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

Cookie: TL_lastTestPlanForUserID_1=59336; ys-test_exec_build_id_533_platform_id_141_ext-comp-1001=a%3As%253A/54087; TL_lastTestProjectForUserID_75=2; ys-test_exec_build_id_608_platform_id_139_ext-comp-1001=a%3As%253A/2; ys-test_exec_build_id_629_ext-comp-1001=a%3As%253A/2/2244/58502/58504/58505%5Es%253A/2/2244/58502/58504/58509%5Es%253A/2/2244/58502/58504/58513%5Es%253A/2/2244/58502/58504/58517%5Es%253A/2/2244/58502/58504/58522%5Es%253A/2/2244/58502/58527/58528%5Es%253A/2/2244/58502/58527/58532%5Es%253A/2/2244/58502/58527/58536%5Es%253A/2/2244/58502/58527/58541%5Es%253A/2/2244/58502/58527/58546%5Es%253A/2/2244/58502/58527/58551%5Es%253A/2/2244/58502/58527/58556%5Es%253A/2/2244/58502/58527/58560%5Es%253A/2/2244/58502/58527/58566%5Es%253A/2/2244/58502/58527/58571%5Es%253A/2/2244/58502/58527/58576%5Es%253A/2/2244/58502/58527/58581%5Es%253A/2/2244/58502/58527/58585%5Es%253A/2/2244/58502/58527/58589%5Es%253A/2/2244/58502/58593/58594%5Es%253A/2/2244/58502/58593/58601%5Es%253A/2/2244/58502/58593/58608%5Es%253A/2/2244/58502/58593/58615%5Es%253A/2/2244/58502/58593/58622%5Es%253A/2/2244/58502/58593/58629%5Es%253A/2/2244/58502/58593/58636%5Es%253A/2/2244/58502/58593/58643%5Es%253A/2/2244/58502/58593/58648%5Es%253A/2/2244/58502/58593/58653%5Es%253A/2/2244/58502/58658/58659%5Es%253A/2/2244/58502/58658/58665%5Es%253A/2/2244/58502/58658/58675%5Es%253A/2/2244/58502/58658/58681%5Es%253A/2/2244/58502/58658/58685%5Es%253A/2/2244/58502/58689/58690%5Es%253A/2/2244/58502/58689/58695%5Es%253A/2/2244/58502/58689/58699%5Es%253A/2/2244/58502/58689/58704%5Es%253A/2/2244/58502/58689/58709%5Es%253A/2/2244/58502/58689/58715%5Es%253A/2/2244/58502/58689/58722%5Es%253A/2/2244/58502/58689/58729%5Es%253A/2/2244/58502/58689/58735%5Es%253A/2/2244/58502/58689/58739%5Es%253A/2/2244/58502/58745/58746%5Es%253A/2/2244/58502/58745/58754%5Es%253A/2/2244/58502/58745/58760%5Es%253A/2/2244/58502/58745/58769%5Es%253A/2/2244/58502/58745/58779%5Es%253A/2/2244/58502/58745/58790%5Es%253A/2/2244/58502/58745/58795%5Es%253A/2/2244/58502/58745/58805%5Es%253A/2/2244/58502/58745/58815%5Es%253A/2/2244/58502/58745/58825%5Es%253A/2/2244/58502/58745/58835%5Es%253A/2/2244/58502/58745/58841%5Es%253A/2/2244/58502/58745/58851%5Es%253A/2/2244/58502/58745/58860%5Es%253A/2/2244/58502/58745/58872%5Es%253A/2/2244/58502/58745/58875; ys-tl_exec_filter=o%3Acollapsed%3Db%253A0; ys-tl_exec_settings=o%3Acollapsed%3Db%253A1; TL_execSetResults_tpn_view_status=0; TL_execSetResults_bn_view_status=0; TL_execSetResults_platform_notes_view_status=0; TL_execSetResults_tsdetails_view_status=0; TCExecPopupWidth=753; TCExecPopupHeight=1759; ys-test_exec_build_id_620_platform_id_1_ext-comp-1001=a%3As%253A/2; ys-test_exec_build_id_620_platform_id_157_ext-comp-1001=a%3As%253A/2/955/37791/37792/38123%5Es%253A/2/955/37791/37792/49351%5Es%253A/2/955/37791/37792/37800%5Es%253A/2/955/37791/37792/37813%5Es%253A/2/955/37791/37792/49268%5Es%253A/2/955/37791/37792/48552%5Es%253A/2/955/37791/37792/49258%5Es%253A/2/955/37791/37792/49276%5Es%253A/2/955/37791/37792/49356%5Es%253A/2/955/37791/37792/49287%5Es%253A/2/955/37791/37792/48677%5Es%253A/2/955/37791/37792/38094%5Es%253A/2/955/37791/37792/48631%5Es%253A/2/955/37791/37792/38017%5Es%253A/2/955/37791/37792/49304%5Es%253A/2/955/37791/37792/49369%5Es%253A/2/955/37791/37792/38081%5Es%253A/2/955/37791/37792/38070%5Es%253A/2/955/37791/37792/49700%5Es%253A/2/955/37791/37829/38121%5Es%253A/2/955/37791/37829/38064%5Es%253A/2/955/37791/37829/48620%5Es%253A/2/955/37791/37829/49867%5Es%253A/2/955/37791/37829/37895%5Es%253A/2/955/37791/37829/48599%5Es%253A/2/955/37791/37829/37888%5Es%253A/2/955/37791/37829/48576%5Es%253A/2/955/37791/37829/48765%5Es%253A/2/955/37791/37829/49380%5Es%253A/2/955/37791/37829/48751%5Es%253A/2/955/37791/37829/37929%5Es%253A/2/955/37791/37829/37934%5Es%253A/2/955/37791/37829/37947%5Es%253A/2/955/37791/37829/48640%5Es%253A/2/955/37791/37829/49728%5Es%253A/2/955/37791/37829/37845%5Es%253A/2/955/37791/37829/37858; ys-test_exec_build_id_620_platform_id_21_ext-comp-1001=a%3As%253A/2/2244/2245/2530/2531%5Es%253A/2/2244/2245/2530/2539%5Es%253A/2/2244/2245/2530/2543%5Es%253A/2/955/37791/37792/38123%5Es%253A/2/955/37791/37792/49351%5Es%253A/2/955/37791/37792/37800%5Es%253A/2/955/37791/37792/37813%5Es%253A/2/955/37791/37792/49268%5Es%253A/2/955/37791/37792/48552%5Es%253A/2/955/37791/37792/49258%5Es%253A/2/955/37791/37792/49276%5Es%253A/2/955/37791/37792/49356%5Es%253A/2/955/37791/37792/49287%5Es%253A/2/955/37791/37792/48677%5Es%253A/2/955/37791/37792/38094%5Es%253A/2/955/37791/37792/48631%5Es%253A/2/955/37791/37792/38017%5Es%253A/2/955/37791/37792/49697%5Es%253A/2/955/37791/37792/49304%5Es%253A/2/955/37791/37792/49369%5Es%253A/2/955/37791/37792/38081%5Es%253A/2/955/37791/37792/38070%5Es%253A/2/955/37791/37792/49700%5Es%253A/2/955/37791/37829/38121%5Es%253A/2/955/37791/37829/38064%5Es%253A/2/955/37791/37829/48620%5Es%253A/2/955/37791/37829/49867%5Es%253A/2/955/37791/37829/37895%5Es%253A/2/955/37791/37829/48599%5Es%253A/2/955/37791/37829/37888%5Es%253A/2/955/37791/37829/48576%5Es%253A/2/955/37791/37829/48765%5Es%253A/2/955/37791/37829/49380%5Es%253A/2/955/37791/37829/48751%5Es%253A/2/955/37791/37829/37929%5Es%253A/2/955/37791/37829/37934%5Es%253A/2/955/37791/37829/37947%5Es%253A/2/955/37791/37829/48640%5Es%253A/2/955/37791/37829/48637%5Es%253A/2/955/37791/37829/49728%5Es%253A/2/955/37791/37829/37845%5Es%253A/2/955/37791/37829/37858%5Es%253A/2/955/956/59905/59906%5Es%253A/2/955/956/59905/59909%5Es%253A/2/955/956/59905/59912%5Es%253A/2/955/956/59905/59914%5Es%

See also attached screenshot.
I am not able to induce it on demand but this issue reapears after about two weeks of testlink usage. I had started using testlink in the middle of January 2013 and have met this issue three times so far.

- Use testlink to test regarding test scenarios, sometimes modify some test steps.
- Computer is usually hibernated at the end of each day but there are some restarts or shut downs during this period (so the computer and Firefox is not running all the time).
- After about two weeks of usage, when you try to perform an action (move to next test step, change test scenario, ...), the issue appears.
I am not sure if the issue is related to local testlink configuration - I have not found this issue reported so we might be the only company experiencing it.

Let me know if you need additional information.
No tags attached.
duplicate of 0003714assigned  Testlink not usable anymore after cookie size (request header) exceeds server limit 
related to 0007180new  LATEST GITHUB CODE/Bad Request in the test execution area after changing the project, expand the tree and click on the test case 
png testlink_bad_request.png (26,093) 2013-02-19 12:20

? ext-all.js (717,547) 2015-07-20 16:08
Issue History
2013-02-19 12:20Lukas MenclNew Issue
2013-02-19 12:20Lukas MenclFile Added: testlink_bad_request.png
2013-02-19 20:16fmanNote Added: 0018351
2013-02-19 20:17fmanStatusnew => feedback
2013-02-20 08:36Lukas MenclNote Added: 0018358
2013-02-20 08:36Lukas MenclStatusfeedback => new
2013-02-23 16:28moormanmNote Added: 0018365
2013-02-23 17:53moormanmNote Edited: 0018365bug_revision_view_page.php?bugnote_id=18365#r2451
2013-02-23 17:54moormanmNote Edited: 0018365bug_revision_view_page.php?bugnote_id=18365#r2452
2013-02-23 17:58fmanNote Added: 0018366
2013-02-23 18:15fmanNote Added: 0018367
2013-02-27 07:17JulianNote Added: 0018375
2013-03-17 16:31fmanRelationship addedduplicate of 0003714
2014-08-27 13:23elizkNote Added: 0021513
2014-08-31 17:24fmanNote Added: 0021523
2015-02-16 09:35modirNote Added: 0022717
2015-02-16 09:52fmanNote Added: 0022718
2015-02-19 10:42modirNote Added: 0022743
2015-02-19 10:51fmanNote Added: 0022746
2015-06-10 12:32modirNote Added: 0023462
2015-06-10 13:50fmanNote Added: 0023463
2015-06-29 18:30fmanRelationship addedrelated to 0007180
2015-07-02 15:48nitramfNote Added: 0023575
2015-07-20 13:57nitramfNote Added: 0023636
2015-07-20 15:03nitramfNote Edited: 0023636bug_revision_view_page.php?bugnote_id=23636#r4509
2015-07-20 16:08nitramfFile Added: ext-all.js
2015-07-20 16:10nitramfNote Added: 0023637
2015-07-20 16:10nitramfNote Edited: 0023637bug_revision_view_page.php?bugnote_id=23637#r4511
2015-07-20 16:14modirNote Added: 0023638
2016-04-27 18:18mwbeattyNote Added: 0024759
2016-04-28 13:31fmanNote Added: 0024760
2019-04-08 07:50imsaNote Added: 0028681
2019-04-08 07:52imsaNote Edited: 0028681bug_revision_view_page.php?bugnote_id=28681#r5792
2019-04-08 15:07fmanNote Added: 0028685
2019-04-09 05:14imsaNote Added: 0028686
2019-04-09 06:46imsaNote Edited: 0028686bug_revision_view_page.php?bugnote_id=28686#r5794
2019-04-09 06:48imsaNote Edited: 0028686bug_revision_view_page.php?bugnote_id=28686#r5795
2019-04-11 21:09fmanNote Added: 0028705
2019-04-12 05:40imsaNote Added: 0028709
2019-04-12 09:48fmanNote Added: 0028712
2019-05-14 09:12imsaNote Added: 0028824
2019-06-12 07:20hejuNote Added: 0028931

2013-02-19 20:16   
1. additional info:
there is no indication about number of items you were trying to manage, may be there a limit exists

2. in any case you need to upgrade to 1.9.5 and retest
Lukas Mencl   
2013-02-20 08:36   
Ad 1.
I am not sure what exactly you mean but there are some numbers:
- We have got 8 testlink test projects which have 5635 test cases in total.
- I was working (=testing regarding test plan) in test project which has 3862 test cases in total on test plan with 34 test cases when the issue appeared.
- I was not modifying any steps, I simply wanted to move to next test case when the issue appeared.

Ad 2.
We will try to install 1.9.5 and retest when we find time for it. I will let you know about the result.
2013-02-23 16:28   
(edited on: 2013-02-23 17:54)
It appears that the large header data stems from the save/restore tree state logic in tcTree.js. Is there a more efficient way to store the collapse/expand tree state?

EDIT: to reproduce this behavior, click 'expand all' on a test case tree panel that has a large number of nested testcases and then click on one of them. Examine the resultant header data in the user request.

2013-02-23 17:58   
>> Is there a more efficient way to store the collapse/expand tree state?
do not know.
we have taken example from EXT-JS version 3.x years ago.
Some research on ext-js site is needed,
right now think only workaround will be trying to increase cookie size if possible
2013-02-23 18:15   
The silly workaround to apply is to clean up cookies on browser.
Do not think that loosing tree status (meaning what was opened on my last navigation) will be a great drawback
2013-02-27 07:17   
Duplicate of 0003714
2014-08-27 13:23   
we just faced this issue leading to server crashing - increasing the cookie size is a poor workaround.
2014-08-31 17:24   
>> we just faced this issue leading to server crashing -
>> increasing the cookie size is a poor workaround.
Ready to receive any kind of implementation that will solve the issue.
2015-02-16 09:35   
The problem still exists in 1.9.13. (We have about 7000 test cases.)

I can not give the code right now but the solutions would be like this:

Instead of saving the data in the cookie you would save it in a javascript variable. The variable could then be sent as a JSON object with a POST request to the server where it can be saved for later use. When a new page is loaded the values can be fetched again as a JSON object.

I could help and provide some code but I would need more background information on why this is saved at all, etc.
2015-02-16 09:52   
Ideas are great, working solutions are better.

>> I could help and provide some code but I would need more background
>> information on why this is saved at all
hmm may be to restore tree status ?
2015-02-19 10:42   
> hmm may be to restore tree status ?

I need more information. Do you do anything on the server side with this information? Or is it only used client side?
2015-02-19 10:51   
>> I need more information. Do you do anything on the server side with this
>> information?
What do you mean?
how this can change your approach?
You need to read the code, and understand this, I can not explain any step done
on code on several notes.
2015-06-10 12:32   
> What do you mean?

Does any PHP code do anything with those information in the cookie?

> how this can change your approach?

If the PHP code on the server is doing nothing with the cookie information then I am a lot more flexible on choosing the best solution on the client side. And I don't have to send any information to the server.

> You need to read the code, and understand this, I can not explain any step done on code on several notes.

I hoped that there would be some code documentation like e.g. PHPdoc that would help me to learn the code faster. Since there is nothing like this I ask you to help me getting faster a understanding of the code. At least of the code which I need to solve this problem. I will read through the code in this case.
2015-06-10 13:50   
cookie is used ONLY to maintain tree status.
2015-07-02 15:48   
I have the same problems in 1.9.13

Standard testlink, happens sometimes if I switch between Testprojects.

My guess is that the new tree data gets appended, but it should replace the old path.

The path name gets bigger and bigger
2015-07-20 13:57   
(edited on: 2015-07-20 15:03)
The cookie size exceeds 4kb. So how to solve this? Is it possible to work without cookies? (exept the login cookie)

2015-07-20 16:10   
I have uploaded a solution.
The path of the file is testlink/third_party/ext-js/

All I did is to do a substring from 0 to 3000 to limit the cookie size to 3kb. [^]

2015-07-20 16:14   
@nitramf: I don't think that limiting the size like this is a good solution. Better would be to save it in the localStorage instead of the cookie.

Here is more information about localStorage: [^]

I wanted to implement this myself but I need to wait till my client approves the money for it.
2016-04-27 18:18   
Is there any progress on this issue? We are having issues daily and it is impeding our project.
2016-04-28 13:31   
no progress, too many ideas but no one has done other than offer and idea, and sit waiting for resolution.
workaround => stop saving tree state in cookie.
any help is welcomed
2019-04-08 07:50   
(edited on: 2019-04-08 07:52)
We are working with Testlink for our projects and some getting very big, we did not meet this BadRequest problem.
The cookies were getting too big.
Also, I developed a workaround: I delete cookies when changing projects.
If you want, I can post the details of this solution to you, if it suits you, that you integrate it in your future version.

I said that I had unsuccessfully tested the nitramf solution on the modified .js

Best regards
Y.A for IMSA

2019-04-08 15:07   
please provide your code

2019-04-09 05:14   
(edited on: 2019-04-09 06:48)
My code is simple :

 * Fixbug BadRequest
 * I could have made a single loop
 * to delete cookies but I preferred
 * to separate them
    if (is_array($_COOKIE)) {
        foreach ($_COOKIE as $key => $value) {
        // Cookies for test case
            if (preg_match (" /^ys-edit_tc_tproject_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for requirement
            if (preg_match (" /^ys-req_specification_tproject_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for testplan
            if (preg_match (" /^ys-testplan_tplan_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for execution
            if (preg_match (" /^ys-test_exec_build_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for tcplan
            if (preg_match (" /^ys-add_remove_tc_tplan_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');

I had this in this file :

We have 2.500 users, and i have no bad feedback for this modification.
And this bad request error is missing.

The code is tested on testlink 1.9.14 and 1.9.17

Best regards

2019-04-11 21:09   
@imsa 2500 users is a big number, do you never though about making a donation to support test link development?
2019-04-12 05:40   
I'm just recipient. But I send your request to the head of department
Best regards
2019-04-12 09:48   
2019-05-14 09:12   
The final solution detention is hadding this code :

 * Fixbug BadRequest
 * I could have made a single loop
 * to delete cookies but I preferred
 * to separate them
    if (is_array($_COOKIE)) {
        foreach ($_COOKIE as $key => $value) {
        // Cookies for test case
            if (preg_match (" /^ys-edit_tc_tproject_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for requirement
            if (preg_match (" /^ys-req_specification_tproject_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for testplan
            if (preg_match (" /^ys-testplan_tplan_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for execution
            if (preg_match (" /^ys-test_exec_build_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // Cookies for tcplan
            if (preg_match (" /^ys-add_remove_tc_tplan_id_/i ", $key)) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');
        // All Cookies
            if (preg_match (" /^TL_execSetResults_bn_view_status/i ", $key) OR
                preg_match (" /^TL_execSetResults_platform_notes_view_status/i ", $key) OR
                preg_match (" /^TL_execSetResults_tpn_view_status/i ", $key) OR
                preg_match (" /^TL_execSetResults_tsdetails_view_status/i ", $key) OR
                preg_match (" /^TL_lastTestPlanForUserID_/i ", $key) OR
                preg_match (" /^TCEditPopupWidth/i ", $key) OR
                preg_match (" /^TCEditPopupHeight/i ", $key) OR
                preg_match (" /^TCExecPopupHeight/i ", $key) OR
                preg_match (" /^TCExecPopupWidth/i ", $key) OR
                preg_match (" /^ReqPopupWidth/i ", $key) OR
                preg_match (" /^ReqPopupHeight/i ", $key) OR
                preg_match (" /^ys-tl_exec_settings/i ", $key) OR
                preg_match (" /^execHistoryPopupHeight/i ", $key) OR
                preg_match (" /^execHistoryPopupWidth/i ", $key)
                // preg_match (" /^XXX/i ", $key) OR
                ) {
            // Delete cookie
                setcookie($key, '', time() - 36000000, '/');

In files :
==> upper : $args = init_args();

==> upper : $gui->args = $control->get_argument_string() . '&activity=addTC';

==> upper : testlinkInitPage($db);

Important notice : in file lib/execute/execNavigator.php, desactivate these lines :

        // Cookies for execution
            // if (preg_match (" /^ys-test_exec_build_id_/i ", $key)) {
            // Delete cookie
            // setcookie($key, '', time() - 36000000, '/');
            // }


                // preg_match (" /^ys-tl_exec_settings/i ", $key) OR

Note : i quit compagny in end this week. A collaborate followed this.
Best regards
2019-06-12 07:20   
Dear TestLink Team,

just stumbled into the same issue with TL 1.9.20

Can the solution above be merged to git, would be nice.