Skip to content

[source-facebook-marketing] Infinite attempts when consulting ad_insights for an account with more than 9000 ads. #67008

@juancrivillalba

Description

@juancrivillalba

Connector Name

source-facebook-marketing

Connector Version

4.0.1

What step the error happened?

During the sync

Relevant information

I have a connection that has the sream ads_insights. I am consulting an attribution window of 7 days. I have a particular account that is having errors, it is consulting the info day by day and those requests fail and then it tries to split job into smaller jobs. There i am getting the following error: "The reporting data you are trying to fetch has too many rows. Please use asynchronous query or restrict amount of ad IDs or time ranges to fetch the data."
This was not a problem before 26/09/2025.

Relevant log output

2025-09-26 21:11:46 source INFO InsightAsyncJob(id=3955764204673632, {
"account_id":"**********",
"id": "act_1653814571417795"
}, time_range=<Period [2025-09-18 -> 2025-09-18]>, breakdowns=[]): failed second time, trying to split job into smaller jobs.
2025-09-26 21:11:47 source ERROR Giving up call(...) after 1 tries (facebook_business.exceptions.FacebookRequestError:

Message: Call was not successful
Method: GET
Path: https://graph.facebook.com/v23.0/act_1653814571417795/insights
Params: {'level': 'campaign', 'action_breakdowns': '["action_type","action_target_id","action_destination"]', 'breakdowns': '[]', 'fields': '["campaign_id"]', 'action_attribution_windows': '["1d_click","7d_click","28d_click","1d_view","7d_view","28d_view"]', 'filtering': '[{"field":"ad.effective_status","operator":"IN","value":"**********"}]', 'time_range': '{"since":"2025-08-20","until":"2025-09-18"}'}

Status: 400
Response:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1487534,
"is_transient": false,
"error_user_title": "Too many rows",
"error_user_msg": "The reporting data you are trying to fetch has too many rows. Please use asynchronous query or restrict amount of ad IDs or time ranges to fetch the data.",
"fbtrace_id": "AGXsod8HqPYZwW-sc5KqnRb"
}
})
2025-09-26 21:11:47 source ERROR Encountered an exception while reading stream ads_insights
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/backoff/_sync.py", line 105, in retry
ret = target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^
File "/airbyte/integration_code/source_facebook_marketing/api.py", line 171, in call
response = super().call(method, path, params, headers, files, url_override, api_version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/facebook_business/api.py", line 336, in call
raise fb_response.error()
facebook_business.exceptions.FacebookRequestError:

Message: Call was not successful
Method: GET
Path: https://graph.facebook.com/v23.0/act_1653814571417795/insights
Params: {'level': 'campaign', 'action_breakdowns': '["action_type","action_target_id","action_destination"]', 'breakdowns': '[]', 'fields': '["campaign_id"]', 'action_attribution_windows': '["1d_click","7d_click","28d_click","1d_view","7d_view","28d_view"]', 'filtering': '[{"field":"ad.effective_status","operator":"IN","value":"**********"}]', 'time_range': '{"since":"2025-08-20","until":"2025-09-18"}'}

Status: 400
Response:
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1487534,
"is_transient": false,
"error_user_title": "Too many rows",
"error_user_msg": "The reporting data you are trying to fetch has too many rows. Please use asynchronous query or restrict amount of ad IDs or time ranges to fetch the data.",
"fbtrace_id": "AGXsod8HqPYZwW-sc5KqnRb"
}
}
----- END POST REPLICATION OPERATIONS -----

2025-09-26 21:12:00 platform INFO Retry State: RetryManager(completeFailureBackoffPolicy=BackoffPolicy(minInterval=PT10S, maxInterval=PT30M, base=3), partialFailureBackoffPolicy=null, successiveCompleteFailureLimit=5, successivePartialFailureLimit=1000, totalCompleteFailureLimit=10, totalPartialFailureLimit=20, successiveCompleteFailures=0, successivePartialFailures=3, totalCompleteFailures=4, totalPartialFailures=16)
Backoff before next attempt: 0 seconds


### Contribute

- [ ] Yes, I want to contribute

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions