Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Facebook Marketing: Add 80000 as a rate-limiting error code. #3996

Merged

Conversation

zestyping
Copy link
Contributor

@zestyping zestyping commented Jun 9, 2021

What

The Facebook Marketing source failed with the error code #80000 from Facebook:

2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 - facebook_business.exceptions.FacebookRequestError: 
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 - 
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Message: Call was not successful
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Method:  GET
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Path:    https://graph.facebook.com/v10.0/789823021731939/
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Params:  {}
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 - 
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Status:  400
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -   Response:
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -     {
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -       "error": {
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -         "message": "(#80000) There have been too many calls from this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.",
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -         "type": "OAuthException",
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -         "code": 80000,
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -         "error_subcode": 2446079,
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -         "fbtrace_id": "AWj71vGYQ4p8abkAFKdWAXm"
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -       }
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 -     }
2021-06-09 08:05:48 ERROR (/tmp/workspace/805/2) LineGobbler(voidCall):69 - 

How

It looks like there was a typo in source_facebook_marketing/client/common.py, and the error code #80000 was omitted. This PR adds 80000 to the list of error codes recognized as rate-limiting errors, and also adds a comment with a link to the Facebook API documentation where the error codes are listed.

Test output

python -m pytest unit_tests
============================= test session starts ==============================
platform darwin -- Python 3.7.9, pytest-6.1.2, py-1.10.0, pluggy-0.13.1
rootdir: /Users/ping/dev/airbyte/airbyte-integrations/connectors/source-facebook-marketing
plugins: requests-mock-1.9.2, mock-3.6.1
collected 3 items

unit_tests/test_client.py ...                                            [100%]

=============================== warnings summary ===============================
.venv/lib/python3.7/site-packages/jsonschema/compat.py:6
.venv/lib/python3.7/site-packages/jsonschema/compat.py:6
  /Users/ping/dev/airbyte/airbyte-integrations/connectors/source-facebook-marketing/.venv/lib/python3.7/site-packages/jsonschema/compat.py:6: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working
    from collections import MutableMapping, Sequence  # noqa

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================== 3 passed, 2 warnings in 21.01s ========================

Pre-merge Checklist

Connector checklist

  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • Secrets are annotated with airbyte_secret in output spec
  • Unit & integration tests added as appropriate (and are passing)
    • Community members: please provide proof of this succeeding locally e.g: screenshot or copy-paste acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • /test connector=connectors/<name> command as documented here is passing.
    • Community members can skip this, Airbyters will run this for you.
  • Code reviews completed
  • Credentials added to Github CI if needed and not already present. instructions for injecting secrets into CI.
  • Documentation updated
    • README
    • CHANGELOG.md
    • Reference docs in the docs/integrations/ directory.
  • Build is successful
  • Connector version bumped like described here
  • New Connector version released on Dockerhub by running the /publish command described here
  • No major blockers
  • PR merged into master branch
  • Follow up tickets have been created
  • Associated tickets have been closed & stakeholders notified

@keu keu self-requested a review June 9, 2021 19:00
Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@keu keu merged commit 88939d2 into airbytehq:master Jun 9, 2021
@keu
Copy link
Contributor

keu commented Jun 9, 2021

@jrhizor
Copy link
Contributor

jrhizor commented Jun 9, 2021

@keu looks like your publishing change failed due to my connector release in #3973

Would you mind separately bumping and publishing to pick up this change?

@keu
Copy link
Contributor

keu commented Jun 10, 2021

@jrhizor sure, np

hate GH notifications, found this one only now

@keu
Copy link
Contributor

keu commented Jun 10, 2021

@zestyping Thanks for your fix, indeed silly typo :)
The new version (0.2.9) Is publishing right now (#4023).

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.

5 participants