Created By
Harel Malka
07/25/2012 3:33am

Subscribers (9)

BugsAdgroups created despite errors returned (causing duplicate ads to be created as result)

  • Status: Fixed
  • Priority: High
  • Updated: September 4, 2012 at 1:01pm
Latest response from Facebook
Stephen Doyle
This should now be resolved. Thanks for your patience.
Status changed to Fixed · September 4, 2012 at 1:01pm
Stephen Doyle
https://developers.facebook.com/bugs/261134480661698 is tracking the QueryLockTimeoutException - i didn't notice the other error was sufficiently different,
i'll assign this separately for the connection drops - in the meantime if you're creating the adgroups in batches, you may be able to use smaller batches to mitigate the errors as these issues seem to be occurring for large volumes of requests against the same account in a short time / single batch
Status changed to Assigned · Priority changed to High · July 25, 2012 at 8:36am
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'
1 person can reproduce this issue by following these steps
Repro