Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Use GCS (Google cloudstoarge) to replace the app engine blobstore. You can use the Blobstore service to access GCS.

Great example.
But when i try to run my project i get an exception inside in this line

dyn.serving_url = images.get_serving_url(
blobstore.create_gs_key('/gs' + gcs_file_name), secure_url=True)

I have tried to fix this but it doesn't work. What might be the issue here ??

---- this is the error message ---
The server has either erred or is incapable of performing the requested operation.

Traceback (most recent call last):
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1535, in call
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1529, in call
rv = self.router.dispatch(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 1102, in call
return handler.dispatch()
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 572, in dispatch
return self.handle_exception(e,
File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/", line 570, in dispatch
return method(_args, *_kwargs)
File "/base/data/home/apps/skunajamapp/1.374701545509525083/", line 77, in post
serving_url = gcs_serving_url( entity )
File "/base/data/home/apps/s
kunajamapp/1.374701545509525083/", line 38, in gcs_serving_url
gcs_dyn.serving_url = images.get_serving_url( blobstore.create_gs_key( '/gs'+gcs_file_name ), secure_url = True )
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/images/", line 1793, in get_serving_url
return rpc.get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/", line 612, in get_result
return self.get_result_hook(self)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/images/__init
.py", line 1891, in get_serving_url_hook
raise _ToImagesError(e, readable_blob_key)


voscausa commented Apr 20, 2014

Are you sure the image is in the bucket?

rlarge commented Sep 4, 2014

i got a question, i'm using flow.js and ng-flow for angluar js and running into the same file name problem... have you ran into that and if how did you deal with it...


voscausa commented Oct 17, 2014

I have revised the code. The updated version can be found here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment