-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
[REQUIRED] Environment info
firebase-tools: 13.x (latest)
Platform: Linux (WSL2)
Node.js version: 22.19.0
firebase-functions: v2
[REQUIRED] Test case
import { onDocumentCreated } from 'firebase-functions/v2/firestore'
export const processAsyncJobs = onDocumentCreated(
{
document: 'asyncJobs/{jobId}',
timeoutSeconds: 3600, // 60 minutes
region: 'asia-northeast1',
},
async (event) => {
// Long-running async job processing
}
)[REQUIRED] Steps to reproduce
- Create a Firestore trigger function with
timeoutSeconds: 3600 - Run
firebase deploy --only functions:processAsyncJobs - First deployment fails with error: "The timeout for functions with an event trigger cannot exceed 540 seconds"
- Change
timeoutSeconds: 540and deploy successfully - Change back to
timeoutSeconds: 3600and deploy again - Second deployment succeeds without error
[REQUIRED] Expected behavior
- According to Cloud Functions quotas documentation, event-driven functions (2nd gen) support up to 60 minutes timeout
- First deployment with
timeoutSeconds: 3600should succeed
[REQUIRED] Actual behavior
First deployment with timeoutSeconds: 3600:
⚠ functions: Request to https://cloudfunctions.googleapis.com/v2/projects/PROJECT_ID/locations/asia-northeast1/functions?functionId=processAsyncJobs had HTTP Error: 400, The timeout for functions with an event trigger cannot exceed 540 seconds.
⚠ functions: failed to create function projects/PROJECT_ID/locations/asia-northeast1/functions/processAsyncJobs
Failed to create function projects/PROJECT_ID/locations/asia-northeast1/functions/processAsyncJobs
Workaround:
- Deploy with
timeoutSeconds: 540→ succeeds - Update to
timeoutSeconds: 3600and deploy again → succeeds - Function runs with 60-minute timeout in production
Additional Notes:
- This appears to be a validation issue during initial function creation
- Subsequent deployments (updates) accept 3600 seconds without error
- The deployed function successfully runs with the 60-minute timeout
- The same limitation applies to both
onDocumentCreatedandonMessagePublishedtriggers