1

Im running a local dev server and using image.ServingURL to create a url from a BlobKey that is stored in Google Storage. Should this url return the image on a dev server?

I'm getting an error like such: Could not find blob with key encoded_gs_file:<long_blob_key>

Im using blobstore.BlobKeyForFile(c, storageKey) where storageKey is "/gs/" + <id property of response from uploading to Cloud Storage>

Not sure if this is supposed to serve images with the serving url on dev? How to best diagnose?

wprater
  • 1,022
  • 11
  • 21
  • I'm not sure what you are trying to accomplish. Why are you storing a GS id into the BlobStore? That doesn't make much sense to me. – rdodev Mar 14 '14 at 01:38
  • @rdodev the image.ServingURL needs a BlobKey, which one can get from a file in the GCS with `blobstore.BlobKeyForFile`, however, they are not being served. – wprater Mar 14 '14 at 17:36
  • my question is more like: why use blobstore at all? just push and serve objects directly from GCS, no? – rdodev Mar 14 '14 at 17:40
  • @rdodev because I want a permanent image url form the Image Service https://developers.google.com/appengine/docs/go/images/reference#ServingURL which allows me to crop, resize, and cache images. – wprater Mar 14 '14 at 18:06

1 Answers1

0

I have answered my own question about this subject. It contains the Python code for reading and writing files (blobs) using Google Cloud storage and creating serving urls.

This codes works for images and other files like js, css and pdf's. in both the SDK and GAE production.

The code is here: How to serve cloudstorage files using app engine SDK

Community
  • 1
  • 1
voscausa
  • 11,253
  • 2
  • 39
  • 67
  • Hmm. the `http://localhost:8080/_ah/gcs/app_default_bucket` url does not seem to be serving files for me. – wprater Mar 14 '14 at 18:04
  • Do you use GO? In Python we have a Cloud Storage Client, which is part of the SDK. – voscausa Mar 14 '14 at 18:38
  • yes, Im using go. There is an SDK, which provides these methods. However, they the URLs that are created don't seem to be working.. not sure if this is a local dev server limitation or something else entirely. – wprater Mar 14 '14 at 18:57
  • it seems that GO on GAE is a joke really. Even $PHP is more stable than GO. WTF – hey Aug 10 '14 at 00:41