tap-facebook
tap-facebook copied to clipboard
tap-facebook does not reattempt async report retrieval upon encountering a 400 status response
According to this bug report Facebook devs suggest that "<3% is an acceptable ratio and we recommend retries" when async report retrieval fails.
When this issue is encountered, job's will show as 100% complete but attempts to retrieve them return the following scrubbed error:
Status: 400
Response:
{
"error": {
"type": "OAuthException",
"error_user_title": "Loading Async Ads Report Failed",
"message": "Error accessing adreport job.",
"code": 2601,
"error_subcode": 1815107,
"fbtrace_id": "xxxxxxxxxxx",
"error_user_msg": "Sorry, the report cannot be loaded successfully. Please check if your job status is completed instead of failed or running before fetching the data.",
"is_transient": true
Currently the tap hard-fails on the occurrence of these errors, as the retry logic is distinct from the response for "complete" jobs:
eg:
2018-06-22 03:00:14,969Z tap - INFO Job Not Started, 0% done
2018-06-22 03:00:14,970Z tap - INFO sleeping for 10 seconds until job is done
2018-06-22 03:00:25,019Z tap - INFO Job Completed, 100% done
2018-06-22 03:00:25,020Z tap - INFO "insights" job took 10.3s, ended with status "succeeded"
2018-06-22 03:00:25,964Z tap - INFO replicated X records from "ads_insights_region" endpoint
2018-06-22 03:00:25,965Z tap - ERROR
2018-06-22 03:00:25,965Z tap -
2018-06-22 03:00:25,965Z tap - Message: Call was not successful
2018-06-22 03:00:25,965Z tap - Method: GET
2018-06-22 03:00:25,966Z tap - Path: https://graph.facebook.com/v2.11/[redacted]/insights?access_token=...................................................................................................................................................................................&limit=25&after=NDkZD
2018-06-22 03:00:25,966Z tap - Params: {}
2018-06-22 03:00:25,966Z tap -
2018-06-22 03:00:25,966Z tap - Status: 400