Hello, our Facebook Marketing sync has recently st...
# ask-community-for-troubleshooting
h
Hello, our Facebook Marketing sync has recently started failing with:
Copy code
Warning from destination: Input was fully read, but some streams did not receive a terminal stream status message. If the destination did not encounter other errors, this likely indicates an error in the source or platform.
Connector is on the latest version
4.1.0
Any guidance on how to best troubleshoot / fix this?
k
Based on the knowledge sources, the error message you're seeing indicates that the Facebook Marketing source connector encountered an issue that prevented it from properly completing the sync and sending terminal status messages for some streams. Here are the recommended troubleshooting steps: ## Check for Configuration Errors According to the [Connection troubleshooting documentation](https://docs.airbyte.com/platform/1.8/cloud/managing-airbyte-cloud/review-connection-status#connection-troubleshooting), if the failure is due to a configuration error, you should navigate to the Facebook Marketing source and re-test and save the configuration before attempting another sync. ## Review Stream-Specific Issues The knowledge sources show several Facebook Marketing connector issues that could be relevant: 1. Field-related errors: One [closed issue](https://github.com/airbytehq/airbyte/issues/66027) describes a similar problem with the
ad_creatives
stream where removing certain Instagram-related fields resolved the issue: -
instagram_permalink_url
-
instagram_user_id
-
source_instagram_media_id
-
effective_instagram_media_id
If you're syncing the
ad_creatives
stream, you might try temporarily removing these fields to see if it resolves the issue. 2. Rate limiting: Check if your sync is being [rate-limited](https://docs.airbyte.com/platform/1.8/cloud/managing-airbyte-cloud/review-connection-status#connection-troubleshooting). Airbyte displays informational messages when a source is being rate-limited, and the Active Streams section will indicate which specific streams are affected. ## Check Sync History Review the Status page in Airbyte to see which specific streams failed to receive terminal status messages. This will help narrow down whether it's affecting all streams or just specific ones. ## System Errors The [documentation](https://docs.airbyte.com/platform/1.8/cloud/managing-airbyte-cloud/review-connection-status#connection-troubleshooting) notes that sync errors shown in yellow are often transient and may resolve themselves without action. You might try running the sync again to see if it succeeds. If these steps don't resolve the issue, you may need to examine the full sync logs to identify which specific streams are failing and any underlying Facebook API errors.
h
@kapa.ai it’s specifically the
ad_account
stream, and it has this error
Copy code
2025-10-23 05:54:52 source WARN There was an error during the serialization of an AirbyteMessage: `Recursion limit reached`. This might impact the sync performances.
2025-10-23 05:54:52 source INFO Finished syncing ad_sets
2025-10-23 05:54:52 source INFO SourceFacebookMarketing runtimes:
Syncing stream ad_account 0:00:01.499209
Syncing stream ad_sets 0:00:00.458882
2025-10-23 05:54:52 source ERROR Circular reference detected
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 335, in airbyte_message_to_string
    return orjson.dumps(serialized_message).decode()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Recursion limit reached

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/source-facebook-marketing", line 6, in <module>
    sys.exit(run())
             ^^^^^
  File "/airbyte/integration_code/source_facebook_marketing/run.py", line 25, in run
    launch(source, sys.argv[1:])
  File "/usr/local/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 377, in launch
    for message in source_entrypoint.run(parsed_args):
  File "/usr/local/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 207, in run
    yield from map(
  File "/usr/local/lib/python3.11/site-packages/airbyte_cdk/entrypoint.py", line 342, in airbyte_message_to_string
    return json.dumps(serialized_message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
           ^^^^^^^^^^^^^^^^^
ValueError: Circular reference detected
k
A message from kapa.ai
Based on the error logs you've provided, the issue is a circular reference in the
ad_account
stream data that's causing a serialization failure. This is a different issue from the typical Facebook Marketing sync errors. ## The Problem The error shows:
Copy code
ValueError: Circular reference detected TypeError: Recursion limit reached
This indicates that the data returned from Facebook's API for the
ad_account
stream contains circular references (where an object references itself, either directly or through a chain of references), which prevents the Airbyte connector from properly serializing the data. ## Potential Solutions ### 1. Reduce Fields in ad_account Stream Try deselecting some fields in the
ad_account
stream, particularly complex nested fields that might contain circular references. Based on the [knowledge sources](https://github.com/airbytehq/airbyte/issues/49977), Facebook Marketing streams can have issues with certain fields. To do this: 1. Go to your connection settings 2. Navigate to the Schema tab 3. Find the
ad_account
stream 4. Unselect fields you don't need, especially complex nested objects ### 2. Check for Known Issues This appears to be a bug in the Facebook Marketing connector version 4.1.0. The circular reference error suggests the connector is not properly handling certain data structures returned by Facebook's API. ### 3. Report the Issue Since this is a serialization bug in the connector itself (not a Facebook API error), you should: 1. Check if there's already an open issue for this on the [Airbyte GitHub repository](https://github.com/airbytehq/airbyte/issues) 2. If not, create a new issue with: - Connector version (4.1.0) - The full error logs you've provided - Which fields are selected in your
ad_account
stream configuration ### 4. Temporary Workaround As a temporary workaround, you could: - Disable the
ad_account
stream if you don't immediately need that data - Try reverting to an earlier connector version (though this may not be possible in Airbyte Cloud) The circular reference error is a connector-level bug that needs to be fixed by the Airbyte team, as the connector should handle or prevent circular references in the data it processes.
h
@kapa.ai this didn’t resolve it, so I opened up an issue in the Airbyte github
k
A message from kapa.ai
That's a good decision! Opening a GitHub issue is the right approach for this type of connector bug, especially since: 1. The circular reference error is a serialization issue within the connector itself 2. It's preventing the
ad_account
stream from completing successfully 3. The error persists even after attempting to reduce fields When creating your GitHub issue, make sure to include: - Connector name: source-facebook-marketing - Connector version: 4.1.0 - The full error logs you shared (with the circular reference and recursion limit errors) - What you've tried: Reducing fields in the ad_account stream - Impact: The stream fails to complete and doesn't send terminal status messages This will help the Airbyte team reproduce and fix the issue. You can track similar issues in the [Airbyte GitHub repository](https://github.com/airbytehq/airbyte/issues) to see if others report the same problem or if there are any updates. In the meantime, if you need the data from other streams, you could temporarily disable the
ad_account
stream in your connection configuration to allow the rest of your sync to complete successfully.