{"record":{"id":"9d01ccf98522acc2","repo":"ATH-MaaS/Pixelle-Video","slug":"template-not-found-size-template-name-availab-9d01cc","errorCode":null,"errorMessage":"Template not found: {size}/{template_name}\nAvailable sizes: {available_sizes}\nHint: Use format 'SIZExSIZE/template.html' (e.g., '1080x1920/image_default.html')","messagePattern":"Template not found: (.+?)/(.+?)\nAvailable sizes: (.+?)\nHint: Use format 'SIZExSIZE/template\\.html' \\(e\\.g\\., '1080x1920/image_default\\.html'\\)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"pixelle_video/utils/template_util.py","lineNumber":382,"sourceCode":"    \n    # Backward compatibility: migrate \"default.html\" to \"image_default.html\"\n    if template_name == \"default.html\":\n        migrated_name = \"image_default.html\"\n        try:\n            # Try migrated name first\n            path = get_resource_path(\"templates\", size, migrated_name)\n            logger.info(f\"Backward compatibility: migrated '{template_input}' to '{size}/{migrated_name}'\")\n            return path\n        except FileNotFoundError:\n            # Fall through to try original name\n            logger.warning(f\"Migrated template '{size}/{migrated_name}' not found, trying original name\")\n    \n    # Use resource API to resolve path (custom > default)\n    try:\n        return get_resource_path(\"templates\", size, template_name)\n    except FileNotFoundError:\n        available_sizes = list_available_sizes()\n        raise FileNotFoundError(\n            f\"Template not found: {size}/{template_name}\\n\"\n            f\"Available sizes: {available_sizes}\\n\"\n            f\"Hint: Use format 'SIZExSIZE/template.html' (e.g., '1080x1920/image_default.html')\"\n        )\n\n\ndef get_template_type(template_name: str) -> Literal['static', 'image', 'video']:\n    \"\"\"\n    Detect template type from template filename\n    \n    Template naming convention:\n    - static_*.html: Static style templates (no AI-generated media)\n    - image_*.html: Templates requiring AI-generated images\n    - video_*.html: Templates requiring AI-generated videos\n    \n    Args:\n        template_name: Template filename like \"image_default.html\" or \"video_simple.html\"\n    ","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/utils/template_util.py#L364-L400","documentation":"resolve_template_path in pixelle_video/utils/template_util.py wraps the resource API's FileNotFoundError with a friendlier message listing valid template sizes. It is thrown when get_resource_path('templates', size, template_name) cannot find the requested HTML template under either custom or default template directories.","triggerScenarios":"Calling resolve_template_path('1080x1920', 'image_default.html') (directly or via render_frame / get_template_params / _validate_template) when the size directory doesn't exist, the template filename is misspelled, or the template lives outside the searched custom/default resource roots.","commonSituations":"Using a non-standard size like '1080X1920' (uppercase X) or '1920x1080' when only 1080x1920 templates ship; referencing a template file that was never created in the user templates folder; passing a full path instead of the 'SIZExSIZE/name.html' relative form.","solutions":["List available sizes from the error message (list_available_sizes()) and pick an existing size directory","Create the template at templates/<SIZExSIZE>/<template_name> under the custom resource directory, or copy and adapt a default template","Fix the template name spelling and use lowercase 'x' in the size part (format 'SIZExSIZE/template.html')","Pass only the relative 'size/name.html' form, not an absolute path"],"exampleFix":"// before\npath = resolve_template_path(\"1920x1080\", \"default.html\")\n// after\npath = resolve_template_path(\"1080x1920\", \"image_default.html\")  # size+name verified against available_sizes","handlingStrategy":"validation","validationCode":"from pixelle_video.utils.template_util import list_available_sizes\nfrom pathlib import Path\n\ndef ensure_template(size: str, name: str):\n    if size not in list_available_sizes():\n        raise ValueError(f\"Unknown template size '{size}'. Available: {list_available_sizes()}\")\n    if not name.endswith('.html'):\n        raise ValueError(\"template_name must be an .html file, e.g. 'image_default.html'\")","typeGuard":null,"tryCatchPattern":"try:\n    path = resolve_template_path(size, name)\nexcept FileNotFoundError as e:\n    logger.error(e)  # message already lists available sizes\n    path = resolve_template_path(\"1080x1920\", \"image_default.html\")  # fallback default","preventionTips":["Always build the template reference as f\"{width}x{height}/{name}.html\" with lowercase 'x'","Call list_available_sizes() at startup and validate user config against it","Keep custom templates under the documented custom resource directory","Add a smoke test that resolves every template referenced in your config"],"tags":["file-not-found","template","configuration"],"backgroundTag":"template-file-not-found","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}