images.get_serving_url_async() raising transformation errors for valid files

126 views
Skip to first unread message

Rob Curtis

unread,
Apr 25, 2019, 7:18:13 AM4/25/19
to Google App Engine
Hi,

We have code in production that writes images to google cloud storage and gets a blob_key for each file that it writes, then calls images.get_serving_url_async() for each of the blob_keys
This code has been working in production for years, but today I started seeing many TransformationError being raised for files that are images. 
It's worth noting that it only seems to be a problem when I'm writing 25+ images to cloud storage.

Code is like this:
#data and filename specified earlier
with gcs.open(filename, 'w') as f:
f.write(data)

blobstore_filename = u"/gs" + filename
blob_key= blobstore.BlobKey(blobstore.create_gs_key(blobstore_filename))

image_url_futures.append(images.get_serving_url_async(blob_key, secure_url=True))

#this is outside of function which created the image_url_futures
image_blob_serving_urls = [future_url.get_result() for future_url in image_url_futures]

I looked at this question: 

  • I can rule out that file isn't an image.
  • I had assumed that "with gcs.open(...) would be synchronous, so I assume the file has been written. 

If I'm missing something or if you're experiencing the same issue, please let me know.
Thanks
Rob

Rob Curtis

unread,
Apr 25, 2019, 8:21:52 AM4/25/19
to Google App Engine
And like magic, 2 hours later, the tasks stopped failing and then completed.
Is there anything I should be doing to make this code more robust against this kind of issue?


Thanks
Rob

diogoa...@google.com

unread,
Apr 25, 2019, 10:35:06 PM4/25/19
to Google App Engine
The error “TransformationError” indicates that an error occurred during image manipulation. You could implement a retry mechanism in case you get this exception.

Note that this type of issue is better suited if posted on StackOverflow, where the community will be able to help you, like the suggestions in this post.

Rob Curtis

unread,
Apr 26, 2019, 6:01:11 AM4/26/19
to Google App Engine
Thanks. 

My reason for posting here, and not on SO,  was I wanted to understand whether others were seeing elevated error rates with "get_serving_url"... Because there was 0 change to my code and then that stopped working for 2 hours when there were multiple consecutive calls.
Thanks

diogoa...@google.com

unread,
Apr 26, 2019, 9:45:42 PM4/26/19
to Google App Engine

As you have not done code changes, if you experience this issue again, please report the issue on the Issue Tracker or open a case on the Cloud Console Support Center page (or here for free tier) so that the support team can take a look at your project.


Rob Curtis

unread,
Apr 26, 2019, 10:20:56 PM4/26/19
to google-a...@googlegroups.com
Thanks, will do. 

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/F3fOkX9W5ZU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9a083f54-e196-45b3-8fda-261fd4d66045%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages