{"record":{"id":"52b32ef2e66f3b36","repo":"risingwavelabs/risingwave","slug":"pubsub-max-outstanding-messages-must-be-greater-th","errorCode":null,"errorMessage":"pubsub.max_outstanding_messages must be greater than 0","messagePattern":"pubsub\\.max_outstanding_messages must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/google_pubsub/mod.rs","lineNumber":163,"sourceCode":"    fn unknown_fields(&self) -> HashMap<String, String> {\n        self.unknown_fields.clone()\n    }\n}\n\nimpl PubsubProperties {\n    pub(crate) fn subscriber_config(&self) -> ConnectorResult<SubscriberConfig> {\n        let stream_ack_deadline_seconds = self\n            .ack_deadline_seconds\n            .unwrap_or(DEFAULT_ACK_DEADLINE_SECONDS);\n        if !(10..=600).contains(&stream_ack_deadline_seconds) {\n            bail!(\"pubsub.ack_deadline_seconds must be between 10 and 600\");\n        }\n\n        let max_outstanding_messages = self\n            .max_outstanding_messages\n            .unwrap_or(DEFAULT_MAX_OUTSTANDING_MESSAGES);\n        if max_outstanding_messages <= 0 {\n            bail!(\"pubsub.max_outstanding_messages must be greater than 0\");\n        }\n\n        let max_outstanding_bytes = self\n            .max_outstanding_bytes\n            .unwrap_or(DEFAULT_MAX_OUTSTANDING_BYTES);\n        if max_outstanding_bytes <= 0 {\n            bail!(\"pubsub.max_outstanding_bytes must be greater than 0\");\n        }\n\n        Ok(SubscriberConfig {\n            stream_ack_deadline_seconds,\n            max_outstanding_messages,\n            max_outstanding_bytes,\n            ..Default::default()\n        })\n    }\n\n    pub(crate) async fn subscription_client(&self) -> ConnectorResult<Subscription> {","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/google_pubsub/mod.rs#L145-L181","documentation":"subscriber_config validates max_outstanding_messages, which caps how many unacknowledged messages the streaming pull client may hold. If the configured value (or the default, when unset) is <= 0 the config is rejected, because google-cloud-pubsub requires a positive flow-control limit.","triggerScenarios":"Setting `pubsub.max_outstanding_messages` to 0 or a negative number in the source WITH clause; a bad default or computed value feeding into subscriber_config().","commonSituations":"Trying to 'disable' flow control by setting 0; sign errors when parameterizing the config from an environment variable; copy-paste of a partial config.","solutions":["Set pubsub.max_outstanding_messages to a positive integer (e.g. 1000).","Remove the property to use DEFAULT_MAX_OUTSTANDING_MESSAGES.","If the value comes from an env/variable, sanitize it before substitution (ensure > 0)."],"exampleFix":"-- before\nWITH (connector = 'google_pubsub', pubsub.max_outstanding_messages = 0)\n-- after\nWITH (connector = 'google_pubsub', pubsub.max_outstanding_messages = 1000)","handlingStrategy":"validation","validationCode":"function maxOutstandingMessagesOk(v) {\n  return v === undefined || (Number.isInteger(v) && v > 0);\n}","typeGuard":"function isPositiveInt(v) {\n  return typeof v === \"number\" && Number.isInteger(v) && v > 0;\n}","tryCatchPattern":"if (maxOutstandingMessages <= 0) {\n  throw new RangeError(\"pubsub.max_outstanding_messages must be greater than 0\");\n}","preventionTips":["Flow control cannot be 'disabled' with 0; remove the property instead.","Check sign/unit when sourcing values from environment variables.","Clamp with Math.max(1, value) in config generators."],"tags":["gcp","pubsub","configuration","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}