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

Is there a way to prevent traceback errors like this? #738

Open
1 task done
moltar opened this issue Oct 15, 2024 · 0 comments
Open
1 task done

Is there a way to prevent traceback errors like this? #738

moltar opened this issue Oct 15, 2024 · 0 comments

Comments

@moltar
Copy link

moltar commented Oct 15, 2024

Is this your first time submitting an issue in dbt-athena?

  • I have searched the existing issues, and I could not find an existing issue for this feature

Describe your request/question

It hides the actual error message behind a long scrollback.

I snipped the error to a few lines, in reality it's super long.

16:05:03  Finished running  in 0 hours 0 minutes and 0.12 seconds (0.12s).
16:05:03  Encountered an error:
Unable to locate credentials
16:05:03  Traceback (most recent call last):
  File "/.../.env/lib/python3.12/site-packages/dbt/cli/requires.py", line 138, in wrapper
    result, success = func(*args, **kwargs)
                      ^^^^^^^^^^^^^^^^^^^^^

Anything else?

This happens in a few cases, such as when WorkGroup is missing, or query has a typo.

This seems to be related to error handling of the SDK calls?

11:04:48  Registered adapter: athena=1.8.4
Failed to execute query.
Traceback (most recent call last):
  File "/.../.env/lib/python3.12/site-packages/pyathena/common.py", line 575, in _execute
    query_id = retry_api_call(
               ^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/pyathena/util.py", line 84, in retry_api_call
    return retry(func, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/tenacity/__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/tenacity/__init__.py", line 376, in iter
    result = action(retry_state)
             ^^^^^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/tenacity/__init__.py", line 398, in <lambda>
    self._add_action_func(lambda rs: rs.outcome.result())
                                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.7/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.7/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/.../.env/lib/python3.12/site-packages/tenacity/__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/botocore/client.py", line 569, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../.env/lib/python3.12/site-packages/botocore/client.py", line 1023, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.InvalidRequestException: An error occurred (InvalidRequestException) when calling the StartQueryExecution operation (reached max retries: 0): WorkGroup is not found.
11:04:49    Connection test: [ERROR]

11:04:49  1 check failed:
11:04:49  dbt was unable to connect to the specified database.
The database returned the following error:

  >Runtime Error
  An error occurred (InvalidRequestException) when calling the StartQueryExecution operation (reached max retries: 0): WorkGroup is not found.

Check your database credentials and try again. For more information, visit:
https://docs.getdbt.com/docs/configure-your-profile 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant