Troubleshoot the Databricks CLI
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
Use the following information to troubleshoot issues with the Databricks CLI.
Enable logging
If a command fails or does not produce the expected output, you can use logging to help identify what might have gone wrong. You can log messages that the Databricks CLI outputs about various command events, warnings, and errors. To log these messages, specify the following Databricks CLI command options:
Flag |
Description |
---|---|
|
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr. |
|
|
|
A string representing the log format level. If not specified then the log format level is disabled. |
For --log-level
, specify one of the following levels:
error
to log messages at theerror
level only.warn
to log messages at thewarn
anderror
levels.info
to log messages at theinfo
,error
, andwarn
levels.debug
to log messages at thedebug
,info
,error
, andwarn
levels. (--debug
is equivalent to--log-level debug
.)trace
to log messages at thetrace
,debug
,info
,error
, andwarn
levels.disabled
to not log messages. This is the default if--log-level
is not specified.
The following example command logs error
messages for only the specified command to a text file named databricks-cli.log
. --log-format text
is optional because messages are logged in text format by default.
databricks clusters list --log-file databricks-cli.log --log-format text --log-level error
The following example command logs trace
, debug
, info
, error
, and warn
messages for the specified command to a file named databricks-cli.log
in JSON format.
databricks clusters list --log-file databricks-cli.log --log-format json --log-level trace
The following example command logs debug
, info
, error
, and warn
messages for the specified command to a file named databricks-cli.log
in text format. Because --log-format
is not specified, messages are logged in text format.
databricks clusters list --log-file databricks-cli.log --log-level debug
The following example command logs info
, error
, and warn
messages for the specified command to stderr. Because --log-format
is not specified, messages are logged in text format.
databricks clusters list --log-level info