google-app-engine


Unable to get serving url from GCS in another project


I'm trying to use GAE image service, but I have encountered a problem.
I have two projects. Project A has GAE, and Project B has GCS bucket.
This is because the GAE region can not be changed once the project is created.
When get_serving_url is called from the GAE to the object of the GCS bucket, the following exception occurs.
Traceback (most recent call last):
...
File "/base/data/home/apps/b~[PROJECT_NAME]/20161215t131056.397760967541775314/main.py", line 125, in _get_serving_url
return get_serving_url(blob_key)
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/images/__init__.py", line 1868, in get_serving_url
return rpc.get_result()
File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 613, 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 1972, in get_serving_url_hook
raise _ToImagesError(e, readable_blob_key)
TransformationError
When putting them in the same project this exception will not be thrown.
GAE's service account and project A have full access to buckets and objects.
Is there anything else I need to try?
Self-solving
I founds cause in the docs of Image API in GAE/Java.
Important: If you serve images from Google Cloud Storage, you cannot serve an image from two separate apps. Only the first app that calls getServingUrl on the image can get the URL to serve it because that app has obtained ownership of the image. Any other app that subsequently calls getServingUrl on the image will therefore be unsuccessful. If a second app needs to serve the image, the app needs to first copy the image and then invoke getServingUrl on the copy.
I used objects of the bucket from another project simultaneously.
Consequently, I have verified get_serving_url correctly.
You do not have to use a serving url. You can serve files grom GCS:
https://storage.googleapis.com/your_bucket/your_filename
or SDK http://localhost:8080/_ah/gcs/your_bucket/your_filename

Related Links

Sending email from dev server with --smtp_host=smtp.gmail.com
Google App Engine logout url
django-nonrel google app engine order_by('?')
Trouble while sending Email using Google App Engine to Verizon (vtext.com)
Keeping track of time with 1 second accuracy in Google App Engine
Developing for Google App Engine and using the datastore
GAE Datastore: “total” property vs. adding up line items?
Business intelligence on Google App Engine
Why GAE ChannelAPI Socket.open() fails?
Modifying GAE Django to Expand the API Scope on User Login
GWT: Where (how) to define POJOs to make em available for client and server? (and to use datastore on serverside)
Google App Engine Always On feature
Google App Engine: How to create sub domain/ sub directory
Securing Google App Engine Authsub callback url ('next_url')
Browser-based strategy game in Django/GAE. Model suggestions?
Setting GTalk status using Java - GAE/J

Categories

HOME
uml
phpword
microsoftgraph
github-for-windows
ns-3
youtube-data-api-v3
rds
3d-reconstruction
nested-if
missing-data
azure-container-service
recordrtc
drop-down-menu
mautic
mxgraph
jxl
ipmitool
filechannel
shared-libraries
android-intent
heat
video-editing
bourbon
charles
cgbitmapcontext
libigl
ember-cli
flask-sqlalchemy
expressionengine3
itunes
slidetoggle
interbase
jquery-multiselect
datastax-enterprise-graph
realm-mobile-platform
livelink
gojs
hunspell
nested-lists
reverse
openalpr
node-mssql
verifiable-c
chef-solo
numberpicker
apriori
preloader
subclipse
clang++
pom.xml
httrack
vugen
bluez
flyout
branch-prediction
visual-studio-2008-sp1
qtplugin
segment-io
resourcemanager
android-dateutils
swizzling
kiosk
user-management
ascii-art
state-restoration
dynamics-nav-2016
sciruby
rate-limiting
video-player
ocra
liquid-layout
avahi
telepat
ms-access-2000
entity-framework-4.3
filesplitting
lambda-architecture
cuba
grails-domain-class
paste
sphinxql
scringo
mysql-error-2013
device-width
panda3d
fragmenttransaction
wcf-configuration
extconf.rb
entity-attribute-value
jquery-tools
catransform3d
pylucene
mbeans
collectionviewsource
mtu
qglwidget
presentation-layer
ruby-1.8
squishit
globals
eclipse-marketplace
tabpanel
technical-debt

Resources

Encrypt Message