{"record":{"id":"03f63395814edaa4","repo":"bytedance/deer-flow","slug":"failed-to-read-history-str-e","errorCode":null,"errorMessage":"Failed to read history: {str(e)}","messagePattern":"Failed to read history: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"backend/app/gateway/routers/skills.py","lineNumber":357,"sourceCode":"\n        def _read_history() -> list[dict] | None:\n            # Worker thread: storage construction, the existence probes, and the\n            # history-file read are blocking filesystem IO that must stay off the\n            # event loop. None signals 404 to the caller.\n            storage = _get_user_skill_storage(config)\n            if not storage.custom_skill_exists(skill_name) and not storage.get_skill_history_file(skill_name).exists():\n                return None\n            return storage.read_history(skill_name)\n\n        history = await asyncio.to_thread(_read_history)\n        if history is None:\n            raise HTTPException(status_code=404, detail=f\"Custom skill '{skill_name}' not found\")\n        return CustomSkillHistoryResponse(history=history)\n    except HTTPException:\n        raise\n    except Exception as e:\n        logger.error(\"Failed to read history for %s: %s\", skill_name, e, exc_info=True)\n        raise HTTPException(status_code=500, detail=f\"Failed to read history: {str(e)}\")\n\n\n@router.post(\"/skills/custom/{skill_name}/rollback\", response_model=CustomSkillContentResponse, summary=\"Rollback Custom Skill\")\nasync def rollback_custom_skill(skill_name: str, body: SkillRollbackRequest, request: Request, config: AppConfig = Depends(get_config)) -> CustomSkillContentResponse:\n    await require_admin_user(request, detail=_ADMIN_REQUIRED_DETAIL)\n    try:\n        storage = _get_user_skill_storage(config)\n        if not storage.custom_skill_exists(skill_name) and not storage.get_skill_history_file(skill_name).exists():\n            raise HTTPException(status_code=404, detail=f\"Custom skill '{skill_name}' not found\")\n        history = storage.read_history(skill_name)\n        if not history:\n            raise HTTPException(status_code=400, detail=f\"Custom skill '{skill_name}' has no history\")\n        record = history[body.history_index]\n        target_content = record.get(\"prev_content\")\n        if target_content is None:\n            raise HTTPException(status_code=400, detail=\"Selected history entry has no previous content to roll back to\")\n        storage.validate_skill_markdown_content(skill_name, target_content)\n        static_findings = await _scan_static_skill_markdown_or_raise(skill_name, target_content, app_config=config)","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/skills.py#L339-L375","documentation":"Error \"Failed to read history: {str(e)}\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/skills.py:357 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Gateway logs for the history read error; the history store may be corrupted.","Verify the skill history directory under the custom skills path is readable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}