Unable to get template
{ Error: [AUTHORIZATION_ERROR]: Permission denied fetching Google Analytics data
at FirebaseRemoteConfigError.FirebaseError [as constructor] (/Users/longvu/Works/HDC/firebase/node_modules/firebase-admin/lib/utils/error.js:43:28)
at FirebaseRemoteConfigError.PrefixedFirebaseError [as constructor] (/Users/longvu/Works/HDC/firebase/node_modules/firebase-admin/lib/utils/error.js:89:28)
at new FirebaseRemoteConfigError (/Users/longvu/Works/HDC/firebase/node_modules/firebase-admin/lib/remote-config/remote-config-api-client-internal.js:403:23)
at RemoteConfigApiClient.toFirebaseError (/Users/longvu/Works/HDC/firebase/node_modules/firebase-admin/lib/remote-config/remote-config-api-client-internal.js:242:16)
at /Users/longvu/Works/HDC/firebase/node_modules/firebase-admin/lib/remote-config/remote-config-api-client-internal.js:87:25
at process._tickCallback (internal/process/next_tick.js:68:7)
errorInfo:
{ code: 'remote-config/permission-denied',
message:
'[AUTHORIZATION_ERROR]: Permission denied fetching Google Analytics data' },
codePrefix: 'remote-config' }
I run the sample code and encountered this error! Searching in google does not provide any result, look like a new error from the sdk.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @hlongvu! Thank you for reporting this issue. I am sorry for the trouble, and let me try and help you resolve this.
Do you encounter this error only for getTemplate operations? To better understand the problem, could you please provide a code sample you used to reproduce this error?
We have seen a similar error before with the rollback operation if your Firebase project has Google Analytics enabled.
Could you try adding the role Firebase Analytics Viewer to the Service Account of your project?
On the Firebase Console, if you navigate to Settings -> Service accounts you will see a link to Manage service account permissions. Clicking this link will take you to Google Cloud Console where you can add the role Firebase Analytics Viewer to that Service Account.
Thanks @lahirumaramba, adding Firebase Analytics Viewer permission resolved this issue.
@lahirumaramba I'm having the same issue but seems like I cannot see "Firebase Analytics Viewer" role over in Google Cloud console.
This is what I do:
in Google Cloud Console >> Service Accounts >> Permissions >> Grant Access, then in Roles section I search for Firebase Analytics Viewer, nothing shows up there. Appreciate any help
Hi @amirrezvanibc! You are right! It looks like the role does not show up in Service Accounts >> Permissions.
Could you check in IAM >> Permissions instead? You should be able to edit the Firebase service account from there and add a new role for Firebase Analytics Viewer. Let me know if that doesn't work.
thanks @lahirumaramba, it worked from IAM >> permissions
Most helpful comment
Hi @hlongvu! Thank you for reporting this issue. I am sorry for the trouble, and let me try and help you resolve this.
Do you encounter this error only for
getTemplateoperations? To better understand the problem, could you please provide a code sample you used to reproduce this error?We have seen a similar error before with the
rollbackoperation if your Firebase project has Google Analytics enabled.Could you try adding the role
Firebase Analytics Viewerto the Service Account of your project?On the Firebase Console, if you navigate to
Settings -> Service accountsyou will see a link toManage service account permissions. Clicking this link will take you to Google Cloud Console where you can add the roleFirebase Analytics Viewerto that Service Account.