quickwit-oss/quickwit · error

GCP PubSub subscription `{subscription_name}` does not exist

Error message

GCP PubSub subscription `{subscription_name}` does not exist

What it means

While initializing the GCP PubSub source, `try_new` verifies the configured subscription actually exists via `subscription.exists(...)`. If the check returns false, source creation fails because the subscription cannot be polled.

Source

Thrown at quickwit/quickwit-indexing/src/source/gcp_pubsub_source.rs:138

        }

        let client = Client::new(client_config)
            .await
            .context("failed to create GCP PubSub client")?;
        let subscription = client.subscription(&subscription_name);
        // TODO: replace with "<node_id>/<index_id>/<source_id>/<pipeline_ord>"
        let partition_id = append_random_suffix(&format!("gpc-pubsub-{subscription_name}"));
        let partition_id = PartitionId::from(partition_id);

        info!(
            index_id=%source_runtime.index_id(),
            source_id=%source_runtime.source_id(),
            subscription=%subscription_name,
            max_messages_per_pull=%max_messages_per_pull,
            "starting GCP PubSub source"
        );
        if !subscription.exists(Some(RetrySetting::default())).await? {
            anyhow::bail!("GCP PubSub subscription `{subscription_name}` does not exist");
        }
        Ok(Self {
            source_runtime,
            subscription_name,
            subscription,
            state: GcpPubSubSourceState::default(),
            backfill_mode_enabled,
            partition_id,
            max_messages_per_pull,
        })
    }

    fn should_exit(&self) -> bool {
        self.backfill_mode_enabled && self.state.num_consecutive_empty_batches >= 10
    }
}

#[async_trait]

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Verify the subscription exists: `gcloud pubsub subscriptions list --project=<project>` and correct the name in the source config.
  2. Check that the configured project ID matches the project hosting the subscription.
  3. Confirm credentials (GOOGLE_APPLICATION_CREDENTIALS) grant pubsub.viewer/subscriber access to the subscription.

Example fix

// before
subscription: my-subscritpion
// after
gcloud pubsub subscriptions describe my-subscription --project=my-project
# then fix the config
subscription: my-subscription
Defensive patterns

Strategy: validation

Validate before calling

gcloud pubsub subscriptions describe $SUBSCRIPTION --project=$PROJECT >/dev/null && echo OK || echo 'subscription missing'

Try / catch

// catch and surface a config hint
if err.to_string().contains("does not exist") {
    tracing::error!(%subscription_name, "fix the subscription name or project in the source config");
}

Prevention

When it happens

Trigger: `GcpPubSubSource::try_new` is called with a subscription name whose `exists(Some(RetrySetting::default())).await` check returns `false`.

Common situations: Typo in the subscription or project ID in the source config; subscription deleted in GCP console; credentials pointing at the wrong GCP project.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/5952fa29442f0072. Report an issue: GitHub.