Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Big-query api 403-Forbidden Exception

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?

like image 746
snap Avatar asked Feb 09 '15 06:02

snap


People also ask

How do I fix REST API 403 forbidden?

Check the Requested URL The most common cause of a 403 Forbidden Error is simply inputting an incorrect URL. As discussed before, many tightly secured web servers disallow access to improper URLs. This could be anything from accessing a file directory to accessing a private page meant for other users.

Why does Google say 403 Forbidden?

In more human-friendly terms, the 403 Forbidden Error means that your website's server is telling Googlebot that it does not have permission to access the page or resource you're trying to crawl.

What is a 403 error API?

An HTTP 403 response code means that a client is forbidden from accessing a valid URL. The server understands the request, but it can't fulfill the request because of client-side issues. API Gateway APIs can return 403 responses for any of the following reasons: Issue. Response header.

How do I raise exceptions in BigQuery?

Code: BEGIN SELECT 1/0; -- attempts to divide by zero RAISE USING message = "divisible with zero is not allowed."; EXCEPTION WHEN ERROR THEN SELECT FORMAT("Hey, you. When you executed %s at %s, it caused an error: %s. Please don't do that.", @@error.


1 Answers

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.

like image 80
Michael Sheldon Avatar answered Sep 20 '22 06:09

Michael Sheldon