{"record":{"id":"cef9439c5e8a776b","repo":"microsoft/qlib","slug":"no-valid-recorder-has-been-found-please-make-sure","errorCode":null,"errorMessage":"No valid recorder has been found, please make sure the input recorder id is correct.","messagePattern":"No valid recorder has been found, please make sure the input recorder id is correct\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/workflow/exp.py","lineNumber":304,"sourceCode":"\r\n    def _get_recorder(self, recorder_id=None, recorder_name=None):\r\n        \"\"\"\r\n        Method for getting or creating a recorder. It will try to first get a valid recorder, if exception occurs, it will\r\n        raise errors.\r\n\r\n        Quoting docs of search_runs from MLflow\r\n        > The default ordering is to sort by start_time DESC, then run_id.\r\n        \"\"\"\r\n        assert (\r\n            recorder_id is not None or recorder_name is not None\r\n        ), \"Please input at least one of recorder id or name before retrieving recorder.\"\r\n        if recorder_id is not None:\r\n            try:\r\n                run = self._client.get_run(recorder_id)\r\n                recorder = MLflowRecorder(self.id, self._uri, mlflow_run=run)\r\n                return recorder\r\n            except MlflowException as mlflow_exp:\r\n                raise ValueError(\r\n                    \"No valid recorder has been found, please make sure the input recorder id is correct.\"\r\n                ) from mlflow_exp\r\n        elif recorder_name is not None:\r\n            logger.warning(\r\n                f\"Please make sure the recorder name {recorder_name} is unique, we will only return the latest recorder if there exist several matched the given name.\"\r\n            )\r\n            recorders = self.list_recorders()\r\n            for rid in recorders:\r\n                if recorders[rid].name == recorder_name:\r\n                    return recorders[rid]\r\n            raise ValueError(\"No valid recorder has been found, please make sure the input recorder name is correct.\")\r\n\r\n    def search_records(self, **kwargs):\r\n        filter_string = \"\" if kwargs.get(\"filter_string\") is None else kwargs.get(\"filter_string\")\r\n        run_view_type = 1 if kwargs.get(\"run_view_type\") is None else kwargs.get(\"run_view_type\")\r\n        max_results = 100000 if kwargs.get(\"max_results\") is None else kwargs.get(\"max_results\")\r\n        order_by = kwargs.get(\"order_by\")\r\n\r","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/workflow/exp.py#L286-L322","documentation":"Raised by MLflowExperiment._get_recorder when MlflowClient.get_run(recorder_id) throws MlflowException (run not found, deleted, or malformed id); the MLflow error is chained into this ValueError. It means the id simply does not correspond to a run inside this experiment's tracking store.","triggerScenarios":"exp.get_recorder(recorder_id='<bad-or-deleted-run-id>'); recorder_id copied from a different tracking URI / mlruns directory; run was soft-deleted via delete_run before retrieval; id has trailing whitespace or wrong case.","commonSituations":"Switching exp_manager uri between runs (file:./mlruns vs file:./another_mlruns) so ids from the old store are looked up in the new one; resuming old experiments whose artifacts were cleaned; typos when pasting run ids into R.get_recorder.","solutions":["Verify the recorder exists first: exp.list_recorders() and confirm the id-keyed dict contains it.","Make sure the tracking URI matches where the run was created (check R.get_uri() / C.exp_manager['kwargs']['uri']).","Strip/normalize the id and confirm it is a 32-hex MLflow run_id, not an experiment_id or recorder name.","If the run was deleted, restore it in MLflow or accept it is gone."],"exampleFix":"# before\nrec = exp.get_recorder(recorder_id='abc123')  # ValueError: no valid recorder\n\n# after\nrids = exp.list_recorders()  # dict keyed by run_id\nrec = exp.get_recorder(recorder_id=next(iter(rids)))  # use a verified id","handlingStrategy":"validation","validationCode":"rids = exp.list_recorders()  # dict keyed by run_id\nif recorder_id not in rids:\n    raise KeyError(f'{recorder_id} not in experiment {exp.id}; available: {list(rids)[:5]}')\nrec = exp.get_recorder(recorder_id=recorder_id)","typeGuard":"def recorder_id_exists(exp, rid: str) -> bool:\n    return rid in exp.list_recorders()","tryCatchPattern":"try:\n    rec = exp.get_recorder(recorder_id=rid)\nexcept ValueError as e:\n    if 'recorder id is correct' in str(e):\n        rid = next(iter(exp.list_recorders()))  # recover with a known id\n        rec = exp.get_recorder(recorder_id=rid)\n    else:\n        raise","preventionTips":["Always fetch recorder ids from list_recorders()/save_recorder() return values, never hand-typed.","Pin the tracking URI before any id-based lookup so ids come from the same store.","Store the recorder id returned by start_exp immediately for later use."],"tags":["qlib","mlflow","run-not-found","value-error","recorder"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}