-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loris failing with no error when width is set to 500, but not at 499 or 501 or any other dimension #475
Comments
@jeffreycwitt is there anything in the log? What's the HTTP status code on the failing response? |
HTTP status code seems to be 500. I’ve just tried in a local instance, using Lombard_Manuscript-197.jpg at full size as the original image; it works fine for me. If I truncate the cache entry (e.g. |
Alex,
I was thinking it had something to do with cache, as if the cache got
corrupted, and the request is never fully re-processing the image because
it is going directly to the corrupted cache.
Is there an actual folder on the file system that contains the cached
images? Could I shell into the server, navigate to the cache folder and
delete the cached 500 width version of the image?
If so, where is the cache folder on the file system?
Best,
jw
…On Wed, Sep 11, 2019 at 6:56 PM Alex Chan ***@***.***> wrote:
HTTP status code seems to be 500.
I’ve just tried in a local instance, using Lombard_Manuscript-197.jpg at
full size as the original image; it works fine for me.
If I truncate the cache entry (e.g. echo '' > /cache/entry/default.jpg),
I get a 500 error – I wonder if a cache has been corrupted somewhere, and
Loris isn't handling that correctly?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#475?email_source=notifications&email_token=AAIX6PLLEMFWIE4J7CBCQYTQJFZTNA5CNFSM4IVUXQN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6QEMJY#issuecomment-530597415>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAIX6POXPGVHYNASXPZY6NTQJFZTNANCNFSM4IVUXQNQ>
.
--
Dr. Jeffrey C. Witt
Philosophy Department
Loyola University Maryland
4501 N. Charles St.
Baltimore, MD 21210
www.jeffreycwitt.com
|
@jeffreycwitt I believe it’s whatever path you have set in
the cache directory would be I don't know how to find this specific image in the cache off the top of my head; I'm about to get on a train so can't test right now! |
I’m on holiday next week so I can’t work on this then, but here are my ideas: We add a method to ImageCache that deletes a cache entry. If we process a request and get a "not an image" error thrown from the cache, we delete the cache entry and throw the 500 error. When the user reloads, the cache gets repopulated and they get the image they want. We could also retry the request (using something like https://pypi.org/project/tenacity/), but we want to be careful not to get stuck in an infinite retrying loop, e.g. if the source file is garbage. |
FWIW, I once toyed with the idea of implementing a PURGE http method that you could send to the base URI to clear the cache RESTfully. Obviously it's completely non-standard, but some of the reverse proxy caches out there support something similar, I believe.
Sent via mobile. Please excuse typos and brevity.
…________________________________
From: Alex Chan <[email protected]>
Sent: Saturday, September 21, 2019 6:34:27 PM
To: loris-imageserver/loris <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [loris-imageserver/loris] Loris failing with no error when width is set to 500, but not at 499 or 501 or any other dimension (#475)
I’m on holiday next week so I can’t work on this then, but here are my ideas:
We add a method to ImageCache that deletes a cache entry. If we process a request and get a "not an image" error thrown from the cache, we delete the cache entry and throw the 500 error. When the user reloads, the cache gets repopulated and they get the image they want.
We could also retry the request (using something like https://pypi.org/project/tenacity/), but we want to be careful not to get stuck in an infinite retrying loop, e.g. if the source file is garbage.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#475?email_source=notifications&email_token=AAHUCFNLREK35WWLZZ4V5OTQK2OPHA5CNFSM4IVUXQN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7I2YUY#issuecomment-533834835>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAHUCFOLQCWXK7UJGODEKLLQK2OPHANCNFSM4IVUXQNQ>.
|
@alexwlchan that sounds great to automatically purge an image from the cache if we know it's corrupt. |
Can someone help me with this weird problem.
Loris failing with no error when width is set to 500, but not at 499 or 501 or any other dimension
So for example:
This does NOT work: https://loris2.scta.info/hopkinsMSB19/Lombard_Manuscript-197.jpg/full/500,/0/default.jpg. Loris returns a blank page, without an error
Works: https://loris2.scta.info/hopkinsMSB19/Lombard_Manuscript-197.jpg/full/501,/0/default.jpg
Works: https://loris2.scta.info/hopkinsMSB19/Lombard_Manuscript-197.jpg/full/499,/0/default.jpg
Any advice is much appreciated.
The text was updated successfully, but these errors were encountered: