Closed Bug 848457 Opened 11 years ago Closed 11 years ago

TypeSniffer is chopping the first 32 bytes from attachments

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: kumar, Assigned: glob)

References

Details

Attachments

(1 file, 7 obsolete files)

After the March 5th upgrade (bug 848218?) I noticed that attaching a text file doesn't quite work. The first couple lines seem to be truncated at random points. Here is the file I was trying to upload: http://people.mozilla.com/~kmcmillan/trusted-ui-error-from-build.log

I am using Aurora 21.0a2 (2013-03-04):
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20130304 Firefox/21.0
Attached file testing attachment! (obsolete) —
Yep, happened here again when I tested the attachment. You can see that the first couple lines of the file was cut off.
Attached file same attachment (obsolete) —
I downloaded your log file from http://people.mozilla.com/~kmcmillan/trusted-ui-error-from-build.log and then uploaded it to this bug (attachment 721808 [details]). You can see that it is the exact same text as the one on people.mozilla.org.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
What browser/version are you in? Did you also try it on Aurora?
btw, I always use Aurora with bugzilla and I only noticed this after yesterday's upgrade. I'll try in Nightly...
Attached file testing attachment from Nightly (obsolete) —
test from Firefox Nightly 22.0a1 (2013-03-06)
I confirmed that the truncation is still happening in Nightly with a fresh profile (no add-ons, etc). Can no one else reproduce this? I'm re-opening since it was reproducible in a clean Nightly.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(In reply to Kumar McMillan [:kumar] from comment #5)
> What browser/version are you in? Did you also try it on Aurora?

Firefox 19.0.1. This can hardly be a bug in Bugzilla as the browser is responsible to transmit data to the server.
Attached file testing attachment from Firefox 19 (obsolete) —
I just tried one from Firefox 19 (a clean profile) and the same truncation occurred. For sanity, I ran this on the file locally:

$ head ~/tmp/trusted-ui-error-from-build.log
-*- PaymentManager: PaymentManage.init()
-*- PaymentManager: ppmm.addMessageListener(Payment:Pay, [object Object])
-*- PaymentManager: ppmm.addMessageListener(Payment:Success, [object Object])
-*- PaymentManager: ppmm.addMessageListener(Payment:Failed, [object Object])
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded
###################################### forms.js loaded
############################### browserElementPanning.js loaded
######################## BrowserElementChildPreload.js loaded


maude:~ kumar$ md5 ~/tmp/trusted-ui-error-from-build.log
MD5 (/Users/kumar/tmp/trusted-ui-error-from-build.log) = cf443756abfed3f18c0bd03a7d3f9e1e


For some reason, the md5 of the file I uploaded to people did not match (even though the contents were the same). I re-uploaded and now the MD5s match.

Can you try again with the new file on people? http://people.mozilla.com/~kmcmillan/trusted-ui-error-from-build.log
Attached file same file (obsolete) —
Attachment #721808 - Attachment is obsolete: true
The uploaded file has checksum cf443756abfed3f18c0bd03a7d3f9e1e as in comment 11. So it's working fine.
Huh. I'm stumped. Could it be something related to my login? That doesn't make any sense. Well, feel free to close it I guess. I can reproduce it every time in every browser I've tried. I'll just keep an eye on my future uploads to check for truncation.
i'm also unable to reproduce this issue (using nightly on mac), and you're the only person who has reported this issue.

> Could it be something related to my login?

your bugzilla login? no, we don't do anything different there which depends on the current user.

perhaps there's an issue with a proxy between you and bmo?

> I'm stumped.

me too.
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → WORKSFORME
Attached file upload test on another VPN (obsolete) —
Just to be silly, let me try an upload from a non-Mozilla VPN
Meh, same issue. Ok, if no one else sees it I can deal with it. Thanks.
Attached file trying download-upload (obsolete) —
Mozilla/5.0 (X11; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0 SeaMonkey/2.19a1 ID:20130309175203 c-c:8fb887a279ff m-c:9e6232e86000

I downloaded the people.m.c file from comment #0 and then tried to upload it, just to see what would happen.
...and I can't reproduce the bug. (Actually it's the file from comment #11 at the same URL of course).

I wonder what is different with Kumar, that the first 32 bytes of the file (no more, no less), and some at the end, go missing when he does it.
reopening - glandium reported over irc he's also seeing the first 32 bytes of his uploads truncated.

he's using "Mozilla/5.0 (X11; Linux x86_64; rv:21.0) Gecko/20130308 Firefox/21.0".

he can reproduce this issue when uploading to bugzilla-dev.allizom.org, so i'll see what i can do with adding debugging to bugzilla-dev to trace what's going on here.
Assignee: nobody → glob
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
looks like the typesniffer extension is to blame; files aren't truncated with it disabled.
Severity: normal → major
Component: General → Extensions: Other
OS: Mac OS X → All
Hardware: x86 → All
Attached patch patch v1Splinter Review
to reproduce, you have to attach a file selecting 'auto detect' as the type, and ensure the file doesn't have a recognised file extension. under these conditions typesniffer kicks in.

the problem is after detecting the mimetype, it doesn't seek back to the start of the file, resulting in the cgi from skipping the 32 bytes typesniffer reads.
Attachment #721794 - Attachment is obsolete: true
Attachment #721828 - Attachment is obsolete: true
Attachment #721857 - Attachment is obsolete: true
Attachment #721884 - Attachment is obsolete: true
Attachment #722826 - Attachment is obsolete: true
Attachment #723291 - Attachment is obsolete: true
Attachment #724936 - Flags: review?(dkl)
Comment on attachment 724936 [details] [diff] [review]
patch v1

Even though the patch does not apply cleanly, I get what it is you are doing and manually adding the one line to TypeSniffer/Extension.pm fixes the issue in my testing. r=dkl
Attachment #724936 - Flags: review?(dkl) → review+
(In reply to David Lawrence [:dkl] from comment #23)
> Even though the patch does not apply cleanly, I get what it is you are doing
> and manually adding the one line to TypeSniffer/Extension.pm fixes the issue
> in my testing. r=dkl

that's what i get for fixing whitespace and using the 'create attachment from clipboard' (evidently my terminal app strips trailing whitespace when you copy).

Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/
modified extensions/TypeSniffer/Extension.pm
Committed revision 8661.

we'll try to get this fixed pushed to production soon.
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Summary: Uploaded files appear to be truncated → TypeSniffer is chopping the first 32 bytes from attachments
Hmm. This is sad. Has it always been the case? If so, my apologies.

Gerv
gerv@mink:/usr/src/typesniffer$ bzr ci
Committing  to: bzr+ssh://bzr.mozilla.org/bugzilla/extensions/typesniffer/trunk/
modified Extension.pm
Committed revision 4.                                                          

Gerv
Component: Extensions: Other → Extensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: