Closed sudhxnva closed 1 year ago
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
@google-oss-bot The issue is up to date with all the fields filled out
@sudhxnva experienced same issue - looks like there is a disconnect between correct Cloud Functions config and what Firebase tools actually try to apply. Hosting deploy tries to set as a max instance count to extremely big numbers - in my case according to logs it was 3000 that is definitely failing. You can manually set the max instance count in frameworksBackend
config in firebase.json
. In fact you can set any config value that can cause deployment problem in frameworksBackend
and it will be used during deployment.
Working firebase.json
, checked with Firebase tools v11.30.0
{
"hosting": {
"source": ".",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"frameworksBackend": {
"region": "us-east1",
"maxInstances": 10
}
}
}
@coderDove Thank you! I will try this solution :)
I am using Firebase App Hosting, which is different from Firebase Hosting as it can deploy from your GitHub repo each time you push a new commit. I noticed in the logs that it was assigning more than 10 maxInstances:
INFO 2024-08-03T17:09:38.003483886Z Step #3: runConfig:
INFO 2024-08-03T17:09:38.003485352Z Step #3: cpu: 1
INFO 2024-08-03T17:09:38.003486074Z Step #3: memoryMiB: 512
INFO 2024-08-03T17:09:38.003486968Z Step #3: concurrency: 80
INFO 2024-08-03T17:09:38.003487545Z Step #3: maxInstances: 100
INFO 2024-08-03T17:09:38.003488121Z Step #3: minInstances: 0
To address this, I added the following to my apphosting.yaml:
runConfig: cpu: 1 memoryMiB: 512 concurrency: 80 maxInstances: 2 minInstances: 0
Environment info
firebase-tools: 11.27.0
Platform: macOS
Test case
Deploying a boilerplate Next.js application using Firebase Hosting
Steps to reproduce
Enable the web frameworks preview:
Generate a boilerplate Next.js app with the CLI:
Try to deploy it:
Expected behavior
App gets deployed on firebase hosting
Actual behavior
CLI recognizes that it needs to build a Cloud Function since it contains dynamic routes, but it fails at the time of creating this Cloud function:
My guess from going through the logs is that the CLI is requesting for 80 max instances, but when I try to manually create a Cloud Function in the GCP console, it only allows me to set max instances 10. I already have a few Cloud Functions deployed via Firebase, not sure if that reduces the number of instances I can create.
Debug Logs