Repository navigation
Closed
Description
[REQUIRED] Environment info
firebase-tools: 12.6.0
Platform: : Ubuntu
[REQUIRED] Test case
Grouping functions doesn't work anymore in firebase-tools 12.6.0
[REQUIRED] Steps to reproduce
Init a firebase project with Typescript.
{
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [
"node_modules",
".git",
"firebase-debug.log",
"firebase-debug.*.log"
],
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
]
}Write index.ts:
import { onRequest } from 'firebase-functions/v2/https'
export const Hello = {
world: onRequest((req, res) => {
res.send('Hello World')
})
}[REQUIRED] Expected behavior
Install [email protected]
npm install -g [email protected]Deploy the function firebase deploy --only functions
It works:
✔ functions: functions folder uploaded successfully
i functions: creating Node.js 20 (2nd Gen) function Hello-world(us-central1)...
✔ functions[Hello-world(us-central1)] Successful create operation.
Function URL (Hello-world(us-central1)): https://hello-world-nknfuqmg3q-uc.a.run.app
i functions: cleaning up build files...
✔ Deploy complete!
[REQUIRED] Actual behavior
Install [email protected]
npm install -g [email protected]Deploy the function firebase deploy --only functions
It fail:
i functions: creating Node.js 20 (2nd Gen) function Hello-world(us-central1)...
Could not create or update Cloud Run service hello-world, Container Healthcheck failed. Revision 'hello-world-00001-pav' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.
Logs URL: https://console.cloud.google.com/logs/viewer?project=nomnomnest&resource=cloud_run_revision/service_name/hello-world/revision_name/hello-world-00001-pav&advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22hello-world%22%0Aresource.labels.revision_name%3D%22hello-world-00001-pav%22
For more troubleshooting guidance, see https://cloud.google.com/run/docs/troubleshooting#container-failed-to-start
Functions deploy had errors with the following functions:
Hello-world(us-central1)
i functions: cleaning up build files...
Error: There was an error deploying functions

Activity
akb5566 commentedon Sep 27, 2023
Can confirm this as well.
I was using
[email protected]with Typescript.I did the following command:
After those functions were successfully deployed, Nodejs notified me that a new version of
firebase-toolsis available.So I naturally updated
firebase-toolsto 12.6.0.Then I ran the following command to continue deploy other functions:
But all the functions failed to deploy. And I got the same error as OP.
I ran the following command that were successfully executed in
12.5.3, but they also all failed to deploy in12.6.0.--
Edit 1:
After I made this comment, I tried
[email protected],[email protected],[email protected], but they all still failed to deployed with the same error. Which is weird because I was able to deploy literally the second before I updatedfirebase-toolsto12.6.0. But now I cannot deploy with any version offirebase-tools.Edit 2:
It seemed like
[email protected]somehow "corrupted" my functions that made them unable to be replaced by redeploy with any version offirebase-toolsagain.After manually deleting all the functions from
console.cloud.google.com, I am now able to deploy functions again using[email protected].I also tried to delete all the functions from
console.cloud.google.com. and deploy with[email protected]. But it failed and showed the same error as OP.aalej commentedon Sep 27, 2023
Hi everyone, thanks for reporting this issue. I was able to replicate the behavior mentioned. I tried deploying the code snippet provided using
firebase-toolsv12.5.4 and no issues were raised:However, after upgrading to
firebase-toolsv12.6.0, it raises an error when trying to deploy the same functions from above.Let me raise this to our engineering team so that they can take a look and investigate the issue.
milo- commentedon Sep 27, 2023
The last two versions (12.5.0 and 12.6.0) of firebase-tools have had critical bugs in them that should not have made it into a release.
How are the firebase team looking to improve the release and testing process to ensure that these issues don't keep occurring?
2.5.0 issue: #6290
joehan commentedon Sep 27, 2023
Hey all, fix is coming ASAP for this issue. This also highlighted a gap in our integration tests - we'll be adding coverage for function groups to catch issues like this in the future.
mortenbekditlevsen commentedon Oct 4, 2023
The PR referred to above does not fix the issue. It does a
functionId.replace("-", ".")which replaces the first instance of - with . and not all instances. It ought to use replaceAll instead.@joehan
aalej commentedon Oct 4, 2023
Thanks for pointing this out @mortenbekditlevsen,
functionId.replace("-", ".")was changed tofunctionId.replaceAll("-", ".")in #6423. This should be rolled out in the next release.