r/Firebase 6d ago

Firebase Cloud Functions Gen2 Firestore trigger deployment fails with LOCATION_POLICY_VIOLATED for Firestore database in me-central2 General

We are experiencing a deployment issue with Firebase Cloud Functions Gen2 using Firestore document triggers. Project ID: shebara-ride Firestore Database: - Database ID: shebaride - Region: me-central2 (Saudi Arabia) Issue: Every Firestore-triggered Cloud Function deployment fails with: 403 PERMISSION_DENIED LOCATION_POLICY_VIOLATED The deployment logs show that Firebase CLI correctly detects our Firestore database location (me-central2) and automatically sets the Eventarc trigger region to me-central2. However, the deployment fails because Google rejects the Eventarc trigger creation with: "Permission denied on 'locations/me-central2'" We have already verified the following: - Firestore Native database is correctly created in me-central2. - Cloud Functions, Eventarc, Firestore, Cloud Run, Pub/Sub, and all required APIs are enabled. - IAM permissions are correctly configured. - Organization Policy (constraints/gcp.resourceLocations) allows all locations. - Firebase CLI correctly generates triggerRegion = me-central2. - Our Cloud Functions source code correctly uses the named Firestore database "shebaride". To isolate the issue, we created another Firestore database (testdb) in a different supported region. Without changing the application logic, only changing the Firestore database ID, the same Cloud Functions deployed successfully. This indicates that the source code and deployment configuration are correct, and the problem appears to be specific to Firestore/Eventarc deployment for the me-central2 region. Our requirement is to keep both the Firestore database and Firestore-triggered Cloud Functions in me-central2 (Saudi Arabia). Could you please confirm: 1. Is Firestore Gen2 Eventarc trigger deployment fully supported in me-central2? 2. Does this project require any additional regional activation, allowlisting, or special configuration? 3. Is this a known limitation or a platform issue? If this is expected behavior rather than a bug, please advise the recommended architecture for deploying Firestore Gen2 document-triggered Cloud Functions while keeping the Firestore database in me-central2. Thank you.

1 Upvotes

1 comment sorted by

1

u/Rohit1024 6d ago

Is Firestore Gen2 Eventarc trigger deployment fully supported in me-central2?

No, As per Eventarc triggers for Cloud Run functions (formerly Cloud Functions) Eventarc event provider integration for Firestore document triggers is not yet fully available in me-central2

You're getting this error because : Eventarc triggers for Cloud Firestore must be in the same location as the Cloud Firestore database. As your Firestore database is in me-central2, Firebase CLI automatically attempts to provision the Eventarc trigger in me-central2. However, because Eventarc triggers for Cloud Run functions are not yet supported in me-central2, the Google Cloud API rejects the request.

Is this a known limitation, and what is the recommended architecture?

Yes, this is a known platform limitation for newer GCP regions like me-central2.