On version 5.6.0, using api v3. Not sure if something recently changed in our environment, but as of a couple of days ago, running the contact create api (via rest or the explorer) causes a "DB Error: no database selected" error when using the "dupe_check" parameter.
For example, if I run this call, the contact is created and api returns successfully:
https://domain.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api_key=userkey&key=sitekey&json={"contact_type":"Individual","first_name":"pol","last_name":"vor","email":"povor@gmail.com"}
But if I run this call, which just has "dupe_check:1" added to it, it fails:
https://domain.org/sites/all/modules/civicrm/extern/rest.php?entity=Contact&action=create&api_key=userkey&key=sitekey&json={"contact_type":"Individual","first_name":"pol","last_name":"vor","email":"povor@gmail.com","dupe_check":1}
The error details are as follows (from the API Explorer, but it's the same running from a script):
{
"code": -14,
"error_message": "DB Error: no database selected",
"mode": 16,
"debug_info": "DROP TEMPORARY TABLE IF EXISTS dedupe [nativecode=2006 ** MySQL server has gone away]",
"type": "DB_Error",
"user_info": "DROP TEMPORARY TABLE IF EXISTS dedupe [nativecode=2006 ** MySQL server has gone away]",
"to_string": "[db_error: message=\"DB Error: no database selected\" code=-14 mode=callback callback=CRM_Utils_REST::fatal prefix=\"\" info=\"DROP TEMPORARY TABLE IF EXISTS dedupe [nativecode=2006 ** MySQL server has gone away]\"]",
"is_error": 1
}
Any ideas on what may be causing this? I have a workaround in production for now, but this is a really useful feature to have in the API.