{"record":{"id":"59452fa7deebccc2","repo":"HKUDS/DeepTutor","slug":"not-a-valid-entry-id","errorCode":null,"errorMessage":"not a valid entry id","messagePattern":"not a valid entry id","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"deeptutor/api/routers/memory.py","lineNumber":107,"sourceCode":"    backups: list[str] = []\n    if backup_dir.exists():\n        backups = sorted(p.name for p in backup_dir.iterdir() if p.is_dir())\n    return {\"docs\": rows, \"backups\": backups}\n\n\n@router.get(\"/resolve_entry/{entry_id}\")\nasync def resolve_entry(entry_id: str):\n    \"\"\"Find which L2 doc owns this entry id.\n\n    L3 docs cite L2 entries by their ``m_<ULID>`` entry id; the workbench\n    UI uses this resolver to turn an L3 footnote click into a navigation\n    to the right L2 surface + scroll-to anchor.\n\n    Scans the seven L2 mds in order; first hit wins. 404 if no L2 doc\n    contains the id (e.g. the entry was deleted or the id is stale).\n    \"\"\"\n    if not _ENTRY_ID_RE.match(entry_id):\n        raise HTTPException(status_code=400, detail=\"not a valid entry id\")\n    from deeptutor.services.memory.document import parse\n\n    for surface in SURFACES:\n        path = paths.l2_file(surface)\n        if not path.exists():\n            continue\n        try:\n            doc = parse(path.read_text(encoding=\"utf-8\"))\n        except Exception:  # noqa: BLE001 — malformed L2 should not 500 the resolver\n            continue\n        for entry in doc.all_entries():\n            if entry.id == entry_id:\n                return {\"layer\": \"L2\", \"key\": surface, \"entry_id\": entry_id}\n    raise HTTPException(status_code=404, detail=\"entry not found in any L2 doc\")\n\n\n@router.get(\"/backup\")\nasync def list_backups():","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/api/routers/memory.py#L89-L125","documentation":"Error \"not a valid entry id\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/api/routers/memory.py:107 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}