{"record":{"id":"140c5ce57387de40","repo":"microsoft/graphrag","slug":"retryconfig-type-strategy-is-not-registered-in","errorCode":null,"errorMessage":"RetryConfig.type '{strategy}' is not registered in the RetryFactory. Registered strategies: {', '.join(retry_factory.keys())}","messagePattern":"RetryConfig\\.type '(.+?)' is not registered in the RetryFactory\\. Registered strategies: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/retry/retry_factory.py","lineNumber":84,"sourceCode":"    if strategy not in retry_factory:\n        match strategy:\n            case RetryType.ExponentialBackoff:\n                from graphrag_llm.retry.exponential_retry import ExponentialRetry\n\n                retry_factory.register(\n                    strategy=RetryType.ExponentialBackoff,\n                    initializer=ExponentialRetry,\n                )\n            case RetryType.Immediate:\n                from graphrag_llm.retry.immediate_retry import ImmediateRetry\n\n                retry_factory.register(\n                    strategy=RetryType.Immediate,\n                    initializer=ImmediateRetry,\n                )\n            case _:\n                msg = f\"RetryConfig.type '{strategy}' is not registered in the RetryFactory. Registered strategies: {', '.join(retry_factory.keys())}\"\n                raise ValueError(msg)\n\n    return retry_factory.create(strategy=strategy, init_args=init_args)\n","sourceCodeStart":66,"sourceCodeEnd":87,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/retry/retry_factory.py#L66-L87","documentation":"create_retry throws this ValueError when RetryConfig.type is not present in the retry_factory registry. The match statement lazily registers built-in retry strategies (e.g. ImmediateRetry); any unrecognized type falls to the default branch. The message includes the list of valid strategies.","triggerScenarios":"Calling create_completion or create_embedding (or retry tests like test_retries) with RetryConfig.type set to a misspelled, unknown, or unregistered value.","commonSituations":"Config typos, enum renames across versions, or custom Retry implementations not registered via retry_factory.register(...).","solutions":["Set RetryConfig.type to one of the strategies listed in the error message (e.g. immediate)","Fix typos/outdated enum values in config sources","Register custom retry strategies with retry_factory.register(strategy=..., initializer=...) before creating the retry instance"],"exampleFix":"# before\nretry = RetryConfig(type=\"expo\")\n\n# after\nretry = RetryConfig(type=RetryType.Immediate)","handlingStrategy":"validation","validationCode":"from graphrag_llm.retry import retry_factory\n\nif retry_config.type not in retry_factory:\n    raise ValueError(f\"Invalid retry type {retry_config.type!r}; valid: {list(retry_factory.keys())}\")","typeGuard":"from graphrag_llm.retry import retry_factory\n\ndef is_valid_retry(t: str) -> bool:\n    return t in retry_factory","tryCatchPattern":"try:\n    r = create_retry(retry_config)\nexcept ValueError as e:\n    if \"not registered in the RetryFactory\" in str(e):\n        raise\n    raise","preventionTips":["Use RetryType enum values in config","Check retry_factory.keys() in config validation","Register custom retry strategies at startup"],"tags":["graphrag-llm","retry","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"}