Skip to content

During sync export getting http error 400 Client Error: Bad Request for url: https://adb-*.11.azuredatabricks.net/api/2.0/workspace/get-status?path=%5CShared #111

@jcbohlin

Description

@jcbohlin

If I use Postman, I receive the same error calling the Databricks API. If I change get-status?path=%5CShared to get-status?path=/Shared or get-status?path=%2fShared api call is successful. Notebook path in the yaml file is /Shared. Any ideas as to why it is converting / to %5C for the call to the api?

Full error text below

2022-05-18 14:03:36 [ERROR] Found exception when running generate.
Traceback (most recent call last):
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_cli\sdk\api_client.py", line 121, in perform_query
resp.raise_for_status()
File "C:\Python\Python39\databricks-sync\lib\site-packages\requests\models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://adb-*.11.azuredatabricks.net/api/2.0/workspace/get-status?path=%5CShared

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_sync\sdk\pipeline.py", line 92, in generate
async for item in self._generate():
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_sync\sdk\generators\notebook.py", line 267, in _generate
folder_perms = self.__handle_folder_permissions(folder_path, notebook)
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_sync\sdk\generators\notebook.py", line 239, in __handle_folder_permissions
folder_obj = self.__service.get_status(folder_path)
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_cli\sdk\service.py", line 570, in get_status
return self.client.perform_query('GET', '/workspace/get-status', data=_data, headers=headers)
File "C:\Python\Python39\databricks-sync\lib\site-packages\databricks_cli\sdk\api_client.py", line 129, in perform_query
raise requests.exceptions.HTTPError(message, response=e.response)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://adb-*.11.azuredatabricks.net/api/2.0/workspace/get-status?path=%5CShared
Response from server:
{ 'error_code': 'INVALID_PARAMETER_VALUE',
'message': "Path (\Shared) doesn't start with '/'"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions