'Failed to generate a private key. Please try again in a few minutes. Firebase doesn't generate new private key for a project
I want to generate a new private key from firebase to use the database APIs that firebase provides. When I click on get new private key to download the private key, I get this message:
Failed to generate a private key. Please try again in a few minutes.
How should I proceed to get the new private key now? Why is this happening, Do I have the permissions to download the new private key? (I am a viewer to the firebase project)
Solution 1:[1]
VIewer does not have the permission iam.serviceAccountKeys.create which is required to create service account keys.
You must add a role to your identity that contains that permission such as roles/iam.serviceAccountKeyAdmin
Solution 2:[2]
- Project Viewers don’t have the access to manage the Service Account Private keys. This is the reason you got that message when you tried to create a private key. As mentioned in this documentation, you should have the Service Account Key Admin role (roles/iam.serviceAccountKeyAdmin) to manage the Service Account keys.
- The Service Account Key Admin role alone is sufficient to create a Private Key. But without the Project Viewer Role you won’t be able to view the page to create a Private Key from the Firebase Console. So please ask the Project Owner or someone who has the access to grant IAM Roles on the Project to grant you the Service Account Key Admin role in addition to the Project Viewer role.
Solution 3:[3]
If your Chrome browser has an update pending, Firebase throws this message. Update your Chrome and retry, it should work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | John Hanley |
| Solution 2 | Prabir |
| Solution 3 | Abhijit Pani |
