2
votes

I am trying this example from Google, showing "how you can use the Google APIs Client Library for Java to send requests to the Google Cloud Storage JSON API", which lists the content of one bucket. The only difference is that I am using Eclipse (with Maven) on Linux instead of Maven directly. I keep getting the following error message, generated by the line Bucket bucket = getBucket.execute();:

403 Forbidden { "code" : 403, "errors" : [ { "domain" : "global", "message" : "Insufficient Permission", "reason" : "insufficientPermissions" } ], "message" : "Insufficient Permission" }

However, I have read/write access to the project, I am able to inspect the buckets through the developers console and I have been able to access BigQuery through the Java API (although I'm also running into some strange behaviour there, I can detail if necessary). My ultimate goal is to write a script that loads new Datastore backups into BigQuery every day.

Can anyone confirm that the example from Google is working for them?

EDIT: I should add that I have no trouble using the 'APIs exporer' here.

1
Do you have billing setup on your account?Patrice
The project has billing set up, yes. (That's sufficient, right? There isn't an additional something that needs to be set up per user, is there?)oulenz
no there shouldn't be more to do. One thing though that could be happening here, is that maybe you don't have access to write in the bucket? the API you link to will give you a list of your buckets, which just requires read accessPatrice

1 Answers

1
votes

We finally managed to solve the problem, by doing two things: physically deleting the access token (letting it be recreated by the code) and 'cleaning' the project in Eclipse. Not sure which of the two was more important. The first step alone was not enough, but it did have an effect: now I was being asked to grant permission in the browser over and over again, something that wouldn't happen before.

My only explanation is that the access token contained outdated information that led to the failure of the authentication, but I'm not sure whether that's possible. (If so, it sounds like a bug.)