{"record":{"id":"d0856b5dce41aa99","repo":"mlflow/mlflow","slug":"got-unexpected-error-response-when-checking-whethe","errorCode":null,"errorMessage":"Got unexpected error response when checking whether file {dbfs_path} exists in DBFS: {json_response_obj}","messagePattern":"Got unexpected error response when checking whether file (.+?) exists in DBFS: (.+?)","errorType":"exception","errorClass":"ExecutionException","httpStatus":null,"severity":"error","filePath":"mlflow/projects/databricks.py","lineNumber":152,"sourceCode":"        response = rest_utils.http_request(\n            host_creds=host_creds,\n            endpoint=\"/api/2.0/dbfs/get-status\",\n            method=\"GET\",\n            json={\"path\": f\"/{dbfs_path}\"},\n        )\n        try:\n            json_response_obj = json.loads(response.text)\n        except Exception:\n            raise MlflowException(\n                f\"API request to check existence of file at DBFS path {dbfs_path} failed with \"\n                f\"status code {response.status_code}. Response body: {response.text}\"\n            )\n        # If request fails with a RESOURCE_DOES_NOT_EXIST error, the file does not exist on DBFS\n        error_code_field = \"error_code\"\n        if error_code_field in json_response_obj:\n            if json_response_obj[error_code_field] == \"RESOURCE_DOES_NOT_EXIST\":\n                return False\n            raise ExecutionException(\n                f\"Got unexpected error response when checking whether file {dbfs_path} \"\n                f\"exists in DBFS: {json_response_obj}\"\n            )\n        return True\n\n    def _upload_project_to_dbfs(self, project_dir, experiment_id):\n        \"\"\"\n        Tars a project directory into an archive in a temp dir and uploads it to DBFS, returning\n        the HDFS-style URI of the tarball in DBFS (e.g. dbfs:/path/to/tar).\n\n        Args:\n            project_dir: Path to a directory containing an MLflow project to upload to DBFS (e.g.\n                a directory containing an MLproject file).\n        \"\"\"\n        with tempfile.TemporaryDirectory() as temp_tarfile_dir:\n            temp_tar_filename = os.path.join(temp_tarfile_dir, \"project.tar.gz\")\n\n            def custom_filter(x):","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/projects/databricks.py#L134-L170","documentation":"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.","triggerScenarios":"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.","commonSituations":"Service principal lacking DBFS permissions; malformed dbfs:// path; workspace restrictions; quota/throttling errors on busy workspaces.","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"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"from mlflow.exceptions import ExecutionException\ntry:\n    run_databricks_spark_job(...)\nexcept ExecutionException as e:\n    if 'exists in DBFS' in str(e):\n        log.error('DBFS check failed: inspect error_code in message, fix permissions/path')","preventionTips":["Grant the service principal DBFS read/write access","Validate dbfs:// paths before launching","Check for permission/rate-limit error codes in the message"],"tags":["databricks","dbfs","permissions","api"],"backgroundTag":"unexpected-api-error-response","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}