{"record":{"id":"f5d86992ae6d1a44","repo":"nautechsystems/nautilus_trader","slug":"timeout-must-be-greater-than-0","errorCode":null,"errorMessage":"Timeout must be greater than 0","messagePattern":"Timeout must be greater than 0","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/config.rs","lineNumber":360,"sourceCode":"            \"*\".repeat(value.len())\n        } else {\n            format!(\n                \"{}{}{}\",\n                &value[0..1],\n                \"*\".repeat(value.len() - 2),\n                &value[value.len() - 1..]\n            )\n        }\n    }\n\n    /// Validate configuration.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if validation fails.\n    pub fn validate(&self) -> anyhow::Result<()> {\n        if self.timeout == 0 {\n            anyhow::bail!(\"Timeout must be greater than 0\");\n        }\n\n        if self.timeout > 3600 {\n            anyhow::bail!(\"Timeout must be less than 3600 seconds\");\n        }\n\n        if let Some(port) = self.vnc_port\n            && (!(5900..=5999).contains(&port))\n        {\n            anyhow::bail!(\"VNC port must be between 5900 and 5999\");\n        }\n\n        Ok(())\n    }\n}\n\nimpl Default for DockerizedIBGatewayConfig {\n    fn default() -> Self {","sourceCodeStart":342,"sourceCodeEnd":378,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/config.rs#L342-L378","documentation":"The Interactive Brokers adapter config validation requires the request timeout to be strictly positive (seconds). A timeout of 0 would make IB client requests fail immediately or hang, so the adapter rejects it up front via IbAccountConfig::validate.","triggerScenarios":"Instantiating the IB adapter with config where timeout is set to 0 (explicitly, via defaults overridden by environment/zero-valued variables) and calling validate(), typically at adapter startup.","commonSituations":"Config files with timeout: 0, environment variables parsed to 0, copy-pasted example configs omitting a real timeout, or wiring a different zero-valued field into timeout.","solutions":["Set timeout to a positive value, e.g. 60 seconds","Check the config source (TOML/JSON/env) for a zero or missing timeout defaulting to 0","Add a startup assertion/fail-fast around validate() before connecting"],"exampleFix":"// before\nlet config = IbAccountConfig { timeout: 0, ..base };\n// after\nlet config = IbAccountConfig { timeout: 60, ..base };","handlingStrategy":"validation","validationCode":"assert!(config.timeout > 0, \"IB adapter timeout must be > 0\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = config.validate() {\n    anyhow::bail!(\"invalid IB config: {e}\"); // fail fast before connecting\n}","preventionTips":["Always call validate() at startup before connecting to IB","Set explicit timeouts (30–120s) instead of relying on defaults/env","Validate config after loading from any source (file, env, CLI)"],"tags":["rust","config","validation","interactive-brokers"],"backgroundTag":"invalid-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}