Giter Site home page Giter Site logo

Comments (7)

Just1B avatar Just1B commented on April 27, 2024

Hi rdeshmukh15 👋

Can you share your SDK implementation details ( code snipet / full graph api call ) ?

from facebook-python-business-sdk.

rdeshmukh15 avatar rdeshmukh15 commented on April 27, 2024

@Just1B : This is the code, we are using https://github.com/singer-io/tap-facebook

from facebook-python-business-sdk.

stcheng avatar stcheng commented on April 27, 2024

Hi @rdeshmukh15 the two kinds of errors are different. for the second one, the error message indicates that it might be an internal error, I would suggest you to create a bug report to provide more information.
For the first one, the error message already indicates the issue. When creating the report run, you'll need to include the params in the first place.

from facebook-python-business-sdk.

sgandhi1311 avatar sgandhi1311 commented on April 27, 2024

Initially, we didn't encounter any errors in the previous versions like v16.0. However, after upgrading to v17.0, we started experiencing the issue. In an attempt to resolve it, we upgraded further to API version v19.0, but unfortunately, the problem persists.

Could you please verify if there have been any significant changes or updates between v16.0 and the latest API version? We suspect there might be a breaking change causing this issue.

from facebook-python-business-sdk.

sgandhi1311 avatar sgandhi1311 commented on April 27, 2024

Just to clarify, the parameters included in the job execution are:

{'level': 'ad', 'action_breakdowns': ['action_type', 'action_target_id', 'action_destination'], 'breakdowns': ['region'], 'limit': 100, 'fields': ['inline_post_engagement', 'video_p25_watched_actions', 'account_name', 'cpc', 'cost_per_unique_inline_link_click', 'social_spend', 'spend', 'inline_link_click_ctr', 'canvas_avg_view_percent', 'unique_link_clicks_ctr', 'cost_per_unique_click', 'engagement_rate_ranking', 'adset_id', 'cost_per_inline_post_engagement', 'objective', 'ad_id', 'date_stop', 'cost_per_unique_action_type', 'conversion_rate_ranking', 'inline_link_clicks', 'frequency', 'date_start', 'adset_name', 'cpp', 'video_30_sec_watched_actions', 'cost_per_action_type', 'impressions', 'unique_clicks', 'video_p100_watched_actions', 'cpm', 'unique_ctr', 'clicks', 'reach', 'ad_name', 'video_p50_watched_actions', 'campaign_name', 'campaign_id', 'ctr', 'unique_inline_link_clicks', 'website_ctr', 'video_p75_watched_actions', 'unique_inline_link_click_ctr', 'account_id', 'quality_ranking', 'cost_per_inline_link_click', 'video_play_curve_actions', 'canvas_avg_view_time'], 'time_increment': 1, 'action_attribution_windows': ['1d_click', '7d_click', '28d_click', '1d_view', '7d_view', '28d_view'], 'time_ranges': [{'since': '2024-01-25', 'until': '2024-01-25'}]}

These parameters are included at the start of the report generation process, and no additional parameters are added afterwards.
Can you please prioritize looking into this? Because of the error, our customers fail to extract the record.

Our codebase for reference - https://github.com/singer-io/tap-facebook/blob/master/tap_facebook/__init__.py#L666-#L728

from facebook-python-business-sdk.

sgandhi1311 avatar sgandhi1311 commented on April 27, 2024

Here are the logs containing the stack trace to assist you in resolving the issue.

2024-03-13 07:57:07,813Z    tap - INFO Starting adsinsights job with params {'level': 'ad', 'action_breakdowns': ['action_type', 'action_target_id', 'action_destination'], 'breakdowns': ['region'], 'limit': 100, 'fields': ['spend', 'cost_per_action_type', 'objective', 'reach', 'video_p25_watched_actions', 'cost_per_inline_post_engagement', 'frequency', 'canvas_avg_view_percent', 'account_name', 'cost_per_unique_click', 'unique_ctr', 'engagement_rate_ranking', 'inline_link_clicks', 'video_p50_watched_actions', 'video_play_curve_actions', 'ad_id', 'adset_name', 'canvas_avg_view_time', 'inline_link_click_ctr', 'quality_ranking', 'conversion_rate_ranking', 'unique_inline_link_click_ctr', 'video_30_sec_watched_actions', 'impressions', 'ctr', 'video_p100_watched_actions', 'account_id', 'cpm', 'ad_name', 'video_p75_watched_actions', 'unique_inline_link_clicks', 'campaign_id', 'social_spend', 'cost_per_unique_action_type', 'date_stop', 'website_ctr', 'unique_link_clicks_ctr', 'date_start', 'unique_clicks', 'campaign_name', 'inline_post_engagement', 'cost_per_unique_inline_link_click', 'cost_per_inline_link_click', 'cpp', 'cpc', 'clicks', 'adset_id'], 'time_increment': 1, 'action_attribution_windows': ['1d_click', '7d_click', '28d_click', '1d_view', '7d_view', '28d_view'], 'time_ranges': [{'since': '2024-01-21', 'until': '2024-01-21'}]}
2024-03-13 07:57:08,597Z    tap - INFO Job Not Started, 0% done
2024-03-13 07:57:08,597Z    tap - INFO sleeping for 10 seconds until job is done
2024-03-13 07:57:18,656Z    tap - INFO Job Running, 0% done
2024-03-13 07:57:18,656Z    tap - INFO sleeping for 20 seconds until job is done
2024-03-13 07:57:38,718Z    tap - INFO Job Running, 55% done
2024-03-13 07:57:38,718Z    tap - INFO sleeping for 40 seconds until job is done
2024-03-13 07:58:18,784Z    tap - INFO Job Completed, 100% done
2024-03-13 07:58:18,785Z    tap - INFO "insights" job took 71.0s, ended with status "succeeded"
2024-03-13 07:58:19,075Z    tap - INFO replicated 1 records from "ads_insights_region" endpoint
2024-03-13 07:59:02,817Z target - INFO Serializing batch with 4460 messages for table ads_insights_region
2024-03-13 08:02:26,444Z target - INFO replicated 4159 records from "ads_insights_region" endpoint
2024-03-13 08:03:19,906Z    tap - INFO replicated 3961 records from "ads_insights_region" endpoint
2024-03-13 08:03:32,494Z    tap - INFO replicated 838 records from "ads_insights_region" endpoint
2024-03-13 08:03:32,495Z    tap - ERROR SingerSyncError
2024-03-13 08:03:32,495Z    tap - GET: 400 Message: (#100) Cannot include spend, objective, reach, video_p25_watched_actions, cost_per_inline_post_engagement, frequency, canvas_avg_view_percent, account_name, cost_per_unique_click, unique_ctr, engagement_rate_ranking, inline_link_clicks, video_p50_watched_actions, video_play_curve_actions, ad_id, adset_name, canvas_avg_view_time, inline_link_click_ctr, quality_ranking, conversion_rate_ranking, unique_inline_link_click_ctr, video_30_sec_watched_actions, impressions, ctr, video_p100_watched_actions, account_id, cpm, ad_name, video_p75_watched_actions, unique_inline_link_clicks, campaign_id, website_ctr, unique_link_clicks_ctr, unique_clicks, campaign_name, inline_post_engagement, cost_per_unique_inline_link_click, cost_per_inline_link_click, cpp, cpc, clicks, adset_id in summary param because they weren't there while creating the report run. All available values are: 
2024-03-13 08:03:32,495Z    tap - Traceback (most recent call last):
2024-03-13 08:03:32,495Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/tap_facebook/__init__.py", line 918, in main_impl
2024-03-13 08:03:32,495Z    tap -     do_sync(account, catalog, args.state)
2024-03-13 08:03:32,496Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/tap_facebook/__init__.py", line 807, in do_sync
2024-03-13 08:03:32,496Z    tap -     for message in stream:
2024-03-13 08:03:32,496Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/tap_facebook/__init__.py", line 713, in __iter__
2024-03-13 08:03:32,496Z    tap -     for obj in job.get_result():
2024-03-13 08:03:32,496Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/facebook_business/api.py", line 789, in __next__
2024-03-13 08:03:32,496Z    tap -     if not self._queue and not self.load_next_page():
2024-03-13 08:03:32,496Z    tap -                                ^^^^^^^^^^^^^^^^^^^^^
2024-03-13 08:03:32,496Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/facebook_business/api.py", line 841, in load_next_page
2024-03-13 08:03:32,496Z    tap -     response_obj = self._api.call(
2024-03-13 08:03:32,496Z    tap -                    ^^^^^^^^^^^^^^^
2024-03-13 08:03:32,496Z    tap -   File "/code/orchestrator/tap-env/lib/python3.11/site-packages/facebook_business/api.py", line 350, in call
2024-03-13 08:03:32,496Z    tap -     raise fb_response.error()
2024-03-13 08:03:32,496Z    tap - facebook_business.exceptions.FacebookRequestError: 
2024-03-13 08:03:32,496Z    tap - 
2024-03-13 08:03:32,496Z    tap -   Message: Call was not successful
2024-03-13 08:03:32,496Z    tap -   Method:  GET
2024-03-13 08:03:32,496Z    tap -   Path:    https://graph.facebook.com/v19.0/<id>/insights
2024-03-13 08:03:32,497Z    tap -   Params:  {'after': 'MjIwMjQZD'}
2024-03-13 08:03:32,497Z    tap - 
2024-03-13 08:03:32,497Z    tap -   Status:  400
2024-03-13 08:03:32,497Z    tap -   Response:
2024-03-13 08:03:32,497Z    tap -     {
2024-03-13 08:03:32,497Z    tap -       "error": {
2024-03-13 08:03:32,497Z    tap -         "message": "(#100) Cannot include spend, objective, reach, video_p25_watched_actions, cost_per_inline_post_engagement, frequency, canvas_avg_view_percent, account_name, cost_per_unique_click, unique_ctr, engagement_rate_ranking, inline_link_clicks, video_p50_watched_actions, video_play_curve_actions, ad_id, adset_name, canvas_avg_view_time, inline_link_click_ctr, quality_ranking, conversion_rate_ranking, unique_inline_link_click_ctr, video_30_sec_watched_actions, impressions, ctr, video_p100_watched_actions, account_id, cpm, ad_name, video_p75_watched_actions, unique_inline_link_clicks, campaign_id, website_ctr, unique_link_clicks_ctr, unique_clicks, campaign_name, inline_post_engagement, cost_per_unique_inline_link_click, cost_per_inline_link_click, cpp, cpc, clicks, adset_id in summary param because they weren't there while creating the report run. All available values are: ",
2024-03-13 08:03:32,497Z    tap -         "type": "OAuthException",
2024-03-13 08:03:32,497Z    tap -         "code": 100,
2024-03-13 08:03:32,497Z    tap -         "fbtrace_id": "AGaMoLnWoEzJDtzjLyPUelZ"
2024-03-13 08:03:32,497Z    tap -       }
2024-03-13 08:03:32,497Z    tap -     }

The error originates from the SDK, specifically from the api.py file, in the definition load_next_page. https://github.com/facebook/facebook-python-business-sdk/blob/main/facebook_business/api.py#L813

Please note that I intentionally removed the ID from the Graph API endpoint for security reasons.

from facebook-python-business-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.