[#294] Serialization failure

Migrated from Redmine #294 | Author: Anonymous
Status: New | Priority: Normal | Created: 2018-11-27


I get this error randomly when I call setWorkday info to set days off.

JSONRpcClientException {
code: -32000,
message: ‘SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction’ }

Here is the request :

{
“jsonrpc”: “2.0”,
“method”: “setWorkDayInfo”,
“params”:
[{
“start_time”:“”,
“end_time”:“”,
“is_day_off”:1,
“breaktime”:[{“start_time”:“”, “end_time”:“”}],
“index”:“2”,
“name”:“”,
“date”:“”,
“unit_group_id”:“109”
“event_id”:“”
}],
“id”: 1
}

At first I thought it was a throttling issue. When I send 5 requests very quickly they all get this error but when I space them out by 3 seconds the occurrence is less often but still happens with at least 1 out of ten calls. We are setting the availability of the provider to a day off on Tuesday.

Anonymous wrote:

https://dev.mysql.com/doc/refman/5.6/en/server-error-reference.html#error_er_lock_deadlock It looks like an error with your database.

Redmine Admin wrote:

You need to pass date and name

Anonymous wrote:

I set the name to Monday and the index is 1 with the request below. However, I still get the same error. Setting the date makes it a “special day” and I want to set it as recurring which works 90% of the time but sometimes gives this (above) error.

{
“jsonrpc”: “2.0”,
“method”: “setWorkDayInfo”,
“params”:
[{
“start_time”:“”,
“end_time”:“”,
“is_day_off”:1,
“breaktime”:[{“start_time”:“”, “end_time”:“”}],
“index”:“1”,
“name”:“Monday”,
“date”:“”,
“unit_group_id”:“109”
“event_id”:“”
}],
“id”: 1
}

Redmine Admin wrote:

Hi, we need more data from you please.
How often do you call this function?
Do you have many bookings at this account?

Anonymous wrote:

I call the function once for each day of the week (7 times) when we first set up the service provider. This effectively wipes out their availability to zero to start, which is what we need. I’m calling the function once every 3.5 seconds because calling it faster produced far more errors however it still errors out regularly (one out of every 7 to 10 times) no matter how slow we cal your API. Any pointers would be greatly appreciated.

Anonymous wrote:

The provider is brand new when we create them and get the errors. We do have a lot of booking on our company account but far less than the amount we are paying for.

Redmine Admin wrote:

Thank you for answers. We will investigate this problem