{"record":{"id":"703c1330f7ed93bd","repo":"freqtrade/freqtrade","slug":"legacy-hyperopt-results-are-no-longer-supported-pl","errorCode":null,"errorMessage":"Legacy hyperopt results are no longer supported.Please rerun hyperopt or use an older version to load this file.","messagePattern":"Legacy hyperopt results are no longer supported\\.Please rerun hyperopt or use an older version to load this file\\.","errorType":"exception","errorClass":"OperationalException","httpStatus":null,"severity":"error","filePath":"freqtrade/optimize/hyperopt_tools.py","lineNumber":137,"sourceCode":"        Stream hyperopt results from file\n        \"\"\"\n        import rapidjson\n\n        logger.info(f\"Reading epochs from '{results_file}'\")\n        with results_file.open(\"r\") as f:\n            data = []\n            for line in f:\n                data += [rapidjson.loads(line)]\n                if len(data) >= batch_size:\n                    yield data\n                    data = []\n        yield data\n\n    @staticmethod\n    def _test_hyperopt_results_exist(results_file) -> bool:\n        if results_file.is_file() and results_file.stat().st_size > 0:\n            if results_file.suffix == \".pickle\":\n                raise OperationalException(\n                    \"Legacy hyperopt results are no longer supported.\"\n                    \"Please rerun hyperopt or use an older version to load this file.\"\n                )\n            return True\n        else:\n            # No file found.\n            return False\n\n    @staticmethod\n    def load_filtered_results(results_file: Path, config: Config) -> tuple[list, int]:\n        filteroptions = {\n            \"only_best\": config.get(\"hyperopt_list_best\", False),\n            \"only_profitable\": config.get(\"hyperopt_list_profitable\", False),\n            \"filter_min_trades\": config.get(\"hyperopt_list_min_trades\", 0),\n            \"filter_max_trades\": config.get(\"hyperopt_list_max_trades\", 0),\n            \"filter_min_avg_time\": config.get(\"hyperopt_list_min_avg_time\"),\n            \"filter_max_avg_time\": config.get(\"hyperopt_list_max_avg_time\"),\n            \"filter_min_avg_profit\": config.get(\"hyperopt_list_min_avg_profit\"),","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/freqtrade/freqtrade/blob/1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15/freqtrade/optimize/hyperopt_tools.py#L119-L155","documentation":"Thrown by HyperoptTools._test_hyperopt_results_exist when the results file exists, is non-empty, and has a '.pickle' suffix. Older freqtrade releases stored hyperopt epochs as pickled lists (hyperopt_results.pickle); current versions use a different serialized format, and pickle files are both incompatible and a potential security hazard, so loading is refused outright. The message tells the user the file must be regenerated.","triggerScenarios":"Running `freqtrade hyperopt-list`, `hyperopt-show`, or resuming hyperopt in a user_data/hyperopt_results directory that still contains a legacy hyperopt_results.pickle from an old installation.","commonSituations":"Upgrading freqtrade in place without cleaning user_data/hyperopt_results; restoring a backup of results from an old bot.","solutions":["Delete or move the legacy file: `rm user_data/hyperopt_results/hyperopt_results.pickle`.","Re-run the hyperopt with the current version to produce a fresh, compatible results file.","If the old results are important, load them with the old freqtrade version first and export/record the parameters manually."],"exampleFix":"# before: user_data/hyperopt_results/hyperopt_results.pickle exists from old version\nfreqtrade hyperopt-list\n# after\nmv user_data/hyperopt_results/hyperopt_results.pickle ~/backup/\nfreqtrade hyperopt-list","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef is_legacy_results_file(results_file: Path) -> bool:\n    return results_file.suffix == \".pickle\" and results_file.is_file() and results_file.stat().st_size > 0","typeGuard":null,"tryCatchPattern":"from freqtrade.exceptions import OperationalException\n\ntry:\n    HyperoptTools.load_filtered_results(results_file, config)\nexcept OperationalException as e:\n    if \"Legacy hyperopt results\" in str(e):\n        archive/delete the .pickle file and rerun hyperopt\n    else:\n        raise","preventionTips":["Clean user_data/hyperopt_results of *.pickle files right after upgrading freqtrade.","Back up old result files outside user_data so tools never pick them up."],"tags":["freqtrade","hyperopt","version-migration","pickle","results-file"],"backgroundTag":null,"analyzedSha":"1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15","analyzedAt":"2026-08-15T05:09:08.096Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}