{"record":{"id":"1f4d4a956a8ab562","repo":"ATH-MaaS/Pixelle-Video","slug":"template-not-found-size-template-name-availab","errorCode":null,"errorMessage":"Template not found: {size}/{template_name}\nAvailable templates for size {size}: {available_templates}","messagePattern":"Template not found: (.+?)/(.+?)\nAvailable templates for size (.+?): (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/utils/template_util.py","lineNumber":167,"sourceCode":"        size: Size string like \"1080x1920\"\n        template_name: Template filename like \"default.html\"\n    \n    Returns:\n        Full path like \"templates/1080x1920/default.html\" or \"data/templates/1080x1920/default.html\"\n    \n    Raises:\n        FileNotFoundError: If template file doesn't exist in either location\n    \n    Examples:\n        >>> get_template_full_path(\"1080x1920\", \"default.html\")\n        'templates/1080x1920/default.html'\n    \"\"\"\n    # Use new resource API to search custom first, then default\n    try:\n        return get_resource_path(\"templates\", size, template_name)\n    except FileNotFoundError:\n        available_templates = list_templates_for_size(size)\n        raise FileNotFoundError(\n            f\"Template not found: {size}/{template_name}\\n\"\n            f\"Available templates for size {size}: {available_templates}\"\n        )\n\n\nclass TemplateDisplayInfo(BaseModel):\n    \"\"\"Template display information for UI layer\"\"\"\n    \n    name: str = Field(..., description=\"Template name without extension\")\n    size: str = Field(..., description=\"Size string like '1080x1920'\")\n    width: int = Field(..., description=\"Width in pixels\")\n    height: int = Field(..., description=\"Height in pixels\")\n    orientation: Literal['portrait', 'landscape', 'square'] = Field(\n        ..., \n        description=\"Video orientation\"\n    )\n    is_standard: bool = Field(\n        ..., ","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/utils/template_util.py#L149-L185","documentation":"get_template_full_path delegates to get_resource_path('templates', size, template_name), searching the custom directory then the default package resources. On FileNotFoundError it lists available templates for that size via list_templates_for_size and raises FileNotFoundError('Template not found: size/template_name ... Available templates: ...'). It means the requested template does not exist for the given resolution.","triggerScenarios":"get_template_full_path(size, name) — or callers like get_resource_path consumers (_scan_workflows, resolve_template_path, etc.) — with a template_name that is absent from both custom and default 'templates/<size>/' directories.","commonSituations":"Typos in template names ('defualt.html'); requesting a custom template that was never created for that size; using a size directory that exists but is empty; custom resource directory misconfigured so the lookup silently misses it; templates removed in a library upgrade.","solutions":["Check the 'Available templates' list in the error message and use one of those names.","Create the missing template file in your custom templates/<size>/ directory.","Fix typos in template_name or size (exact filenames, including .html extension).","Verify your custom resource directory configuration points at the folder actually containing your templates.","Catch FileNotFoundError and fall back to a bundled default template."],"exampleFix":"// before\ntpl = get_template_full_path(\"1080x1920\", \"cinematic.html\")\n// after\ntry:\n    tpl = get_template_full_path(\"1080x1920\", \"cinematic.html\")\nexcept FileNotFoundError as e:\n    logger.warning(f\"{e}; falling back to default\")\n    tpl = get_template_full_path(\"1080x1920\", \"default.html\")","handlingStrategy":"try-catch","validationCode":"from pixelle_video.utils.template_util import list_templates_for_size\n\ndef template_available(size: str, name: str) -> bool:\n    return name in list_templates_for_size(size)\n# check before calling get_template_full_path","typeGuard":"def pick_template(size: str, preferred: str, fallback: str = \"default.html\") -> str:\n    available = list_templates_for_size(size)\n    return preferred if preferred in available else fallback","tryCatchPattern":"try:\n    tpl = get_template_full_path(size, template_name)\nexcept FileNotFoundError as e:\n    logger.warning(\"%s — available: %s\", e, e.args)\n    tpl = get_template_full_path(size, \"default.html\")","preventionTips":["Always check list_templates_for_size(size) before requesting a template","Use exact filenames including the .html extension","Create custom templates under the custom templates/<size>/ directory","Verify custom resource directory config after environment changes or upgrades","Fall back to a bundled default template in rendering code"],"tags":["file-not-found","templates","configuration"],"backgroundTag":"resource-file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}