Our production app (python 2.7 standard environment) running on Google App Engine suddenly lost permissions to write (create objects) on Google Cloud Storage, without any change in the code on our side.
The code is able to create new buckets, but not new objects within them.
It seems that the default app engine service account is not granted the permission. Needless to say, the service account has the Storage Object Creator role, as well as the Editor role on the project level.
Strangely, the exact same code running on the test environment project, continues to work perfectly. We are using the api client library to obtain credentials, like so:
from oauth2client.appengine import AppAssertionCredentials
from apiclient.discovery import build as discovery_build
credentials = AppAssertionCredentials(scope=scope)
http = credentials.authorize(httplib2.Http())
service = discovery_build('storage', 'v1', http=http)
And then using the service to make the api call. All calls to create objects are suddenly failing with the message: "Anonymous caller does not have storage.objects.create access to /"
Any ideas what could suddenly have gone wrong ??
Anonymous callermeans no HTTP Authorization header. To me, this indicates a bug in your code. The Google client libraries automatically renew expired tokens. I have not usedAppAssertionCredentials. Is there a reason to use this class instead of ADC (Application Default Credentials) style classes? The issue about being able to create buckets but not create objects might indicate you are using different credentials in those API calls. - John Hanley