Problem
Permission denied error while accessing Cloud Bigtable table from application deployed as Managed Instance Group (MIG).
PERMISSION_DENIED: Access denied. Missing IAM permission: bigtable.tables.readRows.
Environment
- Cloud Bigtable
- Managed Instance Group
Solution
- Go to the Google Cloud console.
- On left navigation pane, select IAM & Admin > IAM.
- Select target service account and review roles assigned to service account under column Role.
- Make sure service account has either a bigtable.user or bigtable.reader role or a custom role (with a bigtable.tables.readRows permission) assigned
Once we validated the service account, check environment parameter set inside MIG instance. Environment parameter would have set incorrectly inside instance due to which PERMISSION_DENIED error got generated.
Cause
This error indicates that either the instance is using a service account that does not have the correct permissions or an environment parameter is set incorrectly inside the instance.