Google Cloud Eventarc trigger not firing for Firestore (2nd Gen Cloud Function) in nam5

Summary

A 2nd Gen Cloud Function deployed in us-central1 never fired because the Firestore-triggered Eventarc event was configured in nam5, a multi‑region Firestore location that does not interoperate with Eventarc triggers in single‑region Cloud Function locations. Eventarc requires co‑located trigger region, database region, and destination region for Firestore-native events.

Root Cause

The failure occurred because Firestore in nam5 cannot emit native Eventarc events to a Cloud Function deployed in us-central1. Eventarc Firestore triggers are region‑bound, and multi‑region Firestore databases only emit events within their own multi‑region boundary.

Key issues:

  • Region mismatch between Firestore (nam5) and Cloud Function (us-central1)
  • Eventarc Firestore provider does not support cross‑region delivery
  • Firestore multi‑region (nam5) is not compatible with Eventarc triggers targeting single‑region services

Why This Happens in Real Systems

Real distributed systems enforce strict regional boundaries for event routing:

  • Data sovereignty rules prevent cross‑region event propagation.
  • Latency guarantees require events to stay within the same region or multi‑region boundary.
  • Eventarc’s architecture binds Firestore-native events to the database’s region.
  • Multi‑region Firestore (nam5) behaves differently from single‑region Firestore, especially for Eventarc.

Real-World Impact

Teams often encounter:

  • Silent failures where triggers deploy successfully but never fire.
  • Misleading IAM debugging because permissions are correct but irrelevant.
  • Wasted time troubleshooting nonexistent Pub/Sub or IAM issues.
  • Unexpected architectural constraints when using multi‑region Firestore with Eventarc.

Example or Code (if necessary and relevant)

A working configuration requires the Cloud Function to be deployed in nam5, which is impossible because Cloud Functions 2nd Gen do not support multi‑region deployment.

Thus, no code example is relevant because the architecture itself is unsupported.

How Senior Engineers Fix It

Experienced engineers recognize the regional constraint and choose one of these patterns:

  • Switch Firestore to a single region (e.g., us-central1) so Eventarc can emit events to Cloud Functions 2nd Gen.
  • Use Audit Log–based Eventarc triggers instead of Firestore-native triggers:
    • Works across regions
    • Slightly higher latency
    • Emits more verbose events
  • Replace Cloud Functions with Cloud Run in the same region as Firestore (still blocked for multi‑region Firestore).
  • Use a polling or change-stream architecture:
    • Firestore Change Streams (recommended)
    • Cloud Run job or worker reading the stream
  • Redesign the event flow to avoid region‑locked triggers.

Why Juniors Miss It

Less experienced engineers often:

  • Assume multi‑region = more compatible, when it’s often the opposite.
  • Focus on IAM debugging, unaware that the issue is architectural.
  • Don’t know that Eventarc Firestore triggers require region alignment.
  • Expect GCP to automatically route events across regions.
  • Miss the fact that Cloud Functions 2nd Gen cannot deploy to multi‑regions, making the setup impossible.

If you want, I can outline a corrected architecture that works reliably with Firestore in nam5.

Leave a Comment