Closed Bug 922224 Opened 11 years ago Closed 11 years ago

[prod] user's profile is throwing a 500 error - IOError: image file is truncated (7 bytes not processed)

Categories

(Participation Infrastructure :: Phonebook, defect)

defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: mbrandt, Unassigned)

References

()

Details

(Whiteboard: [regression][fromAutomation])

Attachments

(1 file)

Steps to reproduce:
0. goto https://mozillians.org/en-US/u/Jan/

Traceback (most recent call last):

  File "/data/www/mozillians.org/mozillians/vendor/lib/python/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/hooks/framework_django.py", line 475, in wrapper
    return wrapped(*args, **kwargs)

  File "/data/www/mozillians.org/mozillians/vendor/lib/python/django/views/decorators/cache.py", line 89, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)

  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/views.py", line 126, in view_profile
    return render(request, 'phonebook/profile.html', data)

  File "/data/www/mozillians.org/mozillians/vendor/lib/python/django/shortcuts/__init__.py", line 44, in render
    return HttpResponse(loader.render_to_string(*args, **kwargs),

  File "/data/www/mozillians.org/mozillians/vendor/lib/python/django/template/loader.py", line 176, in render_to_string
    return t.render(context_instance)

  File "/data/www/mozillians.org/mozillians/vendor/src/jingo/jingo/__init__.py", line 189, in render
    return super(Template, self).render(context_dict)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/object_wrapper.py", line 220, in __call__
    self._nr_instance, args, kwargs)

  File "/usr/lib64/python2.6/site-packages/newrelic-1.10.2.38/newrelic/api/function_trace.py", line 82, in dynamic_wrapper
    return wrapped(*args, **kwargs)

  File "/usr/lib64/python2.6/site-packages/jinja2/environment.py", line 891, in render
    return self.environment.handle_exception(exc_info, True)

  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/templates/phonebook/profile.html", line 1, in top-level template code
    {% extends "base.html" %}

  File "/data/www/mozillians.org/mozillians/templates/base.html", line 156, in top-level template code
    {% block content_wrapper %}

  File "/data/www/mozillians.org/mozillians/templates/base.html", line 159, in block "content_wrapper"
    {% block content %}{% endblock %}

  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/templates/phonebook/profile.html", line 86, in block "content"
    <img src="{{ profile.get_photo_url('150x150') }}" alt="{{ shown_user.username }}" class="photo">

  File "/data/www/mozillians.org/mozillians/mozillians/users/models.py", line 393, in get_photo_url
    return self.get_photo_thumbnail(geometry, **kwargs).url

  File "/data/www/mozillians.org/mozillians/mozillians/users/models.py", line 380, in get_photo_thumbnail
    return get_thumbnail(self.photo, geometry, **kwargs)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/shortcuts.py", line 8, in get_thumbnail
    return default.backend.get_thumbnail(file_, geometry_string, **options)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/base.py", line 61, in get_thumbnail
    thumbnail)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/base.py", line 86, in _create_thumbnail
    image = default.engine.create(source_image, geometry, options)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/engines/base.py", line 16, in create
    image = self.colorspace(image, geometry, options)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/engines/base.py", line 34, in colorspace
    return self._colorspace(image, colorspace)

  File "/data/www/mozillians.org/mozillians/vendor-local/lib/python/sorl/thumbnail/engines/pil_engine.py", line 56, in _colorspace
    return image.convert('RGB')

  File "/usr/lib64/python2.6/site-packages/PIL/Image.py", line 679, in convert
    self.load()

  File "/usr/lib64/python2.6/site-packages/PIL/ImageFile.py", line 201, in load
    raise IOError("image file is truncated (%d bytes not processed)" % len(b))

IOError: image file is truncated (7 bytes not processed)
Added the broken photo as an attachment (as requested).
Thank you Jan - note from QA, I can reproduce this behavior on stage using attachment 812175 [details] from comment 1.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Bumping to verified on prod. Thanks again Jan for helping us find and fix a problem/regression. I upload the image (attachment 812175 [details]) to my profile on stage and prod and this looks fixed.
Status: RESOLVED → VERIFIED
Summary: [prod] user's profile is through a 500 error - IOError: image file is truncated (7 bytes not processed) → [prod] user's profile is throwing a 500 error - IOError: image file is truncated (7 bytes not processed)
Whiteboard: [regression][fromAutomation]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: