firebase-tools: v2 functions stopped working upon upgrade to v12.5.0

[REQUIRED] Environment info

firebase-tools: v12.5.0

Platform: macOS

Using the latest firebase-tools version (12.5.0) causes runtime error in v2 functions.

Downgrading to v12.4.8 solves the issue, but had to delete the whole function beforehand.

stacktrace image

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 2
  • Comments: 29 (7 by maintainers)

Most upvoted comments

Hey all, apologies for the disruption. We’re in the process of rolling back this change in v12.5.2, which should be out shortly. We’re also working with the Google Cloud Functions team to debug this issue and ensure a smooth rollout at a later date.

If you run into this issue, the quickest way to resolve it is to upgrade to 12.5.2, then delete and redeploy any affected functions.

To confirm — after upgrading to v12.5.1 (which includes the patch to fix deployments that include both v1 and v2 functions), you are still running into runtime errors? Apologies for the inconvenience caused, and thanks for your patience as we try to get to the bottom of this issue.

Has this issue reoccurred in version v12.7.0?

I recently upgraded from version v12.4.8 to v12.7.0, and after deploying, I encountered failures in calls to all onCall functions, resulting in the following error:

TypeError: res.on is not a function
2023-10-14 14:39:41.215
    at /workspace/node_modules/firebase-functions/lib/common/providers/https.js:392:17
2023-10-14 14:39:41.215
    at new Promise (<anonymous>)
2023-10-14 14:39:41.215
    at /workspace/node_modules/firebase-functions/lib/common/providers/https.js:391:16
2023-10-14 14:39:41.215
    at /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/function_wrappers.js:141:25
2023-10-14 14:39:41.215
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Similar failures also occured in all onRequest functions:

Bad signature TypeError: Cannot read properties of undefined (reading 'stripe-signature')
    at /workspace/lib/stripe-invoicing/stripe-functions.js:30:90
    at /workspace/node_modules/firebase-functions/lib/v2/trace.js:16:28
    at /layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/function_wrappers.js:141:25
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

However, after I reverted to v12.4.8, such failures were gone.

And for other the wrong function would get called entirely (I’d get exceptions from paths that didn’t exist in the function being called.)

@JJ11teen Dude, I was debugging this for the past 4 hours. I started to hallucinate out of madness.

For me, my app was calling a function named addUser, but the passwordReset function was the one that got called and actually sent the email.

I found out that all functions were pointing to this passwordReset, which was the first one exported in my index.ts file. After commenting it out, all functions started to point to the second function being exported.