firebase-functions
firebase-functions copied to clipboard
FirebaseError object endpoints[testme].availableMemoryMb failed validation
[REQUIRED] Version info
node: v16.13.1
firebase-functions: 4.0.0-rc.0 (also reproduced with 3.24.1)
firebase-tools: N/A (in yarn.lock)
firebase-admin: 11.1.0
[REQUIRED] Test case
const admin = require('firebase-admin');
const functions = require("firebase-functions");
admin.initializeApp();
exports.testme = functions.firestore.document('/users/{ts}')
.onUpdate((snap, context) => {
functions.logger.debug("This is a test");
});
[REQUIRED] Steps to reproduce
firebase deploy --only functions:testme
[REQUIRED] Expected behavior
The deployment completes successfully, as it always happened on this codebase for the last 6 months (and as far as I can recall, while working with Firebase Functions)
[REQUIRED] Actual behavior
=== Deploying to 'fenix-app-39599'...
i deploying functions
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing codebase default for deployment
Error: Failed to parse build specification:
- FirebaseError object endpoints[testme].availableMemoryMb failed validation
Having trouble? Try firebase [command] --help
Were you able to successfully deploy your functions?
See above.
Yes, this same error has cropped up today for me as well. Please look into it urgently @firebase-ops because it's impacting our software release.
Tagging @firebase-ops
Taking a look @DhruvRaiPuri @maoo
In the meantime, can you share information about the version of firebase tools used to deploy the function?
I've tried the follow, and things are unexpectedly working for me:
$ cat index.js
const functions = require("firebase-functions");
const { initializeApp } = require("firebase-admin/app");
const { getFirestore } = require("firebase-admin/firestore")
initializeApp()
exports.testme = functions.firestore.document('/users/{ts}')
.onUpdate((snap, context) => {
functions.logger.debug("This is a test");
});
$ npm ls firebase-functions
functions@ /Users/...
└── [email protected]
$ firebase --version
11.14.4
$ firebase deploy --only functions:testme
... works as before
@taeold It was happening in CI environment for me. I checked and firebase version was 11.1.0. Updated it to latest 11.14.4 and the GitHub Action worked. Firebase Functions version was already 4(release candidate).
Thanks for providing version details. From my end this issue is resolved.
Thank you @DhruvRaiPuri and @taeold .
I'm using firebase-tools version 11.14.0
and it's still failing for me. I'm trying to update to 11.14.4
but for some reason the command npm install -g firebase-tools
completes successfully but firebase --version
is still returning 11.14.0
, which is odd.
I'll keep on investigating.
I got it working again. These are my steps:
-
rm -rf functions/node_modules
- Update
package.json
to rollback versions:
From
"firebase-admin": "^11.1.0",
"firebase-functions": "^4.0.0-rc.0"
To
"firebase-admin": "^10.0.2",
"firebase-functions": "^3.23.0"
firebase --version
is 11.14.0
; node --version
is 16.14.2
.
I'm not sure what that issue really is, or where it's coming from, so I'll let you folks decide whether to close this issue or not.
Thanks for the support!
version 4.0.0 (not release candidate, but the final version) fixed this error for me.
Updating version 3.23.0 to 4.0.2 also seems to cause this issue.
Rolled back as @maoo suggests also worked for me.
I fixed this by updating firebase tools
npm install -g firebase-tools
I second this. Additional note using yarn to install didn't make the cut. I still have to use npm i - g!
I fixed this by updating firebase tools
npm install -g firebase-tools
Solucioné esto actualizando las herramientas de Firebase
npm install -g firebase-tools
Solucioné esto actualizando las herramientas de Firebase
npm install -g firebase-tools
Funciono para mi 👍🏻
Had a similar issue. Mine was due to the fact that i've just updated my Node versions to 18.x using NVM and on top of that I primarily use PNPM. my guess is that the dependencies clashed. deleting both and then installing them again starting with npm i -g firebase-tools@latest
fixed my error
I'm having the same issue when on the latest version of everything.
"firebase-admin": "^11.2.0", "firebase-functions": "^4.0.1", And Firebase CLI version 11.15.0.
I'm receiving - FirebaseError object endpoints[myhook].availableMemoryMb failed validation
My 2 cents: I had the same availableMemoryMb failed validation
error, also running from CI, and fixed it by upgrading firebase-tools:
Had errors with: [email protected]
Fixed it with: [email protected]
All while being on:
"firebase-admin": "^11.2.0",
"firebase-functions": "^4.0.1",
I fixed this by updating firebase tools
npm install -g firebase-tools
@Psycarlo https://github.com/firebase/firebase-functions/issues/1263#issuecomment-1285982331 This works. Thanks!
I fixed this by updating firebase tools
npm install -g firebase-tools
Worked for me.
Updating version 3.23.0 to 4.0.2 also seems to cause this issue.
I am experiencing the same. Did you manage to solve this?
npm install -g firebase-tools
won't do the trick for me.
Updating version 3.23.0 to 4.0.2 also seems to cause this issue.
I am experiencing the same. Did you manage to solve this?
npm install -g firebase-tools
won't do the trick for me.
No, I just downgraded to 3.23.0 for now.
I have the same issue. Only downgrading to 3.23.0 makes everything to work again
I fixed this by updating firebase tools
npm install -g firebase-tools
This worked for me as well. Be sure to switch to the functions folder.
cd functions
and then
npm install -g firebase-tools
@radykal No need to switch to the functions folder since you are installing it globally with the flag -g
I have had my firebase tools updated, I removed and reinstalled node modules(which usually works), uninstalled java and reinstalled Java 17.... and still on my Widnows PC I get the error:
Error: Failed to parse build specification: FirebaseError object endpoints[sendInvitation].availableMemoryMb failed validation
My coworker has a mac and is set up the same exact way, and his works. availableMemoryMb
is the issue. How do I fix this?
We are still having some trouble reproducing the issue consistently - it looks like error may be environment dependent.
We are going to start by adding more messages around the problematic code, but if someone can help us pin down the issue to particular code/environment, it would be much appreciated.
We are still having some trouble reproducing the issue consistently - it looks like error may be environment dependent.
We are going to start by adding more messages around the problematic code, but if someone can help us pin down the issue to particular code/environment, it would be much appreciated.
I would love to help. The problem is, my environment was working fine last week and today I can't even start the emulators.
I wanted to post an update: This issue was with my environment variables. I went back to notes I took when I first set up my windows environment. I had to unistall Java and reinstall, change environment variables etc. Everything works now. JAVA_HOME should be %JAVA_HOME% (at least in my case). But there were extra characters after the 2nd %...(no idea how that got changed) that might have been the issue.
We are still having some trouble reproducing the issue consistently - it looks like error may be environment dependent.
We are going to start by adding more messages around the problematic code, but if someone can help us pin down the issue to particular code/environment, it would be much appreciated.
My issues have been on a M2 Mac running macOS Ventura. I installed the latest version of firebase-tools and firebase-functions and this is still an issue.
UPDATE:
I seem to have fixed. For some reason, npm i -g firebase-tools
was not changing the installed firebase version. I tried npm un -g firebase-tools
and firebase was still there. Something seems to have broke on NPM when using NVM. I went ahead and removed node entirely from my mac and reinstalled nvm, then reinstalled firebase tools and now it's working. What a pain!
If you installed firebase-tools
globally, make sure to update it to the latest version with npm update -g firebase-tools
.
This fixed the validation issues for me.
"firebase-admin": "^11.2.1",
"firebase-functions": "^4.1.0",
"firebase-tools": "^11.18.0",
doesnt work, with all provided "solutions".. Where is the problem.. All i get is:
- FirebaseError object endpoints[functionXYZ].availableMemoryMb failed validation
?