[traceback] Some gallery images don't load

VERIFIED FIXED in 2012-01-03

Status

support.mozilla.org
Knowledge Base Software
P1
normal
VERIFIED FIXED
7 years ago
7 years ago

People

(Reporter: jsocol, Assigned: tgavankar)

Tracking

unspecified
2012-01-03

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

7 years ago
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)
(Assignee)

Comment 1

7 years ago
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)

Updated

7 years ago
Assignee: nobody → tgavankar
(Assignee)

Comment 2

7 years ago
Done in https://github.com/jsocol/kitsune/commit/d1ed65ca6.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
Is there a way to force a test image through the migration process?
(Assignee)

Comment 4

7 years ago
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 → ---
(Assignee)

Comment 6

7 years ago
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

Comment 7

7 years ago
Is it fixed in SUMO 2011-07-19?
(Assignee)

Comment 8

7 years ago
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.
(Assignee)

Updated

7 years ago
Depends on: 670758
(Reporter)

Updated

7 years ago
Target Milestone: 2011-07-19 → 2011Q3
Target Milestone: 2011Q3 → 2011Q4
(Assignee)

Comment 9

7 years ago
Hm still seeing this on both production and staging - any updates?
I assume the bug this depends upon is the IT bug?
(Reporter)

Comment 11

7 years ago
(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.
(Assignee)

Comment 12

7 years ago
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
Last Resolved: 7 years ago7 years ago
Resolution: --- → FIXED
Target Milestone: 2011Q4 → 2012-01-10
(Reporter)

Comment 13

7 years ago
If the fix is deployed already, we should probably put this in 01-03 instead of 01-10. #nit
(Assignee)

Comment 14

7 years ago
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.