mlflow/mlflow · error · ExecutionException
Got unexpected error response when checking whether file {db
Error message
Got unexpected error response when checking whether file {dbfs_path} exists in DBFS: {json_response_obj} What it means
After successfully parsing the DBFS status response as JSON, `_dbfs_path_exists` expects an `error_code` field only to carry RESOURCE_DOES_NOT_EXIST. Any other Databricks error code in the JSON means the existence check failed unexpectedly, so it raises ExecutionException embedding the full response object.
Source
Thrown at mlflow/projects/databricks.py:152
response = rest_utils.http_request(
host_creds=host_creds,
endpoint="/api/2.0/dbfs/get-status",
method="GET",
json={"path": f"/{dbfs_path}"},
)
try:
json_response_obj = json.loads(response.text)
except Exception:
raise MlflowException(
f"API request to check existence of file at DBFS path {dbfs_path} failed with "
f"status code {response.status_code}. Response body: {response.text}"
)
# If request fails with a RESOURCE_DOES_NOT_EXIST error, the file does not exist on DBFS
error_code_field = "error_code"
if error_code_field in json_response_obj:
if json_response_obj[error_code_field] == "RESOURCE_DOES_NOT_EXIST":
return False
raise ExecutionException(
f"Got unexpected error response when checking whether file {dbfs_path} "
f"exists in DBFS: {json_response_obj}"
)
return True
def _upload_project_to_dbfs(self, project_dir, experiment_id):
"""
Tars a project directory into an archive in a temp dir and uploads it to DBFS, returning
the HDFS-style URI of the tarball in DBFS (e.g. dbfs:/path/to/tar).
Args:
project_dir: Path to a directory containing an MLflow project to upload to DBFS (e.g.
a directory containing an MLproject file).
"""
with tempfile.TemporaryDirectory() as temp_tarfile_dir:
temp_tar_filename = os.path.join(temp_tarfile_dir, "project.tar.gz")
def custom_filter(x):View on GitHub (pinned to 6a27f2decc)
Solutions
- Read the error_code in the message (e.g. PERMISSION_DENIED) and fix the underlying Databricks-side issue
- Grant the token/service principal DBFS read/write permissions
- Validate the DBFS path format passed to run / storage paths
- Handle throttling by retrying later if the code indicates rate limiting
Example fix
null
Defensive patterns
Strategy: try-catch
Validate before calling
null
Try / catch
from mlflow.exceptions import ExecutionException
try:
run_databricks_spark_job(...)
except ExecutionException as e:
if 'exists in DBFS' in str(e):
log.error('DBFS check failed: inspect error_code in message, fix permissions/path') Prevention
- Grant the service principal DBFS read/write access
- Validate dbfs:// paths before launching
- Check for permission/rate-limit error codes in the message
When it happens
Trigger: DBFS API returns a structured error other than RESOURCE_DOES_NOT_EXIST, e.g. PERMISSION_DENIED for a token lacking DBFS access, INVALID_PARAMETER_VALUE for a malformed path, or rate limiting, while checking project upload paths.
Common situations: Service principal lacking DBFS permissions; malformed dbfs:// path; workspace restrictions; quota/throttling errors on busy workspaces.
Related errors
- API request to check existence of file at DBFS path {dbfs_pa
- Failed to get Databricks App '{app_name}'. Make sure the app
- Databricks judge API error (code={error_code}): {error_messa
- INVALID_PARAMETER_VALUE
- INVALID_PARAMETER_VALUE
AI-assisted analysis of mlflow/mlflow@6a27f2decc (2026-08-29).
Data as JSON: /api/errors/d0856b5dce41aa99.
Report an issue: GitHub.