Closed ghost closed 7 years ago
Given the stack trace, I'd say this is more of a thumbor core issue, given you're only using the result storage and if I recall correctly, the processing of the image is performed before storing it into the result storage. Might be worth creating an issue on thumbor's repo.
I'll submit a ticket with the core project then, and close this. Thank you.
P.S. Just poking around the error / thumbor code and I am somewhat confused as to why they would ever try to determine the "engine" for the target format if the result can be fetched from storage. I would think you'd just want to..
if response=get_from_resultstore(url)
return response
else
get_engine(url)
....
end
Like, right at the very beginning of the request to avoid unnecessary processing overhead. But then I find myself wondering what is the point of "results storage" in comparison to say a local varnish/nginx? The advantage for me in this case is that nginx and varnish depend on finite resources (disk or memory) ... both of which are in short supply on a container setup. Sure I could add shared disk or whatever but on elastic beanstalk but then you have to switch to their more complex multi image docker thingy. So the appeal of S3 results storage was pretty high.
I only bring that up here because you have obviously worked with result storages before. Curious if you have thoughts. Thanks again.
If I recall correctly, thumbor will firstly check if the image is in the result storage, before fetching it from the storage (if it is enabled and in it), and eventually load it from the source. Then it stores the source in the storage, processes it, store the result in the result storage and return the image (those processes are parallelized).
Regarding the usage of the result storage, s3 is indeed a good solution as you can store an unlimited amount of data. If you want to achieve performance, you will indeed need a varnish / nginx / CDN in front of thumbor, so the data is returned faster (and it avoids using resources on your thumbor instance). You should also handle If-Modified-Since header, which is fully compatible with aws result storage.
Fixed in thumbor version 6.2.1 for any googlers.
Not entirely sure if this is Thumbor core or AWS plugins domain but Thumbor fails to load GIFv results from S3. The first request works perfectly and regular images like jpegs work as expected.
An example request:
curl -I "http://localhost:8000/unsafe/filters:gifv(mp4)/https://somedomain.com/big.gif"
First response:
All subsequent responses:
Example config here:
I'm using the APSL docker image which you can easily run with:
docker run -p 8000:8000 --env-file .env "apsl/thumbor"
^ You just need to create a .env file, adding valid credentials for an S3 bucket. Unsafe is optional.
Note that the transformed result (an mp4) is in fact sitting in S3, it did store correctly. It just fails to recognize the format upon retrieval.