3
votes

I have a script that uploads a photo to google compute engine to be processed, saves it in google cloud storage, and then responds with the path which i send to an app engine app to be read... testing with the gsutil cp command shows that the picture is saved correctly to GCS as the cp command always finds it.

However a lot of times app engine has problems find the photo when I send the path, returning a:

NotFoundError: Expect status [200] from Google Storage. But got status 404

Any thoughts?

1
A lot of times? Language? Did you set RetryParams?voscausa
only exceptions to retry again, how do you set retry Params, I'm not using the json api but the google storage library, this is what the code looks like: gcs_file = gcs.open(str(ss.h_photo)) x = gcs_file.read() gcs_file.close()user1368891
By the way. I do not fully understand your code. The str() and what about the bucket. Here is mine if you use Python and App Engine: gist.github.com/voscausa/9541133voscausa
Awesome thank you that solved it, the str was just to ensure that I'm passing the path as a string... and yet it does contain the bucket.user1368891

1 Answers

1
votes

Thanks to Voscausa, you can simply solve the issue by utilizing adequate parameters:

https://developers.google.com/appengine/docs/python/googlecloudstorageclient/retryparams_class