-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Crash when deploying change to minInstances on v1 function in us-west1 due to undefined tier #6980
Copy link
Copy link
Closed
Description
[REQUIRED] Environment info
firebase-tools: 13.7.1
Platform: macOS / Linux
[REQUIRED] Test case
firebase deploy --only functions --project my-project --debug
However, you must also have a function with endpoint=gcfv1, region=us-west1
[REQUIRED] Steps to reproduce
Try to change reduce to zero the minInstances of the gcfv1 function in us-west1 and deploy
[REQUIRED] Expected behavior
The CLI shows a pricing warning about the minimum instances
[REQUIRED] Actual behavior
Crash with:
[2024-04-10T10:47:37.720Z] TypeError: Cannot read properties of undefined (reading 'ram')
at Object.monthlyMinInstanceCost (/proj/node_modules/firebase-tools/lib/deploy/functions/pricing.js:147:38)
at /proj/node_modules/firebase-tools/lib/deploy/functions/prompts.js:139:32
at Array.some (<anonymous>)
at Object.someEndpoint (/proj/node_modules/firebase-tools/lib/deploy/functions/backend.js:263:38)
at promptForMinInstances (/proj/node_modules/firebase-tools/lib/deploy/functions/prompts.js:124:35)
at prepare (/proj/node_modules/firebase-tools/lib/deploy/functions/prepare.js:177:47)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async chain (/proj/node_modules/firebase-tools/lib/deploy/index.js:38:9)
at async deploy (/proj/node_modules/firebase-tools/lib/deploy/index.js:95:5)
Error: An unexpected error has occurred.
- This is because at line 146 of
pricing.js,tieris undefined (because at line 142, theV1_REGION_TO_TIER[endpoint.region]index fails) - This is in turn because
V1_REGION_TO_TIERearlier in the file does not contain an entry forus-west1(only us-west2 through us-west4, and despiteV2_REGION_TO_TIERcontaining it)
Notes
Is this (v1 function in us-west1) an unsupported configuration?
Reactions are currently unavailable