Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Add the Case Fields doesn't response

This problem occurred with TestRail, that I installed my own server.
I have added the Case Fields item and it is not finished forever.

I found the data is existed by quering the db “fiends” table.

mysql> select * from fields
    -> ;
+----+----------------------+-----------------------------+-----------+-------------------------------------------+------------------------------------------------------------------------------------------------------------+---------+-------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------+-----------+-----------+-------------+
| id | name                 | system_name                 | entity_id | label                                     | description                                                                                                | type_id | location_id | display_order | configs                                                                                                                                                                                                                                                                                                                                                                                               | is_multi | is_active | status_id | is_system | include_all |
+----+----------------------+-----------------------------+-----------+-------------------------------------------+------------------------------------------------------------------------------------------------------------+---------+-------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------+-----------+-----------+-------------+
|  1 | preconds             | custom_preconds             |         1 | Preconditions                             | The preconditions of this test case. Reference other test cases with [C#] (e.g. [C17]).                    |       3 |           2 |             2 | [{"context":{"is_global":true,"project_ids":[]},"options":{"is_required":false,"default_value":"","format":"markdown","rows":"3"},"id":"0e4b3824-6daa-46fb-b7e9-b9250fad76c7"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           0 |
~~~~~~~
| 41 | playback_status      | custom_playback_status      |         1 | playback_status                           | NULL                                                                                                       |       6 |           1 |             9 | []                                                                                                                                                                                                                                                                                                                                                                                                    |        0 |         1 |         3 |         0 |           1 |
| 42 | post_data            | custom_post_data            |         1 | post_data                                 | NULL                                                                                                       |       3 |           2 |            20 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"89ab2f12-3ad6-4a29-bd94-920e055cc712"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 43 | auto_listen          | custom_auto_listen          |         1 | auto_listen                               | NULL                                                                                                       |       2 |           1 |             6 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"0"},"id":"b95f582f-3939-49a0-965c-553d37debd69"}]                                                                                                                                                                                                                                                 |        0 |         1 |         1 |         0 |           1 |
| 44 | output_speech        | custom_output_speech        |         1 | output_speech_cic                         | NULL                                                                                                       |       3 |           2 |            21 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"10cb98f6-9c19-4768-a296-00d208c24814"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 45 | domain               | custom_domain               |         1 | domain_cic                                | NULL                                                                                                       |       3 |           2 |            22 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"1b2069ed-2b45-4350-81e3-39dc476d2300"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 46 | intent               | custom_intent               |         1 | intent_cic                                | NULL                                                                                                       |       3 |           2 |            23 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"6a338856-3a70-4bd8-88f2-4e4fa25a479e"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 47 | domain_naverapp      | custom_domain_naverapp      |         1 | domain_naverapp                           | NULL                                                                                                       |       3 |           2 |            24 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"bea28af2-67d1-4274-8129-d1d76df27409"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 48 | intent_naverapp      | custom_intent_naverapp      |         1 | intent_naverapp                           | NULL                                                                                                       |       3 |           2 |            25 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"ec03f261-a765-4830-8346-bd27859d71b4"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 49 | uri                  | custom_uri                  |         1 | uri                                       | NULL                                                                                                       |       3 |           2 |            26 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"a80a62df-d58c-419d-8229-7cc6a6e3de56"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 51 | iot_devicename       | custom_iot_devicename       |         1 | iot_devicename                            | NULL                                                                                                       |       3 |           2 |            27 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"markdown","rows":""},"id":"abfa3b70-37e0-4d5a-9bfe-9f3cb61d80a9"}]                                                                                                                                                                                                                    |        0 |         1 |         1 |         0 |           1 |
| 52 | iot_devicespecifier  | custom_iot_devicespecifier  |         1 | iot_devicespecifier                       | NULL                                                                                                       |       3 |           2 |            28 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"e4a5da50-f7af-49a0-b6db-e1e03e1e5b16"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 53 | iot_devicevalue      | custom_iot_devicevalue      |         1 | iot_devicevalue                           | NULL                                                                                                       |       3 |           2 |            29 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"7939f76a-51ff-4d1e-802d-13d2e614fe27"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 54 | iot_devicetype       | custom_iot_devicetype       |         1 | iot_devicetype                            | NULL                                                                                                       |       3 |           2 |            30 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"markdown","rows":""},"id":"cbed6f46-ccf2-44f8-9fa5-fc25e06d54ae"}]                                                                                                                                                                                                                    |        0 |         1 |         1 |         0 |           1 |
| 55 | playbackstatus       | custom_playbackstatus       |         1 | playbackstatus                            | NULL                                                                                                       |       6 |           1 |             7 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"1","items":"1, STOPPED\n2, PLAYING\n3, PAUSED"},"id":"f2b5210e-1d1a-4d6b-9d67-23bc8f1bdd77"}]                                                                                                                                                                                                     |        0 |         1 |         1 |         0 |           1 |
| 56 | iot_command          | custom_iot_command          |         1 | iot_command                               | NULL                                                                                                       |       3 |           2 |            31 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"","format":"plain","rows":""},"id":"3c813cc2-eaa5-449a-9a2f-30a939f92aac"}]                                                                                                                                                                                                                       |        0 |         1 |         1 |         0 |           1 |
| 57 | multi_turn           | custom_multi_turn           |         1 | Multi-turn                                | 해당 케이스가 멀티턴 / 연속어가 포함되어 있는지 구분                                                       |       5 |           1 |            10 | [{"context":{"is_global":false,"project_ids":[110]},"options":{"is_required":false,"default_value":"0"},"id":"fe299e0f-aa72-4c81-90a7-37293dc25384"}]                                                                                                                                                                                                                                                 |        0 |         1 |         3 |         0 |           1 |
| 58 | test_type            | custom_test_type            |         1 | test_type                                 | NULL                                                                                                       |       6 |           1 |            11 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":true,"default_value":"1","items":"1, Full\n2, Regression"},"id":"3d7eb91b-4281-4bfa-b152-7833ea0844e3"}]                                                                                                                                                                                                                 |        0 |         1 |         3 |         0 |           1 |
| 59 | test_suite           | custom_test_suite           |         1 | test_suite                                | NULL                                                                                                       |       6 |           1 |            12 | [{"context":{"is_global":false,"project_ids":[130]},"options":{"is_required":false,"default_value":"1","items":"1, Full\n2, Regression"},"id":"060273ca-a905-4cac-b405-bcf9f39202af"}]                                                                                                                                                                                                                |        0 |         1 |         1 |         0 |           1 |
+----+----------------------+-----------------------------+-----------+-------------------------------------------+------------------------------------------------------------------------------------------------------------+---------+-------------+---------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------+-----------+-----------+-------------+
47 rows in set (0.00 sec)

But, It seems strange that it seems to be hanging on the UI, and the actual field is not visible when creating a test case.

Hey there,

Thanks for the post. It looks like the custom fields you were creating became stuck upon creation, or are taking an extremely long time to complete (sometimes with very large databases the process can take hours).

This generally happens if the PHP memory limit is very small on your hosting server, or if your TestRail instance has a very large database with a large number of test cases or active test runs where the new field(s) would be added. If the cases fail to be added correctly, it may be necessary to delete the entries from the database directly, then try again.

In order to remove the problematic fields, you’ll first want use the following query to identify all of the fields in a stuck state (with status_id 3)

SELECT * FROM fields WHERE status_id = 3;

That will then provide you with the field IDs that can be removed. Please note, we would highly recommend making a full backup of your database before making any manual changes so you can easily revert if any issues arise. If you need assistance with removing the database entries, please reach out via email to contact@gurock.com and we’ll be happy to assist.

Once you’ve got the fields removed, before attempting to create them again you should first ensure that the PHP memory limit is not set too low. You can find more info on that here:

http://docs.gurock.com/testrail-faq/system-memory-limit

You may also want to go through your TestRail installation and close any un-needed active test runs or plans using the lock icon on the test run overview screen. This can have a noticeable impact on performance when adding new test cases or case fields, as new fields are added to each test case, and each instance of a test case that is within an open run.

I hope that helps! If you have any further questions or issues please reach out to the support team via email at contact@gurock.com.