New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using firebase-admin
leads to "Container Healthcheck failed." when deploying function
#7053
Comments
Hey @sebastianrueckerai, sorry to hear you’re encountering this issue. I’m currently trying to reproduce this, but so far I haven’t encountered any errors during deployment of functions. I tried running the code you provided, but I encountered some errors related to imports, so I updated the imports to the ff: import {onCall} from "firebase-functions/v2/https";
import * as admin from "firebase-admin";
import {getFirestore} from "firebase-admin/firestore";
import * as fs from "fs"; From what I can tell, the Firebase Admin SDK does not use some of the provided parameters, so I changed const prodConfig: admin.AppOptions = {
projectId: "PROJECT_ID",
storageBucket: "PROJECT_ID.appspot.com",
credential: admin.credential.cert(serviceAccountCredentials),
}; I created this repo using the code snippets provided, which also includes the changes above. In case I’m missing anything to properly replicate the issue or if I made a mistake in the setup, please let me know. Also, could you share with me the version of |
@aalej thanks for the prompt response! I found that if I do I am confused by this, should this not work with explicit credentials as well? It also leaves me with further questions:
|
I have the same issue in Next.js app
with
I manually deleted the cloud function, cleaned the artifact repository, and removed files from storage, but without success. |
@aalej any news on this? |
Hey @sebastianrueckerai - this error is almost always indicative of your code crashing on load. My best guess from you've shared is that the credentials path you've provided is not accessible when your code is uploaded to GCF. When you deploy to GCF, we zip up your In general, I'd recommend that you use the application default credentials provided by GCF to authenticate calls from your functions. If you need to use different credentials, ensure that the service account key file is included in your functions directory |
@joehan Thanks, that was indeed the issue! :) The reason it took me longer to figure that out it because as described above the link to the logs is not working. Any idea why that is? Also it would be interesting to know how to get rid of this error (details above): This still show up even of the deploy is working! |
@sebastianrueckerai Glad that cleared up the main issue! For the other issues: 'unhandled error cleaning up images' - We'll need to see the debug logs to help with one (or at the very least, the last bit of them printed from 'cleaning up build files' down. Broken Logs URL link: That link comes back as part of an error message from the Cloud Functions API, and only says it 'may' contain relevant logs, so this might just be WAI. Unfortunately, I don't really have any visibility to help here - consider filing a bug on the Google Cloud Functions public issue tracker |
Closing this for now since we address the primary issue. |
[REQUIRED] Environment info
firebase-tools: 13.7.3
Platform: Ubuntu
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Setup a TS firebase functions project with
index.ts
as above and deploy with:firebase deploy --only functions:testUseAdmin
[REQUIRED] Expected behavior
Function should deploy without issue.
[REQUIRED] Actual behavior
Below are the logs without the
--debug
flag.Adding
--debug
gives a lot more output and is leaking a lot of tokens and pathnames which are difficult to cut out. The error message at the end remains the same. Also: the error message is pointing me to some logs in GCP but following the URL, there are not logs to be found.What I learned about the error:
firebase-admin
Any help would be greatly appreciated since this is a critical blocking issue for my team and me!
LOGS:
The text was updated successfully, but these errors were encountered: