airbyte
airbyte copied to clipboard
requests.exceptions.HTTPError: 403 Client Error
Environment
- Airbyte version: 0.36.0-alpha
- OS Version / Instance: CentOS Linux release 7.6.1810
- Deployment: docker-compose
- Source Connector and version: (Amazon Seller Partner 0.2.16)
- Destination Connector and version: (Postgres 0.3.17)
- Severity: Critical
- Step where error happened: Sync job
Current Behavior
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://sellingpartnerapi-eu.amazon.com/reports/2020-09-04/reports
Expected Behavior
Synchronous success.
Logs
log
2022-05-10 02:20:56 source > Encountered an exception while reading stream GET_BRAND_ANALYTICS_ALTERNATE_PURCHASE_REPORT
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 114, in read
yield from self._read_stream(
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 159, in _read_stream
for record in record_iterator:
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 248, in _read_full_refresh
for record in records:
File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 314, in read_records
report_id = self._create_report(sync_mode, cursor_field, stream_slice, stream_state)["reportId"]
File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 246, in _create_report
report_response = self._send_request(create_report_request)
File "/usr/local/lib/python3.9/site-packages/backoff/_sync.py", line 110, in retry
ret = target(*args, **kwargs)
File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 194, in _send_request
response.raise_for_status()
File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://sellingpartnerapi-eu.amazon.com/reports/2020-09-04/reports
Steps to Reproduce
1.reset your data 2.sync now
Are you willing to submit a PR?
Remove this with your answer.
We might have experienced similar issues. Do you use OAuth? Did your connector throw 403 after around 3600s?
Experiencing the same behaviour with another Brand Analytics report, but all the other reports for example Orders works fine.
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 277, in _read_full_refresh for record in records: File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 339, in read_records report_id = self._create_report(sync_mode, cursor_field, stream_slice, stream_state)["reportId"] File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 271, in _create_report report_response = self._send_request(create_report_request) File "/usr/local/lib/python3.9/site-packages/backoff/_sync.py", line 105, in retry ret = target(*args, **kwargs) File "/airbyte/integration_code/source_amazon_seller_partner/streams.py", line 210, in _send_request response.raise_for_status() File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://sellingpartnerapi-eu.amazon.com/reports/2020-09-04/reports 2022-09-14 07:19:03 source > Finished syncing GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT 2022-09-14 07:19:03 source > SourceAmazonSellerPartner runtimes: Syncing stream GET_BRAND_ANALYTICS_SEARCH_TERMS_REPORT 0:00:01.005918 2022-09-14 07:19:03 source > 403 Client Error: Forbidden for url: https://sellingpartnerapi-eu.amazon.com/reports/2020-09-04/reports
We have the same error with GET_SALES_AND_TRAFFIC_REPORT
, after some tests I found that if I request a short period of time adapting Start Date
and End Date
in the source settings I am able to avoid the error.
We have the same error with
GET_SALES_AND_TRAFFIC_REPORT
, after some tests I found that if I request a short period of time adaptingStart Date
andEnd Date
in the source settings I am able to avoid the error.
Can you share the parameters with what you got the connection successful ?
We have the same error with
GET_SALES_AND_TRAFFIC_REPORT
, after some tests I found that if I request a short period of time adaptingStart Date
andEnd Date
in the source settings I am able to avoid the error.Can you share the parameters with what you got the connection successful ?
In the source we set 10000 for the field max_wait_seconds
Should be fixed in 0.2.26. Please update to the last connector version.