-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Summary
The Facebook Pages connector fails during sync with a "Bad request" error when users authenticate with limited OAuth permissions. This happens because the connector requests over 100 fields for the page stream, many of which require elevated permissions beyond the basic pages_read_engagement and pages_read_user_content.
Problem
When a user authenticates with Facebook and only has basic permissions (not admin-level access to the Page), the OAuth flow shows fewer permission requests. However, the connector still attempts to request all fields, including those that require elevated permissions. Facebook returns a "Bad request" error instead of gracefully ignoring inaccessible fields.
Error message:
Exception while syncing stream page: Bad request. Please check your request parameters.
Root Cause Analysis
The page stream in manifest.yaml requests the following fields that require elevated permissions:
Fields requiring pages_manage_metadata or admin access
page_token- Requires admin roleaccess_token- Requires a role on the Pageunread_message_count,unread_notif_count,unseen_message_count- Requires messaging/admin accessleadgen_tos_acceptance_time,leadgen_tos_accepted,leadgen_tos_accepting_user- Requires lead gen permissionsis_webhooks_subscribed- Requires admin access
Fields requiring pages_manage_ads
ad_campaign- Requires ads permissionsmessenger_ads_default_icebreakers,messenger_ads_default_quick_replies,messenger_ads_quick_replies_type- Requires messenger ads permissionspromotion_eligible,promotion_ineligible_reason- Requires ads permissions
Edge fields (connections) that may require additional permissions
albums,call_to_actions,canvas_elements,events,feed,global_brand_children,image_copyrights,indexed_videos,likes,live_videos,photos,posts,published_posts,tabs,tagged,rtb_dynamic_posts,video_lists,videos
OAuth Scopes Requested vs Required
The connector requests these OAuth scopes:
pages_manage_ads, pages_manage_metadata, pages_read_engagement, pages_read_user_content, read_insights, catalog_management
However, Facebook only grants permissions the user actually has on their Page(s). Users with limited Page access (e.g., analyst or editor roles) will not receive pages_manage_ads, pages_manage_metadata, or catalog_management permissions, even though Airbyte requests them.
Expected Behavior
The connector should work with basic permissions (pages_read_engagement, pages_read_user_content) and gracefully handle cases where elevated permissions are not available.
Proposed Solutions
- Reduce default field list: Only request fields that work with basic permissions by default
- Make advanced fields configurable: Add a config option to enable/disable advanced fields
- Graceful degradation: Implement error handling to retry with fewer fields when a "Bad request" occurs
- Better documentation: Clearly document which permissions are required for which features
Related Issues
- source-facebook-pages: CHECK error message missing catalog_management permission requirement #70893 - CHECK error message missing catalog_management permission requirement
Environment
- Connector: source-facebook-pages
- Version: 2.0.4
- Manifest location:
airbyte-integrations/connectors/source-facebook-pages/source_facebook_pages/manifest.yaml
Requested by: teo@airbyte.io (@tgonzalezc5)
Investigated by: Devin AI - https://app.devin.ai/sessions/056d8dd22277481dad7601a5cfca2dcb
Internal Tracking: https://github.com/airbytehq/oncall/issues/11143