python-gcs-image icon indicating copy to clipboard operation
python-gcs-image copied to clipboard

There was a problem transforming the image.

Open dfrankes opened this issue 6 years ago • 11 comments

We are unable to use the image, after setting all the permissions (created a new bucket for it) and uploading an test image to the bucket and then accesing the url https://our-app.appspot.com/image-url?bucket=resize-bucket&image=test_image.jpg it will just say the following

There was a problem transforming the image. Ensure the GAE service account has access to the object in Google Cloud Storage.

And when i remove the permissions from the bucket it will throw a different error

Ensure the GAE service account has access to the object in Google Cloud Storage.

dfrankes avatar Aug 15 '19 08:08 dfrankes

Usually it's caused by wrong permissions configured.

albertcht avatar Aug 25 '19 16:08 albertcht

any luck on this? I am getting the same error and have tried a few workarounds. Here are a couple obvious things I've tried, but no luck. In your example, I notice you import from google.appengine.ext import blobstore but just confirming that is unnecessary since we are using the GCS file path - correct?

  1. Giving <google-project-id>@appspot.gserviceaccount.com Storage Object Admin privileges on the bucket.
  2. Temporarily removed permissions just to see if it would work

One thing I noticed when looking at what was deployed on app-engine is that it doesn't look like the google.appengine dependencies are installed, unless I'm missing something.

Screen Shot 2019-09-08 at 7 58 03 PM

remotevision avatar Sep 08 '19 22:09 remotevision

Hi @dfrankes ,

I notice you import from google.appengine.ext import blobstore but just confirming that is unnecessary since we are using the GCS file path - correct?

Yes.

One thing I noticed when looking at what was deployed on app-engine is that it doesn't look like the google.appengine dependencies are installed, unless I'm missing something.

google.appengine is provided in standard environment for Python on GAE.

albertcht avatar Sep 15 '19 16:09 albertcht

I am also having this problem. My default app engine service account definitely has the right permissions.

asktree avatar Sep 24 '19 18:09 asktree

@dfrankes @remotevision The problem for me seems to be that get_serving_url will not work using buckets that have Bucket Policy Only. You must use a bucket with Object-Level permissions. There is nothing the author of this repo can do to fix this as far as I'm aware.

Found here: https://stackoverflow.com/questions/14075832/transformationerror-on-blob-via-get-serving-url-app-engine

Seems to be working for me now that I have switched buckets.

asktree avatar Sep 24 '19 19:09 asktree

@asktree wow, I would not have thought this. I'll give it a shot. Thanks!

EDIT: That worked!

remotevision avatar Sep 24 '19 20:09 remotevision

@asktree Thanks, ill try that a little bit later today.

dfrankes avatar Oct 03 '19 09:10 dfrankes

I granted the Storage Object Admin role and many other possible roles to my App Engine default service account but, still getting the error. Not working for me.

birhanuh avatar Mar 12 '21 20:03 birhanuh

I granted the Storage Object Admin role and many other possible roles to my App Engine default service account but, still getting the error. Not working for me.

We created our own resizer using https://kraken.io instead, working flawlessly without any problems for the last 12 months. we could not get this repo to work properly

dfrankes avatar Mar 15 '21 11:03 dfrankes

Thinking to solve with S3 and lamda re-sizer function. Or add middle-man imgix. But, thanks will check kraken too!

birhanuh avatar Mar 15 '21 14:03 birhanuh

@dfrankes @remotevision The problem for me seems to be that get_serving_url will not work using buckets that have Bucket Policy Only. You must use a bucket with Object-Level permissions. There is nothing the author of this repo can do to fix this as far as I'm aware.

Found here: https://stackoverflow.com/questions/14075832/transformationerror-on-blob-via-get-serving-url-app-engine

Seems to be working for me now that I have switched buckets.

This was exactly the solution.

Leonardo-Henrique avatar May 11 '22 22:05 Leonardo-Henrique