Closed Bug 668211 Opened 13 years ago Closed 13 years ago

[traceback] Some gallery images don't load

Categories

(support.mozilla.org :: Knowledge Base Software, task, P1)

Tracking

(Not tracked)

VERIFIED FIXED
2012-01-03

People

(Reporter: jsocol, Assigned: tgavankar)

References

()

Details

Seen this from at least three images in the gallery:

https://support.allizom.org/en-US/gallery/image/4864
https://support.allizom.org/en-US/gallery/image/1058
https://support.allizom.org/en-US/gallery/image/990

Definitely doesn't happen for all images:

https://support.allizom.org/en-US/gallery/image/5447

Here's the traceback:

Traceback (most recent call last):

  File "/data/www/support.allizom.org/kitsune/vendor/src/django/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/data/www/support.allizom.org/kitsune/apps/gallery/views.py", line 244, in media
    media, media_format = _get_media_info(media_id, media_type)

  File "/data/www/support.allizom.org/kitsune/apps/gallery/views.py", line 283, in _get_media_info
    media_format = imghdr.what(media.file.path)

  File "/usr/lib64/python2.6/imghdr.py", line 12, in what
    f = open(file, 'rb')

UnicodeEncodeError: 'ascii' codec can't encode characters in position 67-74: ordinal not in range(128)
This issue occurs only with migrated images where the filename contains outside of ascii ranged unicode characters. 

It does not apply to new images since we rename files on upload.
Assignee: nobody → tgavankar
Done in https://github.com/jsocol/kitsune/commit/d1ed65ca6.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Is there a way to force a test image through the migration process?
Not that I know of. I guess for verification just make sure that the images linked above don't cause a traceback.
By looking at the linked images above, traceback errors are triggered [same error as printed above], on support.allizom.org.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This seems to be a staging-only environment-based bug.

Opened bug 670758 to have IT look into it.
Target Milestone: 2011-07-12 → 2011-07-19
Is it fixed in SUMO 2011-07-19?
Now it seems to be on prod too - it definitely wasn't before.

However, we are sure it's an OS specific bug, and so it's in IT's realm rather than ours.
Target Milestone: 2011-07-19 → 2011Q3
Target Milestone: 2011Q3 → 2011Q4
Hm still seeing this on both production and staging - any updates?
I assume the bug this depends upon is the IT bug?
(In reply to Kadir Topal [:atopal] from comment #10)
> I assume the bug this depends upon is the IT bug?

We should probably retest that bug on -stage. We're also in the process (in bug 697561) of bringing all our web servers up to RHEL6. We know this is environmental and so it may go away with the OS upgrade.

If it doesn't, we will need ITs help, as before, to try to figure it out. In the past it occurred on *some* of our web servers, even though they should have been identical.
With bug 670758 being resolved, I'm marking this as also RESO FIXED. Note that there's no actual code committed, so verification steps are just to make sure the pages listed above don't cause tracebacks/500s.
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Target Milestone: 2011Q4 → 2012-01-10
If the fix is deployed already, we should probably put this in 01-03 instead of 01-10. #nit
Fair enough.
Target Milestone: 2012-01-10 → 2012-01-03
Verified all of the links above display gallery images correctly
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.