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

fix(tableau): retry on InternalServerError 504 #12213

Merged

Conversation

sgomezvillamor
Copy link
Contributor

Retries on the following case

Internal error 504 at https://prod-useast-a.online.tableau.com/api/metadata/graphql
b''
Traceback (most recent call last):
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/run/pipeline.py", line 465, in run
    for wu in itertools.islice(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/state/stale_entity_removal_handler.py", line 72, in auto_stale_entity_removal
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/auto_work_units/auto_dataset_properties_aspect.py", line 62, in auto_patch_last_modified
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 149, in auto_workunit_reporter
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 253, in auto_browse_path_v2
    for urn, batch in _batch_workunits_by_urn(stream):
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 512, in _batch_workunits_by_urn
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 416, in auto_fix_empty_field_paths
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 368, in auto_fix_duplicate_schema_field_paths
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 172, in auto_materialize_referenced_tags_terms
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/api/source_helpers.py", line 104, in auto_status_aspect
    for wu in stream:
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 798, in get_workunits_internal
    yield from site_source.ingest_tableau_site()
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 3437, in ingest_tableau_site
    yield from self.emit_embedded_datasources()
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 3250, in emit_embedded_datasources
    datasource = self.update_datasource_for_field_upstream(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 2538, in update_datasource_for_field_upstream
    for field_upstream in self.get_connection_objects(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 1342, in get_connection_objects
    ) = self.get_connection_object_page(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau.py", line 1173, in get_connection_object_page
    query_data = query_metadata_cursor_based_pagination(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/datahub/ingestion/source/tableau/tableau_common.py", line 959, in query_metadata_cursor_based_pagination
    result = server.metadata.query(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 274, in wrapper
    return func(self, *args, **kwargs)
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/tableauserverclient/server/endpoint/metadata_endpoint.py", line 71, in query
    server_response = self.post_request(url, graphql_query, content_type="application/json", parameters=parameters)
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 226, in post_request
    return self._make_request(
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 141, in _make_request
    self._check_status(server_response, url)
  File "/tmp/datahub/ingest/venv-tableau-ab9d9cb03b44c5de/lib/python3.10/site-packages/tableauserverclient/server/endpoint/endpoint.py", line 159, in _check_status
    raise InternalServerError(server_response, url)
tableauserverclient.server.endpoint.exceptions.InternalServerError: 

Internal error 504 at https://prod-useast-a.online.tableau.com/api/metadata/graphql
b''

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Dec 23, 2024
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Dec 23, 2024
Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

Approving to unblock

current_cursor=current_cursor,
retry_on_auth_error=False,
retries_remaining=retries_remaining - 1,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need an else: raise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

indeed

fetch_size=fetch_size,
current_cursor=current_cursor,
retry_on_auth_error=False,
retries_remaining=retries_remaining - 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a huge fan of this entire method - it feels way more complicated than it needs to be and has a ton of mostly duplicated code

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree
If this works, we should invest some time on a refactor.

@sgomezvillamor sgomezvillamor enabled auto-merge (squash) December 24, 2024 09:14
@sgomezvillamor sgomezvillamor enabled auto-merge (squash) December 24, 2024 09:43
@sgomezvillamor sgomezvillamor merged commit 87e7b58 into master Dec 24, 2024
63 of 66 checks passed
@sgomezvillamor sgomezvillamor deleted the feature/cus-3546-fix-tableau-internalsevererror-504 branch December 24, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants