While I try to authenticate Zoho Books through Air...
# replication-ask-ai
l
While I try to authenticate Zoho Books through Airbyte Oauth, I am getting the below error
Copy code
access_token - Traceback (most recent call last):
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/connector_builder/message_grouper.py", line 182, in _read_stream
    yield from AirbyteEntrypoint(source).read(source.spec(self.logger), config, configured_catalog, {})
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/entrypoint.py", line 141, in read
    yield from self.source.read(self.logger, config, catalog, state)
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/manifest_declarative_source.py", line 136, in read
    yield from super().read(logger, config, catalog, state)
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 141, in read
    raise e
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 121, in read
    yield from self._read_stream(
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 196, in _read_stream
    for record in record_iterator:
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/abstract_source.py", line 333, in _read_full_refresh
    for record_data_or_message in record_data_or_messages:
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/declarative_stream.py", line 100, in read_records
    for record in self.retriever.read_records(sync_mode, cursor_field, stream_slice, stream_state):
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 398, in read_records
    for record in records_generator:
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py", line 439, in _read_pages
    request, response = self._fetch_next_page(stream_slice, stream_state, next_page_token)
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py", line 453, in _fetch_next_page
    request = self._create_prepared_request(
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/http.py", line 280, in _create_prepared_request
    return self._session.prepare_request(requests.Request(**args))
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/requests/sessions.py", line 486, in prepare_request
    p.prepare(
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/requests/models.py", line 372, in prepare
    self.prepare_auth(auth, url)
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/requests/models.py", line 603, in prepare_auth
    r = auth(self)
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py", line 28, in __call__
    request.headers.update(self.get_auth_header())
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py", line 33, in get_auth_header
    return {"Authorization": f"Bearer {self.get_access_token()}"}
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py", line 38, in get_access_token
    token, expires_in = self.refresh_access_token()
  File "/root/.pyenv/versions/3.9.11/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/auth/oauth.py", line 116, in refresh_access_token
    return response_json[self.get_access_token_name()], response_json[self.get_expires_in_name()]
KeyError: 'access_token'
however, when I run the python code with the exact same token refresh endpoint, I get the necessary values. Why is it happening?
k
A message from kapa.ai
Hmm, I don't know enough to give you a confident answer yet. However, I can provide you with some information on a similar issue that occurred with the Zoho CRM connector. In that case, the error message was not very meaningful, and a PR was submitted to improve the error message: [PR #21852](https://github.com/airbytehq/airbyte/pull/21852). Unfortunately, I don't have any specific information about the Zoho Books connector or the error you're encountering. I recommend checking the [Airbyte documentation](https://docs.airbyte.com/) and [Airbyte forum](https://discuss.airbyte.io/) for more information and assistance.