{"record":{"id":"d139732bbf84e761","repo":"infiniflow/ragflow","slug":"invalid-time-buffer-seconds-value-time-buffer-se","errorCode":null,"errorMessage":"Invalid time_buffer_seconds value ({time_buffer_seconds!r}); expected an integer.","messagePattern":"Invalid time_buffer_seconds value \\((.+?)\\); expected an integer\\.","errorType":"validation","errorClass":"ConnectorValidationError","httpStatus":null,"severity":"error","filePath":"common/data_source/jira/connector.py","lineNumber":131,"sourceCode":"        self.scoped_token = scoped_token\n        self.jira_client: JIRA | None = None\n\n        self.max_ticket_size = JIRA_CONNECTOR_MAX_TICKET_SIZE\n        self.attachment_size_limit = attachment_size_limit if attachment_size_limit and attachment_size_limit > 0 else _DEFAULT_ATTACHMENT_SIZE_LIMIT\n        self._fields_param = _DEFAULT_FIELDS\n        self._slim_fields = _SLIM_FIELDS\n\n        tz_offset_value = float(timezone_offset) if timezone_offset is not None else float(JIRA_TIMEZONE_OFFSET)\n        self.timezone_offset = tz_offset_value\n        self.timezone = timezone(offset=timedelta(hours=tz_offset_value))\n        self._timezone_overridden = timezone_offset is not None\n        if time_buffer_seconds is None:\n            buffer_value = JIRA_SYNC_TIME_BUFFER_SECONDS\n        else:\n            try:\n                buffer_value = int(time_buffer_seconds)\n            except (TypeError, ValueError) as exc:\n                raise ConnectorValidationError(f\"Invalid time_buffer_seconds value ({time_buffer_seconds!r}); expected an integer.\") from exc\n        self.time_buffer_seconds = max(0, buffer_value)\n\n    # -------------------------------------------------------------------------\n    # Connector lifecycle helpers\n    # -------------------------------------------------------------------------\n\n    def load_credentials(self, credentials: dict[str, Any]) -> dict[str, Any] | None:\n        \"\"\"Instantiate the Jira client using either an API token or username/password.\"\"\"\n        jira_url_for_client = self.jira_base_url\n        if self.scoped_token:\n            if is_atlassian_cloud_url(self.jira_base_url):\n                try:\n                    jira_url_for_client = scoped_url(self.jira_base_url, \"jira\")\n                except ValueError as exc:\n                    raise ConnectorValidationError(str(exc)) from exc\n            else:\n                logger.warning(\"[Jira] Scoped token requested but Jira base URL does not appear to be an Atlassian Cloud domain; scoped token ignored.\")\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/common/data_source/jira/connector.py#L113-L149","documentation":"ConnectorValidationError raised when the optional time_buffer_seconds constructor argument cannot be converted with int() - i.e. it is a non-numeric string like '90s', a float such as 1.5, or a type like a list or dict. None is allowed (falls back to JIRA_SYNC_TIME_BUFFER_SECONDS); valid ints and int-strings are accepted.","triggerScenarios":"Passing time_buffer_seconds='30s' or 1.5, or a value read from an env var/config without prior numeric validation. int('1.5') and int([1]) raise TypeError/ValueError, both caught and re-raised as this validation error.","commonSituations":"Config values authored as strings with units ('30s') by analogy with other settings; env vars parsed as strings; UI numeric inputs not validated before reaching the connector.","solutions":["Pass a plain integer or an integer string: time_buffer_seconds=3600 or '3600'.","If the config may hold units or floats, normalize before construction: int(float(value)) after stripping units.","Add schema validation (e.g. a pydantic int type) on the config layer that feeds the connector."],"exampleFix":"# before\nconnector = JiraConnector(jira_base_url=url, time_buffer_seconds='30s')  # ValueError\n\n# after\nconnector = JiraConnector(jira_base_url=url, time_buffer_seconds=30)","handlingStrategy":"validation","validationCode":"def valid_time_buffer_seconds(value) -> bool:\n    if value is None:\n        return True\n    if isinstance(value, bool):\n        return False\n    try:\n        int(value)\n        return True\n    except (TypeError, ValueError):\n        return False","typeGuard":"def is_int_coercible(value) -> bool:\n    if isinstance(value, bool):\n        return False\n    try:\n        int(value)\n        return True\n    except (TypeError, ValueError):\n        return False","tryCatchPattern":"try:\n    connector = JiraConnector(jira_base_url=url, time_buffer_seconds=buffer_cfg)\nexcept ConnectorValidationError as e:\n    if 'time_buffer_seconds' in str(e):\n        connector = JiraConnector(jira_base_url=url)  # fall back to the default buffer\n    else:\n        raise","preventionTips":["Declare numeric config fields as int in the schema layer, not free-form strings.","Reject values with unit suffixes at config parse time.","When None is acceptable, pass None explicitly rather than an empty string."],"tags":["jira","validation","configuration","type-error"],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}