Fix profile photo upload (#2242)#2280
Merged
jlchilders11 merged 5 commits intodevelopfrom Apr 22, 2026
Merged
Conversation
herzog0
approved these changes
Apr 8, 2026
herzog0
reviewed
Apr 8, 2026
Collaborator
herzog0
left a comment
There was a problem hiding this comment.
Just something I found after the previous approval
Comment on lines
58
to
60
| {% if entry.author.profile_image %} | ||
| <span class="inline-block h-[30px] w-[30px] overflow-hidden rounded border border-gray-400 dark:border-gray-500"> | ||
| <img src="{{ entry.author.image_thumbnail.url }}" alt="{{ entry.author.display_name }}" class="h-full w-full object-cover"> |
Collaborator
There was a problem hiding this comment.
@gregjkal since you're already looking at this, can we just double check if this snippet is correct?
The if checks for entry.author.profile_image (or just image before), but the code below actually uses entry.author.image_thumbnail.url.
Collaborator
Author
There was a problem hiding this comment.
Good catch! This was pre-existing, but you're right that it's wrong. Changed to use get_thumbnail_url instead, which handles errors gracefully.
jlchilders11
approved these changes
Apr 8, 2026
Collaborator
jlchilders11
left a comment
There was a problem hiding this comment.
Looks good to me. I am still curious as to how we were getting profile image uploads until the end of last year though.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

It appears that boto3's s3transfer library uses threads by default for uploads, which deadlock under gevent's monkey-patched threading. The gunicorn arbiter kills the hung worker after 30 seconds, surfacing as "upstream request timeout." This may have been an issue since the project started using S3 storage alongside gunicorn's gevent workers.
Reproduced locally by switching from
runserverto gunicorn with gevent, confirmed the fix by settingAWS_S3_USE_THREADS = False.AWS_S3_USE_THREADS = Falsein settings, disabling boto3's threaded transfers that deadlock under geventisinstance(data, UploadedFile)to detect new uploads instead of the unreliable!=comparison betweenFieldFileandInMemoryUploadedFilestorage.delete()instead ofFieldFile.delete(), which closes the pending upload's file handleuser.image->user.profile_imagein 5 templates (missed during field rename in e0fe6d6)get_thumbnail_urlin news detail template instead of accessingimage_thumbnail.urldirectlyget_thumbnail_urlandget_hq_image_urlfor S3 storage errorsdelete_accountto properly invalidate cached thumbnailsSteps to reproduce the error locally
docker/compose-start.sh:AWS_S3_USE_THREADS = Falseinconfig/settings.py(the fix)just down && just up/users/me/. It should hang for ~30 seconds then error (locally I saw "Internal Server Error", not "upstream request timeout").