Unable to access Bigtable table from application

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

  1. Go to the Google Cloud console.
  2. On left navigation pane, select IAM & Admin > IAM.
  3. Select target service account and review roles assigned to service account under column Role.
  4. 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.