You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Import error when using auth_type="oauth-m2m"
When running this python statement:
a = AccountClient(auth_type="oauth-m2m", profile="E2CERTACCT")
I found the error below while running in the python debugger.
File "/Users/xxxxxx.xxxxxxxx/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 23, in <module>
from .azure import ARM_DATABRICKS_RESOURCE_ID, ENVIRONMENTS, AzureEnvironment
ImportError: attempted relative import with no known parent package
log:
2023-06-09 22:53:01,090 [databricks.sdk][INFO] loading E2CERTACCT profile from ~/.databrickscfg: host, account_id, client_id, client_secret
2023-06-09 22:53:01,090 [databricks.sdk][DEBUG] Ignoring pat auth, because oauth-m2m is preferred
2023-06-09 22:53:01,090 [databricks.sdk][DEBUG] Ignoring basic auth, because oauth-m2m is preferred
2023-06-09 22:53:01,090 [databricks.sdk][DEBUG] Ignoring metadata-service auth, because oauth-m2m is preferred
2023-06-09 22:53:01,090 [databricks.sdk][DEBUG] Attempting to configure auth: oauth-m2m
Traceback (most recent call last):
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 415, in __call__
header_factory = provider(cfg)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 60, in wrapper
return func(cfg)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 114, in oauth_service_principal
token_url=resp.json()["token_endpoint"],
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 775, in _init_auth
self._header_factory = self._credentials_provider(self)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 421, in __call__
raise ValueError(f'{auth_type}: {e}') from e
ValueError: oauth-m2m: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 496, in __init__
self._init_auth()
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 780, in _init_auth
raise ValueError(f'{self._credentials_provider.auth_type()} auth: {e}') from e
ValueError: default auth: oauth-m2m: Expecting value: line 1 column 1 (char 0)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/douglas.moore/development/dba-helper/permissions-graph/extract_account_principals.py", line 44, in <module>
a = AccountClient(auth_type="oauth-m2m", profile="E2CERTACCT", debug_headers=True, debug_truncate_bytes=300)
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/__init__.py", line 192, in __init__
config = client.Config(host=host,
File "/Users/douglas.moore/.pyenv/versions/3.8.12/lib/python3.8/site-packages/databricks/sdk/core.py", line 501, in __init__
raise ValueError(message) from e
ValueError: default auth: oauth-m2m: Expecting value: line 1 column 1 (char 0). Config: host=https://accounts.cloud.databricks.com, account_id=deadbeef-deadbeef-deadbeef, client_id=dead999-1234-4321-9999-deadbeef, client_secret=***, profile=E2CERTACCT, auth_type=oauth-m2m, debug_truncate_bytes=300, debug_headers=True
The text was updated successfully, but these errors were encountered:
Import error when using
auth_type="oauth-m2m"
When running this python statement:
I found the error below while running in the python debugger.
log:
The text was updated successfully, but these errors were encountered: