8

I am trying to use Databricks CLI for the first time. Whenever I try something using cli it gives me the message: "Error: b'Bad Request'"
This is same for any cli based command
I am able to do authenticate (Tried with a wrong token and got the authentication error)
Please find the debug trace for the same below:
command: databricks fs ls --debug

result:
HTTP debugging enabled
send: b'GET /api/2.0/dbfs/list?path=dbfs%3A%2F HTTP/1.1\r\nHost: xxx-xxxxxxxxxxxxxxxx.xx.azuredatabricks.net\r\nuser-agent: databricks-cli-0.14.0-fs-ls-a2695361-282f-11eb-83c1-34f39aa616fb\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nAuthorization: Bearer \x16\r\nContent-Type: text/json\r\n\r\n'
reply: 'HTTP/1.1 400 Bad Request\r\n'
header: content-length: 11
header: content-type: text/plain<br>
header: date: Mon, 16 Nov 2020 17:17:42 GMT
header: server: databricks
header: connection: close
Error: b'Bad Request'

1 Answers1

10
  • Go to c:/users/youruser/.databrickscfg
  • Open above file in notepad
  • verify that URL and token are correct

Most likely token is not stored in the correct format. Thanks.

MarsTelnet
  • 471
  • 7
  • 18
  • Thanks, this was my problem. I followed the setup instructions but for some reason the token was corrupted. – Lawrence Apr 05 '22 at 21:16