Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cloud Translation Permission

So I'm pulling my hair out over this and reaching out here for help. I'm trying to set up a service account with Cloud Translation, and Text-to-speech enabled, but we keep getting this response:

 [error]  {
    "message": "Cloud IAM permission 'cloudtranslate.generalModels.predict' denied. ",
    "code": 7,
    "status": "PERMISSION_DENIED",
    "details": []
} 

I have confirmed that the service account has the "cloudtranslate.generalModels.predict" permission, and showing the "Cloud Translation API User" role. We've also confirmed that it works with a different Service account that my colleague set up in his personal Google console profile. But, we need this setup with an account through our org. 

I did verify that the service account has the permission from the https://console.cloud.google.com/iam-admin/troubleshooter so and that my organization's admin sees that the service account is granted access through ancestor policies.  

So what else can we check? 

Solved Solved
0 3 4,341
1 ACCEPTED SOLUTION

Ok, turned out we had a hard-coded value for resource location, which was set to the wrong project. So of course it was coming back as permission denied. 

View solution in original post

3 REPLIES 3

Ok, turned out we had a hard-coded value for resource location, which was set to the wrong project. So of course it was coming back as permission denied. 

Hi Everyone, 

I am facing the same error. I am using a separate cloud Linux and using nodejs client library 

@Google-cloud/translate.  I am using service account key and set it at env variable 
GOOGLE_APPLICATION_CREDENTIALS.
 
Case 1) When I execute the the translation code directly as java script it does execute successfully.
Case 2) When I call this client library inside an Express REST Application, I am getting permission denied error. I have verified that it is same service account which has IAM access role "Cloud Translation API Admin". This is very strange.
Complete Error :   "" 
Error: 7 PERMISSION_DENIED: Cloud IAM permission 'cloudtranslate.generalModels.predict' denied.""
 
Any help is appreciated!

I ran into this same issue and it was also the wrong "Project ID" being passed in.