Access Denied: User does not have bigquery.jobs.create permission - google-bigquery

Since a few days ago, I've been getting the following error when running any query on the GHTorrent and SOTorrent datasets on BigQuery:
Access Denied: Project ghtorrent-bq: User does not have bigquery.jobs.create permission in project ghtorrent-bq.
The error shows up even for the simplest queries, such as SELECT * FROM 'ghtorrent-bq.ght.issues' LIMIT 1000. The same query worked without any problems until a few days ago, and I have no idea what might cause this new behaviour.

The **ghtorrent-bq** and **sotorrent-org** are projects with public datasets. Therefore, you should be able to access its data as long as you are compliant with the dataset permissions. You can check it as follows (in the example I will be using the ghtorrent-bq project and ght dataset):
Click at the project, in the bottom left side of the BigQuery console
Select the dataset, in this case I selected ght
Below the query editor, click SHARE DATASET
Now, under the tab DATASET PERMISSIONS you can see the authorised menmber and each role
Click the BigQuery Data Viewer role, you can see that one of the members is allAuthenticatedUsers
Therefore, if you are authenticated with a google account using BigQuery, you should be able to see the data within the dataset.
The next point, and usual cause of this error, you should check if you selected the project. I was able to reproduce your error when not selecting the project. Inside the BigQuery Console, on the upper right side of the screen, confirm if there is a project selected -if not, it will be written Select Project. After selecting the project, you should have the permission to run a query against the data within these datasets.

Stumbled upon this answer with a slightly different problem.
If that's your case too, you might need to give the reading user not only the BigQuery Data Viewer permission but also BigQuery Job User:

There's no longer a bigquery job user role. There's a metadata viewer, data viewer, data owner, data editor roles.
I granted all 4 of these to both the project and dataset and still get the error Access Denied...User does not have bigquery.datasets.create permission in project. Even though it's owner of the project!

You need to select a project, in the bottom left side of the BigQuery console

Even though after giving all access to the user, are still facing access denied error then there's one more thing to do which might help you to solve this issue. In my case it works so I think you should try as well.
string projectId = "YourProjectID";
var client = BigQueryClient.Create(projectId);
using (var fs = new FileStream(#"jsonPath", FileMode.Open, FileAccess.Read))
{
var credentialParameters = NewtonsoftJsonSerializer.Instance.Deserialize<JsonCredentialParameters>(fs);
}
With the help of above mentioned code you'll be able to find email id of that user and then check whether that user have all necessary access or not.

Related

Can't save query in Schedule Query. "Scheduled Query Error"

I have created a View in BigQuery and want to set it to update. When trying to save a query in a Schedule Query, an error occurs: Scheduled Query Error
This error is about permissions. You need these permissions to create a query scheduler with BigQuery:
bigquery.transfers.update or (bigquery.jobs.create and
bigquery.transfers.get )
bigquery.jobs.create
bigquery.datasets.update
Another option is adding this role roles/bigquery.admin , including all the permissions you need to schedule or modify a query.
You can read more information about permissions.
When I run a query, unless I manually specify the data location to run the query, BQ defaults to the US multi-region and uses resources in the US.
But then, The BQ Data Transfer Service throws an error since I are now trying to export the data from a query that was executed in US to a table that sits in EU.
So, to fix that, before you schedule the query, I have to go under the query detailed settings, and change the Data Location to EU
Then save these settings, and finish scheduling the query.
Before that, make sure you have enable the Billing
enter image description here
And then maybe because of BigQuery Data Transfer Service (trusted through the pop-up windows……)
bother me a lot……
If the pop-up window does not appear, you should check the address bar to make sure the window is not blocked, if it's not the cause,you can try to change the location of data(related to where you store your data),and submit.
enter image description here
I had the same problem and it turned out to be the pop-up blocker on my Firefox browser. The pop-up blocker on Chrome also stopped the scheduled query working but Chrome was a bit more visible that pop-ups were blocked.
On Firefox, click on the circled icon in the address bar to see blocked pop-ups
Change the pop-up permission to 'Allow'.
I had exactly this generic error message 'Scheduled query error', and it was driving me mad. I checked all permissions and locations etc.
I turns out that the 'Time Travel Window' was set to less than 48 hours for the dataset I was trying to write into. Which apparently BigQuery doesn't like.
To fix this I executed this query
ALTER SCHEMA `PROJECTNAME.DATASETNAME`
SET OPTIONS(
max_time_travel_hours = 72);

Access Denied: Project project_id: "erudite-buckeye-303218" gaia_id: 546380511156 : User does not have bigquery.jobs.create permission in project er

I am new to using BigQuery. I tried to select my trial project vertical-idea-303617 and run a query against it. But the browser keeps complaining about permissions related to erudite-buckeye-3032181. I don't know what that erudite-buckeye-3032181 project is and I do not have it selected. Why am I still getting errors? See this image here:
How do I run queries against my vertical-idea-303617.perftest.reportgraphs ?
I had a similar problem, not exactly the same, and to solve it I just had to click that Hide Preview Features button.
apparently Google released some new features that are all broken in the new Front-end, but not in the old

Error when creating scheduled query on Bigquery "Error creating scheduled query: er"

I just started a new project on Google Cloud, set up some bigquery datasets and tables. I now want to set up some scheduled queries. I have already enabled BigQuery Data Transfer API. My query is valid (it's just SELECT * FROM table). I can't find anything about this error online.
See screenshot
UPDATE: I've experimented a bit and it seems to be an organization wide issue. All projects, new and old within my organization get this same error when trying to schedule a query. I tried for a project in a different organization and did not have the issue. What could be causing this error for ALL projects in an organization?
UPDATE 2:
By querying a table that is not empty the error change to "Error creating scheduled query: Yn" instead of "Error creating scheduled query: er" (when the scheduled query would have queried an empty table).
I faced the same issue than you, and basically I just needed to run the query first before creating the the scheduled query... And that did the trick.
from the BQ FAQs :
"Scheduled queries use features of BigQuery Data Transfer Service. Verify that you have completed all actions required in Enabling BigQuery Data Transfer Service."
basically, what this means is that you need to enable the data transfer api in your project, AND give the user who creates the scheduled query a BQ admin role in order to have the right permissions to access that transfer service.
If done right, you should get a popup when creating the scheduled query to confirm that the data transfer service has access to your uses account (if you block popups you might not see this message and get stuck)
If this error only occurs in your organisation, I believe it might be caused by a organisation policy on Google Cloud. I would encourage you to double check if there is any org policy causing this error. If that's not the case, open a support ticket with GCP.
What worked for me was signing in through Incognito Mode with just my account and attempting to save the scheduled query. I have multiple Google Accounts signed it at one time and for whatever reason, BigQuery throws this generic error after authorization is successful and BigQuery is granted the access it requested.
You need to make sure that you are creating the query under the project targeted not in any other projects because it won't appear
Also you need to enable the API as one of the above answers
This eventually worked for me when i ran this in an cognito window

Can't find place to create a dataset with trial account

I'm using the $300 trial account to play with google bigquery. I am the project owner.
I want to save a view, which requires creating a dataset.
I found this link (https://cloud.google.com/bigquery/docs/datasets) which shows a "WEBUI" tab where you get access to do that, but I can't find the page/link that shows the "WEBUI" link when I am logged in.
I checked the permissions of my role, and it has the apparent permissions needed to be able to create a dataset.
thanks
The Web UI for Google BigQuery can be accessed via this URL: https://console.cloud.google.com/bigquery
Once you are in, make sure you have the correct project selected (using the dropdown menu at the top) before creating your datasets, tables, and views.
BigQuery has two WebUIs:
https://console.cloud.google.com
https://bigquery.cloud.google.com
you can create with both datasets.

MS Access Split Database - Run time error with backend in new drive location?

I have an MS Access split database and I'm trying to get it to work with the backend on a new, more secure drive on our network. I've used a UNC path for the backend location.
This database has been running without problem on another drive which is totally public to everyone in the company (~4k people, not secure) for about a year. We have a generic account for users to access the database throughout our factory and haven't encountered this problem before I tried to switch it to the new drive. I've contacted our IT department and they've given myself and all my user's accounts read/write access to the drive, but only I can run it.
Other user accounts get these problems...
All of my forms with objects bound to a table immediately throw a runtime error before even getting to Form_Load.
My userforms will run DLookup functions and execute message boxes but throw a runtime error when they go to execute a query.
I've tried using an 'On Error goto' to try and actually find the problem but it throws a runtime error before that.
I can't think at all what the problem might be. IT have told me I have the same permissions as the other users. Any suggestions on what to do?
In the front end of your DB you may have to change the path which links to the tables. The tables are in the back end of the database, which you have now moved and therefore changed the filepath. the frontend wont find them. You can delete the table links in the front end then use External data > import and Link > Access. In order to re-link the tables using their new filepath. You would then need to redistribute your frontend to the users.
I'm not sure if you have already done this, however, you haven't suggested so in your question. hope this helps, apologies if it was helpless.
I hope you have found an answer to this. I wanted to answer as well, because I had the exact same problem yesterday. It turned out that the location was referring other users back to the folder's shortcut name versus it's full length name (it is called the W drive on my computer and the K drive on theirs). I solved the issue by spelling out the name in full.