benw-at-birdie
01/21/2022, 11:51 AM_request_with_backoff
to handle the error. This works perfectly when running meltano in my test environment - the tap pauses for an amount of time before resubmitting the request.
However, if I install the tap as a custom extractor using the github repo above then a 429 status code causes the running of the tap exit immediately with the following error 😞 .
[error ] Extraction failed code=1 job_id=2022-01-21T112740--tap-cqc-org-uk--target-jsonl message=singer_sdk.exceptions.FatalAPIError: 429 Client Error: Too Many Requests for path: /locations/{locationId} name=meltano run_id=ff1f62a6-c0d1-4c6f-8525-7bdd8318001b
Any ideas on what might be causing the difference would be gratefully received 🙏benw-at-birdie
01/21/2022, 11:51 AM- name: tap-cqc-org-uk
namespace: tap_cqc_org_uk
executable: ./tap-cqc-org-uk.sh
capabilities:
- state
- catalog
- discover
settings:
- name: start_date
value: '2022-01-07T00:00:00Z'
config:
start_date: '2022-01-07T00:00:00Z'
partner_code: Birdie Care
The config when installing the extractor from the Github repo looks like this
- name: tap-cqc-org-uk
namespace: tap_cqc_org_uk
pip_url: git+<https://github.com/birdiecare/tap-cqc-org-uk.git>
executable: tap-cqc-org-uk
capabilities:
- catalog
- state
- discover
settings:
- name: start_date
value: '2022-01-07T00:00:00Z'
config:
start_date: '2022-01-07T00:00:00Z'
partner_code: Birdie Care
… where the executable is installed using the command
printf 'tap_cqc_org_uk\ngit+<https://github.com/birdiecare/tap-cqc-org-uk.git>\ntap-cqc-org-uk\ncatalogue,state\n\n' | meltano add --custom extractor tap-cqc-org-uk
benw-at-birdie
01/21/2022, 11:53 AMmeltano elt tap-cqc-org-uk target-jsonl
visch
01/21/2022, 1:30 PMbenw-at-birdie
01/21/2022, 1:46 PMtimothy_payne
01/21/2022, 1:59 PMbenw-at-birdie
01/21/2022, 2:09 PMpoetry update
and still getting the weird difference in behaviour unfortunately.benw-at-birdie
01/21/2022, 2:58 PMFatalAPIError
… poetry.lock
is showing version 0.3.10
of the singer_sdk
is installed. Is that the right version?
ImportError: cannot import name 'FatalAPIError' from 'singer_sdk.exceptions' (/Users/benwhite/Library/Caches/pypoetry/virtualenvs/tap-cqc-org-uk-5_tzXm9--py3.8/lib/python3.8/site-packages/singer_sdk/exceptions.py) name=tap-cqc-org-uk stdio=stderr type=discovery
visch
01/21/2022, 2:59 PMbenw-at-birdie
01/21/2022, 3:09 PMpoetry update
.edgar_ramirez_mondragon
01/21/2022, 3:31 PMpoetry update
should get you the latest SDK and allow to import the exceptionbenw-at-birdie
01/24/2022, 11:10 AMpyproject.toml
was out of date - copying the one from the cookiecutter project and re-running poetry update
did the trick. Now the behaviour of by dev environment is as expected and I’m able to reference the FatalAPIError
and RetriableAPIError
exception types 🎉. Apologies if this was an obvious step … I’m new to python development 🙂 .
Validating the 429 response and raising a RetriableAPIError
stops the tap from immediately exiting, thanks Derek 🙌 . The last thing I need to work out is how to adjust the max number of tries and back off factor used. At the moment it gives up after 5 re-tries and doesn’t wait long enough in-between retries for the API to start accepting requests again. Any pointers on how to do this would be very welcome 🙏benw-at-birdie
01/24/2022, 11:15 AMbenw-at-birdie
01/24/2022, 11:20 AMedgar_ramirez_mondragon
01/24/2022, 2:07 PM