Skip to content

fix(source-facebook-marketing): Catch AirbyteTracedException in AdAccount.list_objects()#76064

Draft
devin-ai-integration[bot] wants to merge 3 commits intomasterfrom
devin/1775192027-fix-ad-account-exception-handling
Draft

fix(source-facebook-marketing): Catch AirbyteTracedException in AdAccount.list_objects()#76064
devin-ai-integration[bot] wants to merge 3 commits intomasterfrom
devin/1775192027-fix-ad-account-exception-handling

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 3, 2026

What

The ad_account stream fails with config_error because the backoff give_up handler in retry_pattern (common.py L90-92) converts FacebookRequestError into AirbyteTracedException before the except FacebookRequestError block in AdAccount.list_objects() can catch it. This causes known-benign errors (owner permission error code 200, funding_source_details error code 100) to surface as fatal failures instead of being handled gracefully.

Resolves https://github.com/airbytehq/oncall/issues/11860

How

Adds a second except AirbyteTracedException block in AdAccount.list_objects() that inspects the wrapped _exception attribute for the same two FacebookRequestError conditions already handled in the existing except FacebookRequestError block:

  • Error code 200 / "(#200) Requires business_management permission..." → removes owner field and retries
  • Error code 100 / "Unsupported request - method type: get" → removes funding_source_details field and retries

This is the exact same pattern merged in PR #75981 for the AdCreativesFromAds stream.

Review guide

  1. source_facebook_marketing/streams/streams.py — the core fix (new except AirbyteTracedException block after L354). Verify it mirrors the existing except FacebookRequestError block correctly.
  2. unit_tests/test_streams.py — 4 new parametrized test cases for AdAccount.list_objects(): two happy-path cases (owner removal, funding_source_details removal) and two re-raise cases (unrelated FB error, no wrapped FB error).
  3. Version bump: metadata.yaml and pyproject.toml both updated 5.2.4 → 5.2.5.

Reviewer checklist

  • Confirm the e._exception access pattern matches PR #75981
  • Confirm error code / message strings match the existing except FacebookRequestError block exactly
  • Update changelog placeholder XXXXX in docs/integrations/sources/facebook-marketing.md with this PR number

User Impact

Users whose ad_account stream was failing with config_error due to the owner permission or funding_source_details errors will now have those errors handled gracefully (field removed and request retried), matching the behavior before the backoff regression introduced in PR #37341.

Can this PR be safely reverted and rolled back?

  • YES 💚

Link to Devin session: https://app.devin.ai/sessions/b5cd0f2601274e0ebd9268cd2ca90734

…ount.list_objects()

The backoff give_up handler converts FacebookRequestError to
AirbyteTracedException before the except block in list_objects() can
catch it. This adds a separate except AirbyteTracedException block that
checks the wrapped exception for the same error conditions (owner
permission error code 200, funding_source_details error code 100).

Follows the exact pattern from PR #75981 which fixed the identical issue
in AdCreativesFromAds.

Resolves airbytehq/oncall#11860

Co-Authored-By: bot_apk <apk@cognition.ai>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

PR Slash Commands

Airbyte Maintainers (that's you!) can execute the following slash commands on your PR:

  • 🛠️ Quick Fixes
    • /format-fix - Fixes most formatting issues.
    • /bump-version - Bumps connector versions, scraping changelog description from the PR title.
      • Bump types: patch (default), minor, major, major_rc, rc, promote.
      • The rc type is a smart default: applies minor_rc if stable, or bumps the RC number if already RC.
      • The promote type strips the RC suffix to finalize a release.
      • Example: /bump-version type=rc or /bump-version type=minor
    • /bump-progressive-rollout-version - Alias for /bump-version type=rc. Bumps with an RC suffix and enables progressive rollout.
  • ❇️ AI Testing and Review (internal link: AI-SDLC Docs):
    • /ai-prove-fix - Runs prerelease readiness checks, including testing against customer connections.
    • /ai-canary-prerelease - Rolls out prerelease to 5-10 connections for canary testing.
    • /ai-review - AI-powered PR review for connector safety and quality gates.
  • 🚀 Connector Releases:
    • /publish-connectors-prerelease - Publishes pre-release connector builds (tagged as {version}-preview.{git-sha}) for all modified connectors in the PR.
  • ☕️ JVM connectors:
    • /update-connector-cdk-version connector=<CONNECTOR_NAME> - Updates the specified connector to the latest CDK version.
      Example: /update-connector-cdk-version connector=destination-bigquery
  • 🐍 Python connectors:
    • /poe connector source-example lock - Run the Poe lock task on the source-example connector, committing the results back to the branch.
    • /poe source example lock - Alias for /poe connector source-example lock.
    • /poe source example use-cdk-branch my/branch - Pin the source-example CDK reference to the branch name specified.
    • /poe source example use-cdk-latest - Update the source-example CDK dependency to the latest available version.
  • ⚙️ Admin commands:
    • /force-merge reason="<REASON>" - Force merges the PR using admin privileges, bypassing CI checks. Requires a reason.
      Example: /force-merge reason="CI is flaky, tests pass locally"
📚 Show Repo Guidance

Helpful Resources

📝 Edit this welcome message.

devin-ai-integration bot and others added 2 commits April 3, 2026 05:00
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Deploy preview for airbyte-docs ready!

✅ Preview
https://airbyte-docs-a9s19l6qi-airbyte-growth.vercel.app

Built with commit 087905f.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

source-facebook-marketing Connector Test Results

369 tests   365 ✅  14s ⏱️
  2 suites    4 💤
  2 files      0 ❌

Results for commit 087905f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant