7

I am getting the following JSON exception while I am executing the query using the java application for Big-Query API. Following is the exception I am getting:

    {
    "error": {
    "errors": [
    {
    "domain": "global",
    "reason": "accessDenied",
    "message": "Access Denied: Job eco-span-847:job_LyHmZIvlY1_0J8JQ3pxThEBf19I: The user does not have permission to run a query in project eco-span-847"
    }

],
"code": 403,
"message": "Access Denied: Job eco-span-847:job_LyHmZIvlY1_0J8JQ3pxThEBf19I: The user does not have permission to run a query in project eco-span-847"
}
}

Why is this occurring and how could I resolve this?

Miheretab Alemu
  • 956
  • 2
  • 20
  • 43
snap
  • 71
  • 1
  • 1
  • 3
  • This is a permissions problems, but more info is needed to debug. Do the same queries work while logged in as you on the browser? – Felipe Hoffa Feb 09 '15 at 22:29

2 Answers2

9

To insert a query job in a project the calling user must be at least a Reader on the project.

When using the BigQuery API, you need to construct the client with OAuth credentials for some user. For programmatic access, this is often a Service Account identity. When you create a new Service Account, that account is not automatically added a membership role to your project.

To update the users and service accounts that are members of your project, go to https://console.developers.google.com/ for your project, select "Permissions" in the navigation panel, and make sure the user or service account identity you are calling with is a "Reader" on the project.

Michael Sheldon
  • 2,027
  • 11
  • 7
0
  1. Check email/service account is it added in google cloud's IAM&Admin.
  2. Verify the role/permission to use certain api. access control

If above are not met, communicate with the Owner/Admin of the project to add them in.