Cloud Run (Firebase Functions Gen2) returns Firestore PERMISSION_DENIED despite roles/datastore.user on service account
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với đường dẫn ghi Firestore của HTTP endpoint thông qua Firebase Admin SDK và cấu hình runtime của Firebase Functions Gen2/Cloud Run. Xác minh service account nào được sử dụng tại runtime và đối chiếu với các account được liệt kê trong issue. Được xem là hoàn thành khi xác định được cấu hình chịu trách nhiệm và hành vi IAM dự kiến của đường dẫn ghi đã được ghi lại hoặc tái hiện.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I am running a backend for an Android app using Firebase Functions Gen2 (Cloud Run).
The backend exposes an HTTP endpoint and uses the Firebase Admin SDK to write to Firestore.
The endpoint is reachable and processes requests, but every Firestore write fails with:
PERMISSION_DENIED: Missing or insufficient permissions
This happens consistently and results in HTTP 500 responses.
Environment
Firebase Functions Gen2 (running on Cloud Run)
Firebase Admin SDK (Node.js)
Firestore (Native mode)
Android client calling the HTTP endpoint
No client-side Firestore access involved
Expected behavior
Firestore writes via Admin SDK should succeed when the runtime service account has the required IAM role.
Actual behavior
HTTP request reaches the Cloud Run service
Business logic executes
Firestore write fails with PERMISSION_DENIED
Error persists even after redeploying the service
What I have already verified
Firestore security rules are not the cause (Admin SDK is used)
IAM role roles/datastore.user has been granted to:
App Engine default service account
A dedicated custom service account
Service was redeployed after IAM changes
No hardcoded credentials or service account keys are used
Despite this, Firestore access is still denied.
Questions
Which service account is actually used at runtime by Firebase Functions Gen2 / Cloud Run?
Is the Compute Engine default service account used by default unless explicitly overridden?
Is it considered best practice to explicitly set a runtime service account for Cloud Run when using Firestore?
Are there known cases where the Admin SDK still fails with PERMISSION_DENIED due to IAM misconfiguration in Cloud Run Gen2?
Any clarification or guidance would be highly appreciated.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.7k
- Fork
- 419
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-admin-node
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
firebase/firebase-admin-node#3234 ·
-
firebase/firebase-admin-node#3221 · 3 bình luận · 1 người được giao ·
-
api: messaging
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
firebase/firebase-admin-node#3215 ·
-
api: messaging
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
firebase/firebase-admin-node#3214 ·
-
api: firestore type: feature request
firebase/firebase-admin-node#3183 · 1 bình luận · 1 người được giao ·
Tất cả issue của firebase/firebase-admin-node
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bcgov/bc-wallet-mobile#4761 · 1 bình luận ·
-
external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100