-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
[REQUIRED] Environment Info
firebase-toolsversion: 14.19.1- Platform: macOS
[REQUIRED] Test Case
Minimal reproducible example.
[REQUIRED] Steps to Reproduce
-
Define a simple Gen 2
onTaskDispatchedfunction infunctions/index.jswithouttaskQueueOptions. This causes the Firebase deployer to auto-create a queue with the same name as the function.// functions/index.js const { onTaskDispatched } = require("firebase-functions/v2/tasks"); exports.myTaskFunction = onTaskDispatched({ region: "us-central1", }, (req) => { console.log("Executed myTaskFunction"); });
-
Deploy this function:
firebase deploy --only functions:myTaskFunction. This will succeed and create both the functionmyTaskFunctionand a Cloud Tasks queue also namedmyTaskFunction. -
Go to the Google Cloud Console -> Cloud Tasks and manually delete the
myTaskFunctionqueue. -
Wait a minute.
-
Attempt to delete the function using the CLI:
firebase functions:delete myTaskFunction.
[REQUIRED] Expected Behavior
The firebase functions:delete command should successfully delete the myTaskFunction Cloud Function and its associated resources (Cloud Run service, Eventarc trigger) without attempting to create any new resources.
[REQUIRED] Actual Behavior
The firebase functions:delete command fails. It incorrectly attempts to make a CreateQueue API call for a queue with the same name as the function. This fails with a 400 error because the queue name existed too recently. Function cannot be deleted from CLI.
Terminal Output:
firebase functions:delete myTaskFunction
✔ You are about to delete the following Cloud Functions:
myTaskFunction(us-central1)
Are you sure? Yes
i functions: deleting Node.js 20 (2nd Gen) function myTaskFunction(us-central1)...
Request to https://cloudtasks.googleapis.com/v2/projects/PROJECT/locations/us-central1/queues/myTaskFunction?updateMask=name%2Cstate had HTTP Error: 400, The queue cannot be created because a queue with this name existed too recently.
Functions deploy had errors with the following functions:
myTaskFunction(us-central1)
This shows that a delete command is incorrectly triggering a create or update operation on a related but separate resource.