Recently, when synching up adverts we run into a scenario where the creation of an adgroup returns an error from Facebook and we don't get back an adgroup_id, but actually the ad is created just fine on Facebook.
We then automatically try again a few minutes later, and if no error is received again, the ad is then created and we save the adgroup id against our local copy. However since the original ad was created ok, we now have a duplicate advert created in Facebook. This happens quite a lot recently and we have worries customers.
I understand there are reports of this happening in batched create calls, but we are not batching our create calls.
We need to be assured that if an error is returned an adgroup is NOT created, just as much as if an adgroup id is returned an adgroup IS created.
This, by the way is more common with adgroups but we've seen this happen to campaigns as well.
The provided adgroup ids are a recent example, in an account riddled with those cases. This is VERY inconsistent and appears to be random as far as which ads would go up and which would error. There is no way to reliably replicate it short of creating a large number ads (non batched).
The errors received are not always the same, though the result is - the adgroup is created despite an error being returned. A more prominent error is this:
QueryConnectionException: connection dropped; 'SELECT ag.id FROM adgroups as ag INNER JOIN campaigns c ON ag.parent_campaign_id = c.id WHERE c.parent_account_id = 113129355494167 AND ag.time_created + 60 < (select time_created from adgroups where id = 6004797611902) AND ag.run_status != 0 LIMIT 2'
But we've seen this occur with "An unknown error occurred" and "Could not save creative" errors.
Here is one of the errors received on a campaign:
QueryLockTimeoutException: lock timeout; 'SELECT c.id, c.friendly_name, c.run_status, c.time_start, c.time_stop, c.time_created, c.time_updated, c.topline_id, c.inflation, c.external_bid, c.parent_account_id AS account_id FROM campaigns AS c WHERE c.id IN (6004797471702) FOR UPDATE'