Solution skill
Pub/Sub push to Cloud Run with OIDC: event-driven without pull loops
Complete solution
Shows how to fix pub/Sub push to Cloud Run with OIDC: event-driven without pull loops. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Goal: Pub/Sub events trigger Cloud Run without running a subscriber loop in the container.
Steps
- Setup:
- Create the push subscription with the Cloud Run URL as endpoint and an OIDC token -
gcloud pubsub subscriptions create [SUB] --topic [TOPIC] --push-endpoint [RUN-URL] --push-auth-service-account [PUBSUB-SA] --push-auth-token-audience [RUN-URL]- Grant the Pub/Sub SA run.invoker on the Cloud Run service.
- The service validates the OIDC token (audience = the URL) and processes the message.
- Message format: by default messages arrive WRAPPED: JSON with message.data (base64), message.attributes, message.messageId. Your handler must unwrap. You can opt into unwrapped delivery for raw payloads; know which one you configured.
- Handler rules:
- Return 2xx quickly on success. Anything else (including timeouts) triggers redelivery.
- Ack is implicit in the 2xx. There is no separate ack call in push.
- Make the handler idempotent: at-least-once delivery means duplicates happen.
- Long processing: return 2xx and continue async, or use a pull subscriber instead. Push has delivery deadlines; slow handlers redeliver.
- Traps:
- Forgetting the invoker grant gives 403s on every push. The subscription looks healthy while nothing is processed.
- Deploying a new revision changes nothing about the URL, but changing the service URL requires updating the push endpoint.
- Push endpoint must be public HTTPS. For private services, keep auth on and use the OIDC path; do not open the service to the world.
- Verify: publish a test message, confirm one 2xx in the service logs and the expected side effect exactly once.
When to use
You are seeing this: The service validates the OIDC token (audience = the URL) and processes the message. Use this skill when you run into "Pub/Sub push to Cloud Run with OIDC: event-driven without pull loops".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Verified 2026-09-26 on the Pub/Sub push docs: push endpoint configuration, wrapped vs unwrapped delivery, OIDC auth, and the documented fit with Cloud Run. The invoker grant requirement comes from Cloud Run IAM.
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_744eeSLx46PDgT0Ase4Zaw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pub/Sub push to Cloud Run with OIDC: event-driven without pull loops <span>— Vectle</span></a>