{"record":{"id":"bef6cc6605ccb20b","repo":"mlflow/mlflow","slug":"failed-to-perform-one-or-more-operations-on-the-ru","errorCode":null,"errorMessage":"Failed to perform one or more operations on the run with ID {run_id}. Failed operations: {failures}","messagePattern":"Failed to perform one or more operations on the run with ID (.+?)\\. Failed operations: (.+?)","errorType":"exception","errorClass":"MlflowException","httpStatus":null,"severity":"error","filePath":"mlflow/utils/autologging_utils/client.py","lineNumber":392,"sourceCode":"            self._try_operation(self._client.log_inputs, run_id=run_id, datasets=datasets_batch)\n            for datasets_batch in chunk_list(\n                pending_operations.datasets_queue, chunk_size=MAX_DATASETS_PER_BATCH\n            )\n        )\n\n        if pending_operations.set_terminated:\n            operation_results.append(\n                self._try_operation(\n                    self._client.set_terminated,\n                    run_id=run_id,\n                    status=pending_operations.set_terminated.status,\n                    end_time=pending_operations.set_terminated.end_time,\n                )\n            )\n\n        failures = [result for result in operation_results if isinstance(result, Exception)]\n        if len(failures) > 0:\n            raise MlflowException(\n                message=(\n                    f\"Failed to perform one or more operations on the run with ID {run_id}.\"\n                    f\" Failed operations: {failures}\"\n                )\n            )\n\n\nclass _PendingRunOperations:\n    \"\"\"\n    Represents a collection of queued / pending MLflow Run operations.\n    \"\"\"\n\n    def __init__(self, run_id):\n        self.run_id = run_id\n        self.create_run = None\n        self.set_terminated = None\n        self.params_queue = []\n        self.tags_queue = []","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/mlflow/mlflow/blob/6a27f2decc0b76eb1b54af31849784addb357dbc/mlflow/utils/autologging_utils/client.py#L374-L410","documentation":"MlflowAutologgingQueue._flush_pending_operations performs deferred run operations (log metrics/params, set_terminated) for the run managed by the autologging client; any returned Exception results are collected into `failures` and re-raised as this aggregated MlflowException naming the run ID. It indicates the autologging session could not fully persist run data for that run.","triggerScenarios":"Ending an autologged run (or error_termination/flush path) when deferred operations against run {run_id} throw — e.g. the run was already deleted, the tracking store rejected a param/metric (name/value too long), or authentication expired mid-session.","commonSituations":"Run deleted or store cleaned while autologging session still open; param key exceeding MLflow's 250-char / value 6000-char limits; token expiry with Databricks tracking during long training jobs.","solutions":["Use the run_id in the message to query the run and confirm it still exists (mlflow.get_run(run_id))","Inspect the individual failures list for the underlying exception per operation","Check param/metric names and values against MLflow length limits and shorten offending keys","Re-authenticate (Databricks/hosted tracking) if the cause is an auth error","Retry the failed operations manually with mlflow.log_param/log_metric/set_terminated"],"exampleFix":"// before\nmlflow.sklearn.autolog()\nmodel.fit(X, y)  # raises: Failed operations: [MlflowException(...)]\n// after\nrun = mlflow.active_run()\ntry:\n    mlflow.set_terminated(run.info.run_id)\nexcept MlflowException as e:\n    print(run.info.run_id, e)  # inspect per-operation failures and retry selectively","handlingStrategy":"try-catch","validationCode":"from mlflow.tracking import MlflowClient\n# confirm the autologged run exists before flushing pending ops\nMlflowClient().get_run(run_id)","typeGuard":"def is_exception_result(result):\n    return isinstance(result, Exception)","tryCatchPattern":"try:\n    client._flush_pending_operations(run_id)\nexcept MlflowException as e:\n    logger.error('failed ops for run %s: %s', run_id, e)\n    # retry individual mlflow.log_param/log_metric calls synchronously","preventionTips":["Don't delete runs while an autologging session is open","Keep param names <=250 chars and values <=6000 chars","Refresh auth tokens for long Databricks/hosted training jobs","Check the per-operation failures list to target retries precisely"],"tags":["mlflow","autologging","run-management"],"backgroundTag":"run-operation-failed","analyzedSha":"6a27f2decc0b76eb1b54af31849784addb357dbc","analyzedAt":"2026-08-29T20:54:51.419Z","schemaVersion":2},"datasetVersion":"2026-08-29T22:17:34.462Z"}