I am getting sporadic IntegrityError
when running get_thumbnail.
I have two API calls: /listing/create
which creates a listing, and /listing/mystuff
which retrieves details of all your listings. mystuff
is run immediately after create
completes, and mystuff
is the one that fails on this error. However, if the mobile app is coded to delay for 2 seconds before running mystuff
you don't get the error.
In general, then, this seems to happen when you run get_thumbnail soon after the original image has been uploaded.
Full traceback is here: https://github.com/sorl/sorl-thumbnail/issues/162
There is a suggestion here and here to add a hack to try/except on IntegrityError, and to delay a few seconds and retry the operation. I have tried delaying a long time (10s) and this doesn't work for me.
Based on the SO question here I'm wondering if there is a "first access" problem?
This has now been fixed on the master sorl-thumbanil branch. See the discussion:
https://github.com/mariocesar/sorl-thumbnail/issues/162
...and the merged pull request: