{"record":{"id":"6da6eac18708597c","repo":"abi/screenshot-to-code","slug":"folder-not-found-folder","errorCode":null,"errorMessage":"Folder not found: {folder}","messagePattern":"Folder not found: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"backend/routes/evals.py","lineNumber":62,"sourceCode":"        for filename in os.listdir(input_dir):\n            if filename.endswith(\".png\"):\n                file_path = os.path.join(input_dir, filename)\n                files.append(InputFile(name=filename, path=file_path))\n        return sorted(files, key=lambda x: x.name)\n    except Exception as e:\n        raise HTTPException(\n            status_code=500, detail=f\"Error reading input files: {str(e)}\"\n        )\n\n\n@router.get(\"/evals\", response_model=list[Eval])\nasync def get_evals(folder: str):\n    if not folder:\n        raise HTTPException(status_code=400, detail=\"Folder path is required\")\n\n    folder_path = Path(folder)\n    if not folder_path.exists():\n        raise HTTPException(status_code=404, detail=f\"Folder not found: {folder}\")\n\n    try:\n        evals: list[Eval] = []\n        # Get all HTML files from folder\n        files = {\n            f: os.path.join(folder, f)\n            for f in os.listdir(folder)\n            if f.endswith(\".html\")\n        }\n\n        # Extract base names\n        base_names: Set[str] = set()\n        for filename in files.keys():\n            base_name = (\n                filename.rsplit(\"_\", 1)[0]\n                if \"_\" in filename\n                else filename.replace(\".html\", \"\")\n            )","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/abi/screenshot-to-code/blob/d026163f586dfa8c5c10d28c36edd59a9d3b0e88/backend/routes/evals.py#L44-L80","documentation":"404 raised by GET /evals in backend/routes/evals.py:62 when the folder query parameter names a path that does not exist on the backend host (Path(folder).exists() is False). The path is resolved against the backend's filesystem, not the browser's.","triggerScenarios":"GET /evals?folder=<path> where the path is relative to a different working directory, was deleted, or is a client-side path that does not exist server-side.","commonSituations":"Passing a macOS/Windows path from the developer machine while the backend runs in a container; the output folder was pruned between listing and fetch; relative path resolved against an unexpected CWD.","solutions":["List valid folders with GET /eval_output_folders and pass one of those exact paths.","If the folder should exist, verify it from the backend process's working directory (paths are server-side).","Recreate or re-point the folder, then retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const folders = await (await fetch('/eval_output_folders')).json();\nconst match = folders.find(f => f.path === folder);\nif (!match) throw new Error(`Folder not available: ${folder}`);","typeGuard":null,"tryCatchPattern":"const res = await fetch(`/evals?folder=${encodeURIComponent(folder)}`);\nif (res.status === 404) { /* re-list folders, let user re-pick */ }","preventionTips":["Only pass folder paths that came from the backend's own listing endpoint.","Remember paths resolve on the backend host, not the browser machine."],"tags":["http-404","filesystem","evals","fastapi"],"backgroundTag":null,"analyzedSha":"d026163f586dfa8c5c10d28c36edd59a9d3b0e88","analyzedAt":"2026-08-14T22:02:06.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}