{"record":{"id":"8d94560567fd350a","repo":"risingwavelabs/risingwave","slug":"pubsub-max-outstanding-bytes-must-be-greater-than","errorCode":null,"errorMessage":"pubsub.max_outstanding_bytes must be greater than 0","messagePattern":"pubsub\\.max_outstanding_bytes must be greater than 0","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/source/google_pubsub/mod.rs","lineNumber":170,"sourceCode":"        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> {\n        // initialize env\n        {\n            tracing::debug!(\"setting pubsub environment variables\");\n            if let Some(emulator_host) = &self.emulator_host {\n                // safety: only read in the same thread below in with_auth\n                unsafe { std::env::set_var(\"PUBSUB_EMULATOR_HOST\", emulator_host) };\n            }","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/source/google_pubsub/mod.rs#L152-L188","documentation":"subscriber_config validates max_outstanding_bytes, the flow-control cap on the total size of unacknowledged messages held by the streaming pull client. A value <= 0 is rejected because the underlying google-cloud-pubsub client requires a positive byte limit.","triggerScenarios":"Setting `pubsub.max_outstanding_bytes` to 0 or a negative number in the source WITH clause, then constructing the subscriber (subscriber_config called from new).","commonSituations":"Attempting to disable byte-based flow control with 0; unit confusion (setting a negative after unit conversion); templating bugs producing '-1'.","solutions":["Set pubsub.max_outstanding_bytes to a positive byte count (e.g. 104857600 for 100MB).","Remove the property to fall back to DEFAULT_MAX_OUTSTANDING_BYTES.","Fix any upstream computation/env substitution that yields a non-positive value."],"exampleFix":"-- before\nWITH (connector = 'google_pubsub', pubsub.max_outstanding_bytes = -1)\n-- after\nWITH (connector = 'google_pubsub', pubsub.max_outstanding_bytes = 104857600)","handlingStrategy":"validation","validationCode":"function maxOutstandingBytesOk(v) {\n  return v === undefined || (Number.isInteger(v) && v > 0);\n}","typeGuard":"function isPositiveByteCount(v) {\n  return typeof v === \"number\" && Number.isInteger(v) && v > 0;\n}","tryCatchPattern":"if (maxOutstandingBytes <= 0) {\n  throw new RangeError(\"pubsub.max_outstanding_bytes must be greater than 0\");\n}","preventionTips":["Use explicit byte values (e.g. 104857600) rather than computed negatives.","Sanitize any unit conversions (MB/GB -> bytes) before substitution.","Keep a documented positive default instead of trying to opt out of flow control."],"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"}