{"record":{"id":"10b410fc7325dad4","repo":"microsoft/graphrag","slug":"max-retries-must-be-greater-than-1-for-exponential","errorCode":null,"errorMessage":"max_retries must be greater than 1 for Exponential Backoff retry.","messagePattern":"max_retries must be greater than 1 for Exponential Backoff retry\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/config/retry_config.py","lineNumber":46,"sourceCode":"        default=None,\n        description=\"The base delay in seconds for exponential backoff.\",\n    )\n\n    jitter: bool | None = Field(\n        default=None,\n        description=\"Whether to apply jitter to the delay intervals in exponential backoff.\",\n    )\n\n    max_delay: float | None = Field(\n        default=None,\n        description=\"The maximum delay in seconds between retries.\",\n    )\n\n    def _validate_exponential_backoff_config(self) -> None:\n        \"\"\"Validate Exponential Backoff retry configuration.\"\"\"\n        if self.max_retries is not None and self.max_retries <= 1:\n            msg = \"max_retries must be greater than 1 for Exponential Backoff retry.\"\n            raise ValueError(msg)\n\n        if self.base_delay is not None and self.base_delay <= 1.0:\n            msg = \"base_delay must be greater than 1.0 for Exponential Backoff retry.\"\n            raise ValueError(msg)\n\n        if self.max_delay is not None and self.max_delay <= 1:\n            msg = \"max_delay must be greater than 1 for Exponential Backoff retry.\"\n            raise ValueError(msg)\n\n    def _validate_immediate_config(self) -> None:\n        \"\"\"Validate Immediate retry configuration.\"\"\"\n        if self.max_retries is not None and self.max_retries <= 1:\n            msg = \"max_retries must be greater than 1 for Immediate retry.\"\n            raise ValueError(msg)\n\n    @model_validator(mode=\"after\")\n    def _validate_model(self):\n        \"\"\"Validate the retry configuration based on its type.\"\"\"","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/config/retry_config.py#L28-L64","documentation":"RetryConfig validation requires max_retries > 1 for Exponential Backoff retry. A single retry makes backoff pointless, so values of 1 or less are rejected at config load.","triggerScenarios":"RetryConfig(type=RetryType.ExponentialBackoff, max_retries=1) (or 0/negative) in code or settings.yaml.","commonSituations":"Copying a config tuned for Immediate retry (where 1 is also invalid) into an exponential block; trimming retries to 'just one more try' during debugging.","solutions":["Set max_retries to 2 or higher (e.g. 3) for exponential backoff","If you truly want a single immediate retry, reconsider: the validator requires >1 for all types, so use max_retries=2 or disable retries"],"exampleFix":"# before\nRetryConfig(type=\"exponential_backoff\", max_retries=1)\n# after\nRetryConfig(type=\"exponential_backoff\", max_retries=3)","handlingStrategy":"validation","validationCode":"mr = retry_cfg.get(\"max_retries\")\nif retry_cfg.get(\"type\") == \"exponential_backoff\" and mr is not None and mr <= 1:\n    raise ValueError(\"max_retries must be > 1\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use sensible defaults (max_retries=3) in config templates","Never hand-tune retries below 2; disable retry config instead"],"tags":["retry","config-validation","exponential-backoff"],"backgroundTag":"invalid-config-value","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}