Skip to content

read/write Google Cloud Storage from local Google App Engine  #3709

Description

@zdenulo

short question: Is uploading/downloading to Google Cloud Storage from local Google App Engine working?

long question:
I get this error:

Traceback (mostrecentcalllast):
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line1535, in__call__rv=self.handle_exception(request, response, e)
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line1529, in__call__rv=self.router.dispatch(request, response)
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line1278, indefault_dispatcherreturnroute.handler_adapter(request, response)
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line1102, in__call__returnhandler.dispatch()
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line572, indispatchreturnself.handle_exception(e, self.app.debug)
File"/home/username/bin/google-cloud-sdk/platform/google_appengine/lib/webapp2-2.5.2/webapp2.py", line570, indispatchreturnmethod(*args, **kwargs)
File"/home/username/dev/myproject/main.py", line89, ingetb.upload_from_string('tesssssss')
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/cloud/storage/blob.py", line967, inupload_from_stringcontent_type=content_type, client=client)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/cloud/storage/blob.py", line891, inupload_from_fileclient, file_obj, content_type, size, num_retries)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/cloud/storage/blob.py", line818, in_do_uploadclient, stream, content_type, size, num_retries)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/cloud/storage/blob.py", line768, in_do_resumable_uploadclient, stream, content_type, size, num_retries)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/cloud/storage/blob.py", line727, in_initiate_resumable_uploadtotal_bytes=size, stream_final=False)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/resumable_media/requests/upload.py", line326, ininitiateretry_strategy=self._retry_strategy)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/resumable_media/requests/_helpers.py", line98, inhttp_requestfunc, RequestsMixin._get_status_code, retry_strategy)
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/resumable_media/_helpers.py", line146, inwait_and_retryresponse=func()
File"/home/username/.virtualenvs/fishlead/lib/python2.7/site-packages/google/auth/transport/requests.py", line179, inrequestmethod, url, data=data, headers=request_headers, **kwargs)
File"/home/username/dev/myproject/lib/requests/sessions.py", line502, inrequestresp=self.send(prep, **send_kwargs)
File"/home/username/dev/myproject/lib/requests/sessions.py", line612, insendr=adapter.send(request, **kwargs)
File"/home/username/dev/myproject/lib/requests/adapters.py", line490, insendraiseConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))

everything works ok when I deploy.
I tried different combinations of authentications based on https://google-cloud-python.readthedocs.io/en/latest/core/auth.html

Strange thing though is that I can for example list buckets in the project locally which means that I have (some) permissions/access. Service account which I am using has admin rights both for project and bucket.

I'm using Python 2.7.13
google-gcloud 0.26.1

here is repository with code which can be used for testing https://github.com/zdenulo/gcs_local_gae_error

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions