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 Quickbooks: Update missing stream props and add token refresh udpater #36389

Merged

Conversation

henriblancke
Copy link
Contributor

Changed

  • Added some missing properties to to bills, deposits and journal_entries streams
  • Updated manifest.json to include the refresh_token_updater so new refresh tokens get picked up and stored in config

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
Copy link

vercel bot commented Mar 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Apr 11, 2024 0:49am

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

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

Some small details. I need to run tests but the change looks good.

Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
Signed-off-by: Henri Blancke <blanckehenri@gmail.com>
@marcosmarxm
Copy link
Member

Having a hard time running tests to release this change. Hope to get something today/tmw

@marcosmarxm marcosmarxm merged commit 4a1d13e into airbytehq:master Apr 11, 2024
51 of 54 checks passed
@niteshsharoff
Copy link

@henriblancke I have a quickbooks/invoices stream running daily. My initial pull is successful but the day after it fails. I'm on v3.0.3 running airbyte cloud and my error log is as shown below.

Any ideas why this would happen? It almost feels like the refresh token isn't stored or used when the stream loads. I set the token expiry to be 1h from sync (UTC) so the next time it runs (tomorrow) theoretically it should renew the token and sync + store the new refresh token - not too sure what I'm doing wrong.

image
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 323, in read_records
  for stream_data in self._read_pages(record_generator, self.state, stream_slice):
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/retrievers/simple_retriever.py", line 287, 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 262, 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 454, in send_request
  headers=self._request_headers(stream_state, stream_slice, next_page_token, request_headers),
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/requesters/http_requester.py", line 308, in _request_headers
  headers = self._get_request_options(
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/requesters/http_requester.py", line 292, in _get_request_options
  auth_options_method(),
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py", line 56, in get_auth_header
  return {"Authorization": f"Bearer {self.get_access_token()}"}
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py", line 233, in get_access_token
  new_access_token, access_token_expires_in, new_refresh_token = self.refresh_access_token()
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py", line 248, in refresh_access_token
  response_json = self._get_refresh_access_token_response()
File "/usr/local/lib/python3.9/site-packages/backoff/_sync.py", line 105, in retry
  ret = target(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py", line 132, in _get_refresh_access_token_response
  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: 401 Client Error: Unauthorized for url: https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer
2024-06-21 04:24:27 ERROR i.a.w.i.VersionedAirbyteStreamFactory(internalLog):304 - Check failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation community connectors/source/quickbooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants