{"record":{"id":"7300c630f5078e73","repo":"ATH-MaaS/Pixelle-Video","slug":"template-not-found-template","errorCode":null,"errorMessage":"Template not found: {template}","messagePattern":"Template not found: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"api/routers/frame.py","lineNumber":157,"sourceCode":"        logger.info(f\"Get template params: {template}\")\n        \n        # Resolve template path\n        template_path = resolve_template_path(template)\n        \n        # Create generator and parse parameters\n        generator = HTMLFrameGenerator(template_path)\n        params = generator.parse_template_parameters()\n        media_width, media_height = generator.get_media_size()\n        \n        return TemplateParamsResponse(\n            template=template,\n            media_width=media_width,\n            media_height=media_height,\n            params=params\n        )\n        \n    except FileNotFoundError:\n        raise HTTPException(status_code=404, detail=f\"Template not found: {template}\")\n    except Exception as e:\n        logger.error(f\"Get template params error: {e}\")\n        raise HTTPException(status_code=500, detail=str(e))\n\n","sourceCodeStart":139,"sourceCodeEnd":162,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/api/routers/frame.py#L139-L162","documentation":"The GET /template/params endpoint maps FileNotFoundError from the template loader to HTTP 404 with 'Template not found: {template}'. It means the requested template name does not correspond to any template file the server can locate.","triggerScenarios":"GET /template/params?template={name} where the template file for that name does not exist on disk — misspelled template name, template not deployed/installed, case mismatch, or template stored in a directory the loader does not search.","commonSituations":"Template names renamed in a newer server version while clients still send the old name; custom templates not copied into the server's template directory (especially in Docker images); case-sensitive filesystem mismatch between dev (macOS) and prod (Linux).","solutions":["Check the exact template name spelling and case against available templates.","Confirm the template file exists in the server's template directory (list templates if an endpoint/file listing is available).","If custom, copy the template into the deployed server's template path / image.","Query /template/params for a known-good template first to verify the loader works.","Update client code to use the current template names after server upgrades."],"exampleFix":"// before\nawait fetch(`/api/frame/template/params?template=TitleCard`); // 404: wrong name\n// after\nawait fetch(`/api/frame/template/params?template=title_card`); // matches on-disk name","handlingStrategy":"validation","validationCode":"const KNOWN_TEMPLATES = ['title_card', 'lower_third', 'end_screen']; // keep in sync with server template dir\nif (!KNOWN_TEMPLATES.includes(template)) throw new Error(`Unknown template: ${template}`);\nconst res = await fetch(`/api/frame/template/params?template=${encodeURIComponent(template)}`);\nif (res.status === 404) throw new Error(`Template not deployed on server: ${template}`);","typeGuard":null,"tryCatchPattern":"try {\n  const res = await fetch(`/api/frame/template/params?template=${encodeURIComponent(template)}`);\n  if (res.status === 404) throw new Error(`Template not found: ${template}`);\n  if (!res.ok) throw new Error(`Template params fetch failed: ${res.status}`);\n  return await res.json();\n} catch (err) {\n  logger.error('Template params fetch failed', err);\n  throw err;\n}","preventionTips":["Maintain a shared, versioned list of valid template names between client and server.","Copy custom templates into the deployed server image/directory.","Check name casing — prod Linux filesystems are case-sensitive.","Re-verify template names after any server version upgrade or rename."],"tags":["http-404","template","configuration"],"backgroundTag":"template-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}