{"record":{"id":"c8518d61f9e04154","repo":"langgenius/dify","slug":"iris-min-connection-must-be-less-than-or-equal-to","errorCode":null,"errorMessage":"IRIS_MIN_CONNECTION must be less than or equal to IRIS_MAX_CONNECTION","messagePattern":"IRIS_MIN_CONNECTION must be less than or equal to IRIS_MAX_CONNECTION","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"api/configs/middleware/vdb/iris_config.py","lineNumber":91,"sourceCode":"            values: Configuration dictionary\n\n        Returns:\n            Validated configuration dictionary\n\n        Raises:\n            ValueError: If required fields are missing or pool settings are invalid\n        \"\"\"\n        # Only validate required fields if IRIS is being used as the vector store\n        # This allows the config to be loaded even when IRIS is not in use\n\n        # vector_store = os.environ.get(\"VECTOR_STORE\", \"\")\n        # We rely on Pydantic defaults for required fields if they are missing from env.\n        # Strict existence check is removed to allow defaults to work.\n\n        min_conn = values.get(\"IRIS_MIN_CONNECTION\", 1)\n        max_conn = values.get(\"IRIS_MAX_CONNECTION\", 3)\n        if min_conn > max_conn:\n            raise ValueError(\"IRIS_MIN_CONNECTION must be less than or equal to IRIS_MAX_CONNECTION\")\n\n        return values\n","sourceCodeStart":73,"sourceCodeEnd":94,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/configs/middleware/vdb/iris_config.py#L73-L94","documentation":"Raised by IrisVectorConfig.validate_config (before-model validator) when IRIS_MIN_CONNECTION > IRIS_MAX_CONNECTION. The connection pool cannot satisfy a floor higher than its ceiling, so the validator rejects it at config load.","triggerScenarios":"Setting IRIS_MIN_CONNECTION=10 and IRIS_MAX_CONNECTION=5 (in env or values dict).","commonSituations":"Tuning pool sizing and swapping min/max, or copy-pasting numbers in the wrong order.","solutions":["Ensure IRIS_MIN_CONNECTION <= IRIS_MAX_CONNECTION (defaults 1 and 3).","If you need a bigger floor, raise IRIS_MAX_CONNECTION at least as high.","Re-check the env ordering; both must be PositiveInt."],"exampleFix":"// before\nIRIS_MIN_CONNECTION=10\nIRIS_MAX_CONNECTION=5\n// after\nIRIS_MIN_CONNECTION=5\nIRIS_MAX_CONNECTION=10","handlingStrategy":"validation","validationCode":"def iris_pool_ok(min_conn: int, max_conn: int) -> bool:\n    return min_conn <= max_conn and min_conn > 0 and max_conn > 0","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair IRIS_MIN_CONNECTION with a >= IRIS_MAX_CONNECTION.","Use pool sizing formulas (min = expected steady, max = burst).","Lint both vars together in CI."],"tags":["config","pydantic","iris","vdb","connection-pool"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}