risingwavelabs/risingwave · error

subscription {} does not exist

Error message

subscription {} does not exist

What it means

After building the subscription client, the PubSub enumerator verifies the subscription actually exists via sub.exists(). If the PubSub service reports the subscription is absent, new() bails with this error including the subscription id. A source cannot read from a subscription that Google Cloud does not have.

Source

Thrown at src/connector/src/source/google_pubsub/enumerator/client.rs:59

            tracing::warn!(
                "pubsub.parallelism is deprecated and will be ignored. \
                 Split count now adapts automatically to the number of actors."
            );
        }

        properties.subscriber_config()?;

        if properties.credentials.is_none() && properties.emulator_host.is_none() {
            bail!("credentials must be set if not using the pubsub emulator")
        }

        let sub = properties.subscription_client().await?;
        if !sub
            .exists(None)
            .await
            .context("error checking subscription validity")?
        {
            bail!("subscription {} does not exist", &sub.id())
        }

        let seek_to = match (properties.start_offset, properties.start_snapshot) {
            (None, None) => None,
            (Some(start_offset), None) => {
                let ts = start_offset
                    .parse::<i64>()
                    .context("error parsing start_offset")
                    .map(|nanos| Utc.timestamp_nanos(nanos).into())?;
                Some(SeekTo::Timestamp(ts))
            }
            (None, Some(snapshot)) => Some(SeekTo::Snapshot(snapshot)),
            (Some(_), Some(_)) => {
                bail!("specify at most one of start_offset or start_snapshot")
            }
        };

        if let Some(seek_to) = seek_to {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Run `gcloud pubsub subscriptions list` (or check the console) and copy the exact subscription id into the WITH clause.
  2. Ensure the credentials' project matches the project that owns the subscription, or qualify the subscription with the correct project.
  3. Create the missing subscription: `gcloud pubsub subscriptions create my-sub --topic=my-topic`.
  4. If using the emulator, create the topic and subscription in the emulator before starting RisingWave.
  5. Check subscription expiration: recreate it or remove the expiration policy if PubSub auto-deleted it.

Example fix

-- before (typo / wrong project)
WITH (connector = 'google_pubsub', pubsub.subscription = 'my-subs')
-- after (exact existing subscription id)
WITH (connector = 'google_pubsub', pubsub.subscription = 'projects/my-project/subscriptions/my-sub')
Defensive patterns

Strategy: validation

Validate before calling

# verify the subscription exists before creating the source
gcloud pubsub subscriptions describe projects/my-project/subscriptions/my-sub
gcloud pubsub subscriptions list --format="value(name)"

Type guard

async fn subscription_exists(client: &Subscription, project: &str, name: &str) -> bool {
    client.exists(None).await.unwrap_or(false)
}

Try / catch

match client::new(props).await {
    Err(e) if e.to_string().contains("does not exist") => {
        eprintln!("create the subscription first, or fix its name/project: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Creating/starting a PubSub source whose `pubsub.subscription` names a subscription that doesn't exist in the target GCP project (or the project the credentials resolve to), causing the exists() check to return false.

Common situations: Typo in subscription name; subscription created in a different project than the credentials' project; subscription auto-deleted by PubSub after inactivity (expiration/deletion policy); connecting to an emulator that has no subscription set up.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/703ac9dd428987db. Report an issue: GitHub.