You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created my own queue with minor modifications provided in the Failing Function code used section. If someone can please help resolve the issue, I would really appreciate it.
Sample name or URL where you found the bug
quickstarts/taskqueues-backup-images/functions/index.js
How to reproduce the issue
create an index.ts file for functions with the below-mentioend code.
Deploy executeOrders function to create the queue with the same name.
execute submitOrder function.
enqueue fails with message: Unhandled error FirebaseFunctionsError: Queue does not exist.
Failing Function code used (if you modified the sample)
import * as functions from "firebase-functions";
import * as firebaseAdmin from "firebase-admin";
import * as firebaseFunctions from "firebase-admin/functions";
import * as serviceAccount from "../serviceAccount.json";
firebaseAdmin.initializeApp({
credential: firebaseAdmin.credential.cert({
projectId: serviceAccount.project_id,
clientEmail: serviceAccount.client_email,
privateKey: serviceAccount.private_key,
}),
});
export const executeOrders = functions.region(
region,
).tasks.taskQueue({
retryConfig: {
maxAttempts: 2,
minBackoffSeconds: 10,
},
rateLimits: {
maxConcurrentDispatches: 1,
},
}).onDispatch(async (data) => {
functions.logger.info(data);
});
export const submitOrder = functions.region(
region,
).https.onCall(async (data, context) => {
const queue = firebaseFunctions.getFunctions().taskQueue("executeOrders");
functions.logger.info(data);
await queue.enqueue({"orderId": 1});
});
I also have tried to pass in the app object returned from firebaseAdmin.initializeApp to firebaseFunctions.getFunctions() as below, but still the same behavior.
Start function emulator or without emulator (I have tried both ways but I get the same behavior.)
From any client call submitOrder function to enqueue a task in the executeOrders queue.
Function throws an error when enqueuing the task: Unhandled error FirebaseFunctionsError: Queue does not exist. even when the queue exists.
Debug output
{"severity":"ERROR","message":"Unhandled error FirebaseFunctionsError: Queue does not exist.\n at FirebaseFunctionsError.FirebaseError [as constructor] (/Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-admin/lib/utils/error.js:44:28)\n at FirebaseFunctionsError.PrefixedFirebaseError [as constructor] (/Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-admin/lib/utils/error.js:90:28)\n at new FirebaseFunctionsError (/Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-admin/lib/functions/functions-api-client-internal.js:269:28)\n at FunctionsApiClient.toFirebaseError (/Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-admin/lib/functions/functions-api-client-internal.js:243:16)\n at /Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-admin/lib/functions/functions-api-client-internal.js:101:25\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async /Users/darshitdave/Documents/Workspace/youvest/youvest/functions/lib/src/index.js:182:5\n at async /Users/darshitdave/Documents/Workspace/youvest/youvest/functions/node_modules/firebase-functions/lib/common/providers/https.js:407:26\n at async runFunction (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:564:9)\n at async runHTTPS (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:590:5) {\n errorInfo: {\n code: 'functions/failed-precondition',\n message: 'Queue does not exist.'\n },\n codePrefix: 'functions'\n}"}
Screenshots
Expected behavior
The task should be enqueued under executeOrders queue.
Actual behavior
Error message: Unhandled error FirebaseFunctionsError: Queue does not exist. even when the queue executeOrders exists.
The text was updated successfully, but these errors were encountered:
For me I can get around the error with specifying the location of the queue by replacing .taskQueue("executeOrders");
with .taskQueue("location/us-east1/functions/executeOrders");
Unfortunately with this working I get the error Request is missing body.
I got it to work the same way as described here by creating a separate onRequest function #1105
Which sample has a bug?
quickstarts/taskqueues-backup-images/functions/index.js
I have created my own queue with minor modifications provided in the Failing Function code used section. If someone can please help resolve the issue, I would really appreciate it.
Sample name or URL where you found the bug
quickstarts/taskqueues-backup-images/functions/index.js
How to reproduce the issue
executeOrders
function to create the queue with the same name.submitOrder
function.enqueue
fails with message:Unhandled error FirebaseFunctionsError: Queue does not exist.
Failing Function code used (if you modified the sample)
I also have tried to pass in the app object returned from
firebaseAdmin.initializeApp
tofirebaseFunctions.getFunctions()
as below, but still the same behavior.Steps to set up and reproduce
executeOrders
submitOrder
function to enqueue a task in theexecuteOrders
queue.Unhandled error FirebaseFunctionsError: Queue does not exist.
even when the queue exists.Debug output
Screenshots
Expected behavior
The task should be enqueued under
executeOrders
queue.Actual behavior
Error message:
Unhandled error FirebaseFunctionsError: Queue does not exist.
even when the queueexecuteOrders
exists.The text was updated successfully, but these errors were encountered: