Page MenuHomePhabricator

Some JPGs are being served as text
Closed, ResolvedPublic

Description

On both Chrome and Firefox on Windows 64bit and Safari 10 on OSX, multiple JPEGS appear to be served as text. For example, when viewing [[:File:ApisDorsataHive.jpg]] at full resolution (https://upload.wikimedia.org/wikipedia/commons/4/4d/ApisDorsataHive.jpg), I am seeing:

"����JFIFHH��4�ExifII*  �� ���(1�2�i�.��"  OLYMPUS DIGITAL CAMERA OLYMPUS IMAGING CORP. FE115,X715HHGIMP2007:03:03 20:53:07PrintIM0300%� 6 Nr �����������   �  ����� ' '�'�''^'�'�'�'@@������@@������@@������@@������@@������@@������������"�'�}�0221������ ����� � ��|�����}| �0100���� ��� ������ ��� � � 2006:10:21 12:34:432006:10:21 12:34:43 =dldOLYMP�����  !�."2�#�$B %NL &J� 'Z� (>> .001dd�di���d�h����D4317OLYMPUS DIGITAL CAMERA  �OKOKOKOKOKOKNGOK � � �1.001 X19020342�"/sI��"/� t  d ndqnro��o�~�` {��z }    |������� o8t(N���� A  �� �ww=���xy [$� %� &� CCCCC dddd��Z�27  X    0 < $XzdX?��r{�ASCII ddR980100n v (~ 'HH����JFIF��C    $.' ",#(7),01444'9=82<.342��C  2!!22222222222222222222222222222222222222222222222222����"�� ���}!1AQa"q2���#B��R��$3br� %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������� ���w!1AQaq"2�B���� #3R�br� $4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz�������������������������������������������������������������������������� ?�Ǵ�Nc�W��1����duOjK����v 5�gdq��S~���R�x�;����,�43$�D�0�1U�Hl�T��Q֨�u+�8�A� ��S� ��w;8��x���妮gR|����b�8�[��B���ux<��?�T�ڻXg��)% �� m�Ҹ}j1=ɕr�� w�<+�9�t�PQ�� �K!�H2� ����A�X/[�6@ q�ڡ����7 �䎴ĝ����˱�y�Һ\�r���<��5��� ������/#�GS��W�m��ě6�E'��P $�% l���~u����B%�!|�a����\�o I'՛��ɾȎ�U6�.�����QȬ覂�سDCc'�&����V��f�>R�|՘n#]�� ��Sp��w1����10�r詸��/<� O���D�)�*}:h"��,]��iU����ђ#��eJR��JOcZ�T���@�"3G����R�\��1oNƩ"�re =kGiw4�2*(^ ���Wl�J�8�{��/��Q.�R��i����v#�>PZ�-�z�9� ��ZW�U����/��T{XE��������iW04�KB��z�T� K�l۟�]m��.-�ݜ,L0� f�5&��e��OqJ�f��"�Q���K����z߆���؋x#9��eQ�|������=����i!��S���E�a'�qҥ���VR#wJ*U�y��2��+d�mY�n�#�i�ٝ�:�U���6O�����]q�[�1�?�6sqY-��#98'��r¬d�ݍ%}J�w3X�e�@wp��A� >�Q{���:�~��;V��2�o�]F&��4ˁ�j+Վ�j��͉�q��}V{�(�~Y�U��6p;s��b��M�^��?O\S ��� ۳��Eh��4��/FB+Zt�d��%�����}�KI�ta�X18���V�KM\B��0k^�VǃbY���6˔Uʜ��8�j����-�t���[i'=�~�� �>͛{칎".....

The same error also occurs with https://upload.wikimedia.org/wikipedia/commons/7/71/HAARP20l.jpg

This has been reported multiple times now on Commons Administrator's Noticeboard.

Event Timeline

I can replicate the issue using FF 49.0.1 on Mac OS X 10.11.5 with the file https://commons.wikimedia.org/wiki/File:ApisDorsataHive.jpg

Thanks for taking the time to report this!
@Storkk and @Nick,
could you please open your web browser's developer tools and reload the page on which you see the problem? I am curious what is shown in the 'network' tab of the developer tools under "(File) Type". For more information please see:

In Firefox 49.0.1 on Windows 7 64-bit: Content-Type: image/jpeg
In Chrome 54.0.2840.59 m on Windows 7 64-bit: content-type:text/html; charset=UTF-8 (though there is also content-encoding:gzip which is not present in Firefox)

(these are in the "Response Headers", which is what I assume you were asking for)

IE 11.0.9600.18449 has Content-Type image/jpeg, but is displaying the image correctly unlike Firefox

@Aklapper

Type is 'html' with the full output below.

304 | GET | ApisDorsataHive.jpg | upload.wikimedia.org | JS Document | html | 151.74kb | 153.83kb | 35ms

Can any of you get the IP of upload.wikimedia.org? This might be a few corrupted file on some cache servers (it works fine for me).

For reference, this is what I got from upload-lb.ulsfo.wikimedia.org (198.35.26.112)

HAARP20l.jpg (750×1 px, 712 KB)

The IP serving me upload.wikimedia.org is 91.198.174.208

Hmm. A simple curl still worked... not sure why:

Screenshot from 2016-10-18 19-56-19.png (731×1 px, 353 KB)

The file being served is not corrupt... The sha-256 of the file interpreted as text is: d1a021c6178397fdc59eb4e221c7f7779da2c4ab85d4b7f36ed4f28f231567f8
(for https://upload.wikimedia.org/wikipedia/commons/7/71/HAARP20l.jpg)

This matches the file you attached.

The sha-256 digest of ApisDorsataHive.jpg also interpreted as text is 9b36b7552639474ce0df833975471b459a4ffd4988d1a89cf700d5fc5e7b1243 - I'll guess that matches too.

I can no longer reproduce on any of the files.

I don't have troubles with either FF 47 or IE 11 on Windows 7/32. I just updated to FF 49 and it's still working fine. When I checked https://upload.wikimedia.org/wikipedia/commons/7/71/HAARP20l.jpg and https://upload.wikimedia.org/wikipedia/commons/4/4d/ApisDorsataHive.jpg in the developer tools, I got "jpeg" as a file type for both images.

The server ip is 91.198.174.208 which is the same as Storkk's who did have problems.

Tentatively adding SRE, feel free to remove again if this happens / happened in a higher layer.

All reporters on COM:AN also now report it working.

I can no longer replicate the issues I encountered earlier either.

If I had to venture a guess after-the-fact, I'd guess that some bad mime-type headers slipped into at least some of the caches for these files, and then eventually they expired and refreshed correctly.

We don't generally mess with Content-Type header in VCL. There's only one case where VCL sets it, and that's when generating an internal error page (and then we'd replace the content with error output, too). So unless it's an extremely unlikely bug in Varnish itself, first guess would be Swift temporarily having the mime type wrong? I'm not even sure where it gets the mime-type to begin with (probably the uploader on commons?).

Aklapper lowered the priority of this task from High to Low.Oct 20 2016, 11:37 AM

Lowering priority as this cannot be reproduced anymore.

Closing as resolved as it cannot be reproduced anymore. If the bug appears again feel free to reopen.