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

500 - Duplicate entry 'xxxx' for key 'ux_sessions_session_id'


After the last migration, v5.6.0.3853 and PHP7.2
we have met with some random
and non-replicable inconveniences

in our api we make multiple requests and the error is reproduced in an intermediate step
500 - Duplicate entry ‘xxxx-xxxx-xxxx-xxx-xxxxxxxxx’ for key ‘ux_sessions_session_id

Is anyone else having this error?
how do you solve it


TestRail Server (Patch) Released

Hi @guimiran - we’re happy to look into this for you, but need a better understanding of how the error is occurring, since it’s not something that we’ve seen during our own testing. Nor has it been reported by any of our other [server] customers.

Please can you post further details of the sequence of requests being made, and at which point or call the error occurs?

Alternatively, you can raise a help request via where one of the support team will be happy to assist you.



Hi sjpknight,

I hope to describe correctly and that you understand me.

Every night we make the same request, to create a TesTRail object, which contains in a hierarchical way: starting from the milestoneID (attributes), we get all the testplans that belong to the miletoneID, then we get all the runs that belong to each testplanID. then all the tests that belong to each runID. from each testID we get the caseID, and from each CaseID the fields and the steps.



I’ve seen the same error making a lot of GET API calls in succession. It doesn’t happen every time.


It is correct this issue does not always happen, but it is very necessary in our project that the GETAPI method is reliable because we make the successive GETAPI calls through continuous integration every night