risingwavelabs/risingwave · error
pubsub.max_outstanding_messages must be greater than 0
Error message
pubsub.max_outstanding_messages must be greater than 0
What it means
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.
Source
Thrown at src/connector/src/source/google_pubsub/mod.rs:163
fn unknown_fields(&self) -> HashMap<String, String> {
self.unknown_fields.clone()
}
}
impl PubsubProperties {
pub(crate) fn subscriber_config(&self) -> ConnectorResult<SubscriberConfig> {
let stream_ack_deadline_seconds = self
.ack_deadline_seconds
.unwrap_or(DEFAULT_ACK_DEADLINE_SECONDS);
if !(10..=600).contains(&stream_ack_deadline_seconds) {
bail!("pubsub.ack_deadline_seconds must be between 10 and 600");
}
let max_outstanding_messages = self
.max_outstanding_messages
.unwrap_or(DEFAULT_MAX_OUTSTANDING_MESSAGES);
if max_outstanding_messages <= 0 {
bail!("pubsub.max_outstanding_messages must be greater than 0");
}
let max_outstanding_bytes = self
.max_outstanding_bytes
.unwrap_or(DEFAULT_MAX_OUTSTANDING_BYTES);
if max_outstanding_bytes <= 0 {
bail!("pubsub.max_outstanding_bytes must be greater than 0");
}
Ok(SubscriberConfig {
stream_ack_deadline_seconds,
max_outstanding_messages,
max_outstanding_bytes,
..Default::default()
})
}
pub(crate) async fn subscription_client(&self) -> ConnectorResult<Subscription> {View on GitHub (pinned to 6469eb736d)
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).
Example fix
-- before WITH (connector = 'google_pubsub', pubsub.max_outstanding_messages = 0) -- after WITH (connector = 'google_pubsub', pubsub.max_outstanding_messages = 1000)
Defensive patterns
Strategy: validation
Validate before calling
function maxOutstandingMessagesOk(v) {
return v === undefined || (Number.isInteger(v) && v > 0);
} Type guard
function isPositiveInt(v) {
return typeof v === "number" && Number.isInteger(v) && v > 0;
} Try / catch
if (maxOutstandingMessages <= 0) {
throw new RangeError("pubsub.max_outstanding_messages must be greater than 0");
} Prevention
- 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.
When it happens
Trigger: 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().
Common situations: Trying to 'disable' flow control by setting 0; sign errors when parameterizing the config from an environment variable; copy-paste of a partial config.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- pubsub.ack_deadline_seconds must be between 10 and 600
- pubsub.max_outstanding_bytes must be greater than 0
- credentials must be set if not using the pubsub emulator
- subscription {} does not exist
- specify at most one of start_offset or start_snapshot
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/52b32ef2e66f3b36.
Report an issue: GitHub.