I am trying to initialize the connection to my Firebase application using admin.intializeApp with the credentials that were provided when downloading the private key in the service accounts tab of the Firebase console. The result of calling that function is Error: An internal error has occurred. Raw server response: "{}".
The application that utilizes the Firebase SDK is deployed to a Kubernetes cluster inside of GKE. It is behind an ClusterIP Service object which is reachable via an Ingress Object for external requests.
Our implementation of the function is as follows:
admin.initializeApp({
credential: admin.credential.cert({
projectId: FIREBASE_PROJECT_ID,
clientEmail: FIREBASE_CLIENT_EMAIL,
privateKey: FIREBASE_PRIVATE_KEY
})
});
Where the constants are set as environment variables.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
admin.initializeApp() is a local operation, and doesn't make any network calls. You will have to debug your app, and see what the underlying error is. It is likely to do with your use of environment variables. Can you show the code where you instantiate those constants?
@hiranya911 figured it out. I put quotes around the private key in the yaml file that shouldn't have been there.
Most helpful comment
@hiranya911 figured it out. I put quotes around the private key in the yaml file that shouldn't have been there.