albertcht / python-gcs-image

MIT License
69 stars 28 forks source link

There was a problem transforming the image. #2

Open dfrankes opened 5 years ago

dfrankes commented 5 years ago

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.

albertcht commented 5 years ago

Usually it's caused by wrong permissions configured.

remotevision commented 5 years ago

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
albertcht commented 5 years ago

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.

asktree commented 5 years ago

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

asktree commented 5 years ago

@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.

remotevision commented 5 years ago

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

EDIT: That worked!

dfrankes commented 5 years ago

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

birhanuh commented 3 years ago

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.

dfrankes commented 3 years ago

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

birhanuh commented 3 years ago

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

Leonardo-Henrique commented 2 years ago

@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.