{"record":{"id":"f5a0903f3c92bf6f","repo":"microsoft/graphrag","slug":"templateengineconfig-type-strategy-is-not-regi","errorCode":null,"errorMessage":"TemplateEngineConfig.type '{strategy}' is not registered in the TemplateEngineFactory. Registered strategies: {', '.join(template_engine_factory.keys())}","messagePattern":"TemplateEngineConfig\\.type '(.+?)' is not registered in the TemplateEngineFactory\\. Registered strategies: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/templating/template_engine_factory.py","lineNumber":87,"sourceCode":"        template_engine_config=template_engine_config\n    )\n    init_args = template_engine_config.model_dump()\n\n    if strategy not in template_engine_factory:\n        match strategy:\n            case TemplateEngineType.Jinja:\n                from graphrag_llm.templating.jinja_template_engine import (\n                    JinjaTemplateEngine,\n                )\n\n                template_engine_factory.register(\n                    strategy=TemplateEngineType.Jinja,\n                    initializer=JinjaTemplateEngine,\n                    scope=\"singleton\",\n                )\n            case _:\n                msg = f\"TemplateEngineConfig.type '{strategy}' is not registered in the TemplateEngineFactory. Registered strategies: {', '.join(template_engine_factory.keys())}\"\n                raise ValueError(msg)\n\n    return template_engine_factory.create(\n        strategy=strategy,\n        init_args={\n            **init_args,\n            \"template_manager\": template_manager,\n        },\n    )\n","sourceCodeStart":69,"sourceCodeEnd":96,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/templating/template_engine_factory.py#L69-L96","documentation":"create_template_engine raises this ValueError when TemplateEngineConfig.type is not registered in the template_engine_factory registry. It is the default branch of the match statement that lazily registers the built-in Jinja engine; any other value falls through and the message lists valid strategies.","triggerScenarios":"Calling create_template_engine with TemplateEngineConfig.type set to a misspelled value or a custom engine type that was never registered via template_engine_factory.register(...).","commonSituations":"Typos in config, expecting a plugin engine (e.g. a non-Jinja engine) that requires explicit registration, or version changes to TemplateEngineType members.","solutions":["Set TemplateEngineConfig.type to a registered strategy (e.g. jinja)","Fix typos in your config source","Register custom engines with template_engine_factory.register(strategy=..., initializer=YourEngine, scope=...) before creating the engine"],"exampleFix":"# before\ncfg = TemplateEngineConfig(type=\"jinja2\")\n\n# after\ncfg = TemplateEngineConfig(type=TemplateEngineType.Jinja)","handlingStrategy":"validation","validationCode":"from graphrag_llm.templating import template_engine_factory\n\nif cfg.type not in template_engine_factory:\n    raise ValueError(f\"Invalid engine type {cfg.type!r}; valid: {list(template_engine_factory.keys())}\")","typeGuard":"from graphrag_llm.templating import template_engine_factory\n\ndef is_valid_engine_type(t: str) -> bool:\n    return t in template_engine_factory","tryCatchPattern":"try:\n    engine = create_template_engine(cfg, template_manager=mgr)\nexcept ValueError as e:\n    if \"not registered in the TemplateEngineFactory\" in str(e):\n        raise\n    raise","preventionTips":["Use TemplateEngineType enum members instead of raw strings","Validate engine type during config loading","Register custom template engines before factory use"],"tags":["graphrag-llm","templating","factory","config-validation"],"backgroundTag":"unknown-strategy-in-factory-registry","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}