-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bigquery: storage API fails silently when user does not have correct privileges #9102
Comments
The Reviewing the storage acceleration implementation, it looks like we're not exposing trace spans sufficiently there, so that's another mechanism by which we could provide more insight, such as attaching the session error to the span info. |
@shollyman |
Thanks @alvarowolfx, I was running a version without the fix, thanks for the quick answer! |
I think I encountered the same issue. Context
SnippetgcsClient, err := storage.NewClient(ctx)
if err != nil {
return nil, err
}
bucket := gcsClient.Bucket(bucketName)
_, err = bucket.Attrs(ctx)
if err != nil {
return nil, fmt.Errorf("failed to get bucket attributes: %v", err)
}
file, err := fs.Open(filename)
if err!=nil {
panic(err)
}
blob := bucket.Object(FILENAME).NewWriter(ctx)
defer blob.Close()
writer := blob.NewWriter(ctx)
_, err = io.Copy(writer, file)
if err!=nil {
panic(err)
} (The same happens if I'm using an encoding/csv Writer and write row by row) ExpectedThe writing fails if permissions are missing ObservedNo error is raised, but writing fails silently if the caller has insufficient permissions (in my case, |
Following up here. I'm going to close this out as we're surfacing information about the bigquerystorage API acceleration via the row iterator property, and there's not a better way to surface the error directly in the call chain. Regarding the GCS report, that's actually related to a different package (Cloud Storage vs BigQuery Storage) though the silent failure is concerning. If it's still occurring, could you please open a new issue? |
Hi, |
No problem thanks for looking at this! I can always do a small |
Client
cloud.google.com/go/bigquery v1.57.1
Environment
Mac OS
Go Environment
Code
Expected behavior
client.EnableStorageReadClient
should return an error if the storage API cannot be used. For example, if the user does not have thebigquery.readsessions.create
permission. I only got an error when I tried to use the storage API directly, which hinted my user didn't have the right privileges.Actual behavior
It does not fail, but instead falls back to the very slow REST API. I used 2 service accounts, one without
bigquery.readsessions.create
and one withbigquery.readsessions.create
.The text was updated successfully, but these errors were encountered: