{"record":{"id":"ec8082716b1fae2c","repo":"microsoft/qlib","slug":"no-valid-experiment-has-been-found-please-make-su-ec8082","errorCode":null,"errorMessage":"No valid experiment has been found, please make sure the input experiment name is correct.","messagePattern":"No valid experiment has been found, please make sure the input experiment name is correct\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/workflow/expm.py","lineNumber":394,"sourceCode":"                # https://www.mlflow.org/docs/latest/python_api/mlflow.tracking.html#mlflow.tracking.MlflowClient.get_experiment\n                exp = self.client.get_experiment(experiment_id)\n                if exp.lifecycle_stage.upper() == \"DELETED\":\n                    raise MlflowException(\"No valid experiment has been found.\")\n                experiment = MLflowExperiment(exp.experiment_id, exp.name, self.uri)\n                return experiment\n            except MlflowException as e:\n                raise ValueError(\n                    \"No valid experiment has been found, please make sure the input experiment id is correct.\"\n                ) from e\n        elif experiment_name is not None:\n            try:\n                exp = self.client.get_experiment_by_name(experiment_name)\n                if exp is None or exp.lifecycle_stage.upper() == \"DELETED\":\n                    raise MlflowException(\"No valid experiment has been found.\")\n                experiment = MLflowExperiment(exp.experiment_id, experiment_name, self.uri)\n                return experiment\n            except MlflowException as e:\n                raise ValueError(\n                    \"No valid experiment has been found, please make sure the input experiment name is correct.\"\n                ) from e\n\n    def search_records(self, experiment_ids=None, **kwargs):\n        filter_string = \"\" if kwargs.get(\"filter_string\") is None else kwargs.get(\"filter_string\")\n        run_view_type = 1 if kwargs.get(\"run_view_type\") is None else kwargs.get(\"run_view_type\")\n        max_results = 100000 if kwargs.get(\"max_results\") is None else kwargs.get(\"max_results\")\n        order_by = kwargs.get(\"order_by\")\n        return self.client.search_runs(experiment_ids, filter_string, run_view_type, max_results, order_by)\n\n    def delete_exp(self, experiment_id=None, experiment_name=None):\n        assert (\n            experiment_id is not None or experiment_name is not None\n        ), \"Please input a valid experiment id or name before deleting.\"\n        try:\n            if experiment_id is not None:\n                self.client.delete_experiment(experiment_id)\n            else:","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/workflow/expm.py#L376-L412","documentation":"Raised by ExpManager when resolving an experiment by name fails: either MLflow's get_experiment_by_name returned None (no experiment with that name), the experiment's lifecycle_stage is DELETED, or the MLflow client itself raised MlflowException. The original MLflow error is chained as __cause__. It means the experiment name given to get_exp(experiment_name=...) cannot be mapped to a live MLflow experiment at the configured tracking URI.","triggerScenarios":"Calling exp_manager.get_exp(experiment_name='foo') (directly or via R.start with a non-existent experiment name); passing the name of an experiment that was deleted (lifecycle_stage == 'DELETED'); MLFLOW_TRACKING_URI pointing at a different backend than where the experiment lives; mlflow client raising MlflowException during lookup (e.g. backend unreachable, permission error).","commonSituations":"Typo in the 'experiment_name' field of a Qlib workflow config; switching tracking URI (local ./mlruns vs http server) so previously created experiments are not visible; re-running a notebook after the experiment was deleted via delete_exp or the mlflow UI; mlflow version differences in get_experiment_by_name behavior.","solutions":["Verify the experiment exists at the tracking URI you are actually using: compare `R.get_exp(experiment_name=...)` input against `R.list_experiments()` output and fix the typo","Check MLFLOW_TRACKING_URI / uri parameter of QlibRecorder matches the backend where the experiment was created (qlib.init or exp_manager uri)","If the experiment was deleted, restore it (mlflow client.restore_experiment) or create a new one with R.set_uri/get_exp(create=True)","Catch ValueError and inspect e.__cause__ (the original MlflowException) for backend-level failures such as connectivity or auth"],"exampleFix":"# before\nexp = R.get_exp(experiment_name='alpha158')  # ValueError: no valid experiment\n\n# after\nexp_names = [name for name in R.list_experiments()]\nassert 'alpha158' in exp_names, f'pick from {exp_names}'\nexp = R.get_exp(experiment_name='alpha158')","handlingStrategy":"validation","validationCode":"from qlib.workflow import R\n\ndef get_exp_safe(name: str):\n    exps = R.list_experiments()  # {name: exp-like} of ACTIVE_ONLY experiments\n    if name not in exps:\n        raise KeyError(f'{name!r} not in active experiments: {sorted(exps)}')\n    return R.get_exp(experiment_name=name)","typeGuard":null,"tryCatchPattern":"try:\n    exp = R.get_exp(experiment_name=name)\nexcept ValueError as e:\n    cause = e.__cause__  # original MlflowException, check for backend errors\n    if isinstance(cause, MlflowException) and 'RESOURCE_DOES_NOT_EXIST' in str(cause):\n        exp = R.get_exp(experiment_name=name, create=True)\n    else:\n        raise","preventionTips":["Always resolve experiment names from R.list_experiments() instead of typing them","Set the tracking uri explicitly via qlib.init(...) or R.set_uri before any get_exp","In reusable scripts, prefer get_exp(experiment_name=..., create=True) when creating-on-miss is acceptable"],"tags":["qlib","mlflow","experiment-tracking","config"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}