airbytehq / airbyte

The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
https://airbyte.com
Other
16.26k stars 4.15k forks source link

[source-xero] 2.0.0 connector set up failing with 400 error (Bearer authentication) #45670

Open rkgomezisa opened 2 months ago

rkgomezisa commented 2 months ago

Connector Name

source-xero

Connector Version

2.0.0

What step the error happened?

Configuring a new connector

Relevant information

When setting up the connection with Bearer token (Which was working on Postman), it returned a 400 error: 'Unable to connect to stream bank_transactions - Request to https://api.xero.com/api.xro/2.0/BankTransactions?page_size=100 failed with status code 400 and error message None' image

Relevant log output

2024-09-19 12:34:12 INFO i.a.w.l.p.s.m.Stage(apply):39 - APPLY Stage: CLAIM — (workloadId = 6fd1e833-dd6e-45ec-a727-ab917c5be892_38daf3e6-2753-4946-8570-7b0101208ad1_0_check) — (dataplaneId = local)
2024-09-19 12:34:22 INFO i.a.c.i.LineGobbler(voidCall):166 - ----- START CHECK -----
2024-09-19 12:34:22 INFO i.a.c.i.LineGobbler(voidCall):166 - 
2024-09-19 12:34:22 INFO i.a.c.ConnectorWatcher(run):96 - Connector exited with 0
2024-09-19 12:34:22 INFO i.a.w.i.VersionedAirbyteStreamFactory(create):189 - Reading messages from protocol version 0.2.0
2024-09-19 12:34:22 WARN i.a.m.l.MetricClientFactory(getMetricClient):43 - MetricClient has not been initialized. Must call MetricClientFactory.CreateMetricClient before using MetricClient. Using a dummy client for now. Ignore this if Airbyte is configured to not publish any metrics.
2024-09-19 12:34:22 ERROR i.a.w.i.VersionedAirbyteStreamFactory(internalLog):304 - Encountered an error trying to connect to stream bank_transactions. Error: 
 Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/checks/check_stream.py", line 42, in check_connection
    stream_is_available, reason = availability_strategy.check_availability(stream, logger, source)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/availability_strategy.py", line 50, in check_availability
    get_first_record_for_slice(stream, stream_slice)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/utils/stream_helper.py", line 40, in get_first_record_for_slice
    return next(records_for_slice)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 128, in read_records
    yield from self.retriever.read_records(self.get_json_schema(), stream_slice)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 375, in read_records
    for stream_data in self._read_pages(record_generator, self.state, _slice):
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 298, in _read_pages
    response = self._fetch_next_page(stream_state, stream_slice, next_page_token)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 273, in _fetch_next_page
    return self.requester.send_request(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/requesters/http_requester.py", line 461, in send_request
    return self._validate_response(response)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/requesters/http_requester.py", line 566, in _validate_response
    raise ReadException(error_message)
airbyte_cdk.sources.declarative.exceptions.ReadException: Request to https://api.xero.com/api.xro/2.0/BankTransactions?page_size=100 failed with status code 400 and error message None

2024-09-19 12:34:22 ERROR i.a.w.i.VersionedAirbyteStreamFactory(internalLog):304 - Check failed
2024-09-19 12:34:22 INFO i.a.c.ConnectorMessageProcessor(updateConfigFromControlMessage):231 - Checking for optional control message...
2024-09-19 12:34:22 INFO i.a.c.ConnectorMessageProcessor(updateConfigFromControlMessage):253 - Optional control message not found. Skipping...
2024-09-19 12:34:22 INFO i.a.c.ConnectorWatcher(run):134 - Writing output of 6fd1e833-dd6e-45ec-a727-ab917c5be892_38daf3e6-2753-4946-8570-7b0101208ad1_0_check to the doc store
2024-09-19 12:34:22 INFO i.a.c.ConnectorWatcher(run):136 - Marking workload as successful
2024-09-19 12:34:22 INFO i.a.c.ConnectorWatcher(exitProperly):189 - Deliberately exiting process with code 0.
2024-09-19 12:34:22 INFO i.a.c.i.LineGobbler(voidCall):166 - 
2024-09-19 12:34:22 INFO i.a.c.i.LineGobbler(voidCall):166 - ----- END CHECK -----
2024-09-19 12:34:22 INFO i.a.c.i.LineGobbler(voidCall):166 -

Contribute

marcosmarxm commented 1 week ago

Thanks for reporting the issue @rkgomezisa Xero is a community connector and it isn’t in the current roadmap for improvements. If you want to contribute fixing the issue please reach me out in Slack so I can provide you instructions to make the contribution.