Closed Bug 1043256 Opened 11 years ago Closed 11 years ago

Invalid encoding error reported when being redirected to traffic.outbrain.com

Categories

(Core :: Networking: HTTP, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34
Tracking Status
e10s + ---
firefox34 --- fixed
b2g-v1.3 --- affected
b2g-v1.4 --- affected
b2g-v2.0 --- affected
b2g-v2.1 --- fixed

People

(Reporter: gerard-majax, Assigned: dragana)

References

Details

Attachments

(4 files, 9 obsolete files)

[Blocking Requested - why for this release]: This is breaking user access to content. STR: 0. Load a website that is using traffic.outbrain.com 1. Click on a link that gets handled by this provider Expected: Link is loaded properly Actual: An error page stating encoding issue is shown A 100% reproductibility is for example on http://m.leparisien.fr/. Open an article, click on links at bottom of the page, it gets redirected through paid.outbrain.com
Of course, no logcat output helps.
QA Wanted for branch checks.
Keywords: qawanted
I have never noticed how much this is used by at least french news websites. Ouest France is making use of this, and is hit by the bug.
Summary: Invalid encoding error reported when being redirected to paid.outbrain.com → Invalid encoding error reported when being redirected to traffic.outbrain.com
Component: Gaia::System → Networking: HTTP
Product: Firefox OS → Core
Attached file bug1043256-http.log.child-1.bz2 (obsolete) —
Attachment #8463860 - Attachment is obsolete: true
This is only happening on B2G, and on multiple devices.
I am not sure can this be the same problem as Bug 1012917?
Flags: needinfo?(jduell.mcbugs)
This issue does occur on the latest 2.0 Flame, 2.1 Flame, and 2.1 Buri builds. An encoding error is recieved. Environmental Variables: Device: Flame Master BuildID: 20140730124313 Gaia: b67ddd7d40b52e65199478b8d6631c2c28fdf41d Gecko: b3cbce8a2b87 Version: 34.0a1 (Master) Firmware Version: v122 User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0 Environmental Variables: Device: Flame 2.0 BuildID: 20140730080807 Gaia: e8425788e0372fbbcc40387b799f0636c041fc14 Gecko: 20c472fc0ee3 Version: 32.0 (2.0) Firmware Version: v122 User Agent: Mozilla/5.0 (Mobile; rv:32.0) Gecko/32.0 Firefox/32.0 Environmental Variables: Device: Buri Master BuildID: 20140730045709 Gaia: 25e998814ba89f30fe44cd2fdfbb44d160a04641 Gecko: 08c23f12a43e Version: 34.0a1 (Master) Firmware Version: v1.2device.cfg User Agent: Mozilla/5.0 (Mobile; rv:34.0) Gecko/34.0 Firefox/34.0 An error that the page uses an "invalid or unsupported form of compression." is seen when reproducing this issue on the latest 1.4 Flame build. Listed separately in case the difference means more than just a wording change in more recent builds. Environmental Variables: Device: Flame 1.4 BuildID: 20140730110705 Gaia: 142953262d2cb031e3db217206edc3507580b0df Gecko: 3c780088aae4 Version: 30.0 (1.4) Firmware Version: v122 User Agent: Mozilla/5.0 (Mobile; rv:30.0) Gecko/30.0 Firefox/30.0
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(jmitchell)
Keywords: qawanted
not a regression
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+
Flags: needinfo?(jmitchell)
QA Whiteboard: [QAnalyst-Triage+ → [QAnalyst-Triage+]
Hmm, the HTTP logs are huge, so I'm not positive I'm looking at the right HTTP transactions. But all of the requests to paid.outbrain.com URIs seem to not do redirects: instead they are replying with 200 (normal response) chunked gzipped replies, which seem to happen normally (OnDataAvailable called with 184 bytes of data, OnStopRequest is called with NS_OK) I do see converter removed 'gzip' content-encoding in both the parent and child log--is it possible that we're trying unzip twice somehow for a chunked gzipped reply? I'm not sure how common those are. But I'm seeing the ChannelChild call OnDataAvailable with 184 bytes and OnStopRequest with NS_OK, too, so that seems fine. Basically I'm not sure the log is capturing the error. The only channels with an error status in the log are error=804b0002 (NS_BINDING_ABORTED), which doesn't sound like it would cause the encoding error you mention. Could you try again, and/or give me the exact URI that you click? I don't think this is bug 1012917 because that requres diverting the channel (which we only do for downloads or external content handlers), and this is allegedly a redirect.
Flags: needinfo?(jduell.mcbugs) → needinfo?(lissyx+mozillians)
I looked at it. we get data, decompressed them on parent then send them to child that tries to decompress them again. so we need to suspend decompression on parent (or child). The proper way to do it should be solved (should be found...) in bug 1012917 (something similar we need to do for FTP over http (the bug that i was working on), there you mention that we should wait for bug 1012917 to find the way to do it properly?)
Flags: needinfo?(jduell.mcbugs)
Thanks :)
Flags: needinfo?(lissyx+mozillians)
Dragana, Bug 1012917 covers more stuff than this, and doesn't need to be fixed for B2G right now. Can you make a fix that works just for this case (I'm guessing it's specific for chunked compressed replies over e10s), and we'll fix divert after that? (It may be the code that you already suggested in a previous bug, which I then told you to wait for bug 1012917 to add :) We want a quick, simple fix here if possible.
Assignee: nobody → dd.mozilla
Flags: needinfo?(jduell.mcbugs)
Blocks: 1036433
Blocks: 997631
Jason, can we check whether it is a problem for 1.3 ? This may be important for France market.
Flags: needinfo?(jsmith)
Sure. qawanted to check 1.3.
Flags: needinfo?(jsmith)
Keywords: qawanted
Attached patch bug-1043256-fix1.patch (obsolete) — Splinter Review
Attachment #8466952 - Attachment is obsolete: true
Attached patch fix v1 (obsolete) — Splinter Review
If we apply converters on parent, we need to clear content-encoding field from the header. If a conversion could not be applied on parent, it will not be appied on child too? Because i am clearing the whole content-encoding field even if they are not applied because of of this check "if (gHttpHandler->IsAcceptableEncoding(val)) "? Or should i just delete applied converters?
Attachment #8466958 - Flags: review?(jduell.mcbugs)
tracking-e10s: --- → +
OS: Gonk (Firefox OS) → All
Hardware: ARM → All
This issue does occur on Buri 1.3. An error page occurs when visiting traffic.outbrain.com. Environmental Variables: Device: Buri 1.3 BuildID: 20140721151227 Gaia: 23f55be856cef53c6604a6fe4aeb09061afbc897 Gecko: 9727017eabb9 Version: 28.0 (1.3) Firmware Version: v1.2device.cfg User Agent: Mozilla/5.0 (Mobile; rv:28.0) Gecko/28.0 Firefox/28.0
QA Contact: jmercado
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage?]
Flags: needinfo?(jmitchell)
Keywords: qawanted
This may impact ZTE for France market, per comment 20 :(
Flags: needinfo?(vchen)
Flags: needinfo?(nwinter)
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(jmitchell)
Comment on attachment 8466958 [details] [diff] [review] fix v1 Review of attachment 8466958 [details] [diff] [review]: ----------------------------------------------------------------- Discussed w/Dragana. We don't want to clear the HTTP header--that seems likely to break some addon or something eventually down the road. Better to figure out why we're trying to decode twice (only for chunked data? I suspect so) and do something internally to stop that from happening (IPDL flag to SendOnStartRequest, etc). I suspect that this is just happening for chunked replies (we would have gotten a lot of bug reports sooner otherwise), so we probably forgot to handle that special case. Also we need tests :)
Attachment #8466958 - Flags: review?(jduell.mcbugs) → review-
QA Whiteboard: [QAnalyst-Triage+] → [QAnalyst-Triage+][lead-review+]
Attached patch fix 2 (obsolete) — Splinter Review
It was not chunked data but data without content-type. In case of data without content-type, the real listener is started later (onDataAvailable or OnStopRequest) but content-ending will be loaded. That is why content sniffing worked for compressed data too. I move loading of content-encoders into content sniffer(if it is used) so that it is always after OnStartRequest. And i changed content sniffer to be able to detect content type even if data is encoded.
Attachment #8466958 - Attachment is obsolete: true
Attachment #8468351 - Flags: review?(jduell.mcbugs)
Flags: needinfo?(nwinter)
I just tested this patch on my Nexus S, and it does the job :)
Flags: needinfo?(dd.mozilla)
thank you for testing.
Flags: needinfo?(dd.mozilla)
Dragana, do you think this patch could be applied to v1.3 ? Partner may be interested in fixing this, since it's affecting v1.3 recently launched in France and that there seems to be quite a couple of users of this in french website.
Flags: needinfo?(nwinter)
Flags: needinfo?(dd.mozilla)
Comment on attachment 8468351 [details] [diff] [review] fix 2 Review of attachment 8468351 [details] [diff] [review]: ----------------------------------------------------------------- (jduell asked me to take a look at this patch) I'm review+ on this with just one minor little nit. Looks clean and clear and it provides a test case! ::: netwerk/streamconv/converters/nsUnknownDecoder.cpp @@ +371,5 @@ > { > NS_ASSERTION(mContentType.IsEmpty(), "Content type is already known."); > if (!mContentType.IsEmpty()) return; > > + const char* testData = (const char*)mBuffer; This should be converted to a C++ish cast.
Attached patch fix v2 (obsolete) — Splinter Review
Thanks Daniel for the review. this is with the fix.
Attachment #8468351 - Attachment is obsolete: true
Attachment #8468351 - Flags: review?(jduell.mcbugs)
Attachment #8471432 - Flags: review?(daniel)
Attached patch fix for v 1.3 (obsolete) — Splinter Review
Here is a bit changed patch that complies with v1.3. Can somebody test. I have removed the test from this patch because it is based on another test that is not in v1.3. I can add it if we need it.
Flags: needinfo?(dd.mozilla)
Attachment #8471432 - Flags: review?(daniel)
Attached patch fix for v1.3 (obsolete) — Splinter Review
just a small fix.
Attachment #8471461 - Attachment is obsolete: true
Attached patch fix v2 (obsolete) — Splinter Review
Attachment #8471432 - Attachment is obsolete: true
Attachment #8471642 - Flags: review?(daniel)
Attachment #8471642 - Flags: review?(daniel)
Attached patch fix v2 (obsolete) — Splinter Review
just small changes
Attachment #8471642 - Attachment is obsolete: true
Attachment #8471719 - Flags: review?(daniel)
Attached patch fix for v 1.3Splinter Review
this is patch with small changes so that it is compiling with v 1.3.
Attachment #8471641 - Attachment is obsolete: true
Flags: needinfo?(lissyx+mozillians)
(In reply to Dragana Damjanovic from comment #33) > Created attachment 8471724 [details] [diff] [review] > fix for v 1.3 > > this is patch with small changes so that it is compiling with v 1.3. Thanks, I'm rebuilding a v1.3 on my Flame to test this!
Flags: needinfo?(lissyx+mozillians)
Comment on attachment 8471724 [details] [diff] [review] fix for v 1.3 That also fixes the issue on my Flame after applying it to v1.3 :)
Attachment #8471724 - Flags: feedback+
Comment on attachment 8471719 [details] [diff] [review] fix v2 Review of attachment 8471719 [details] [diff] [review]: ----------------------------------------------------------------- ::: netwerk/protocol/http/nsHttpChannel.cpp @@ +928,5 @@ > + if (!unknownDecoderStarted) { > + nsCOMPtr<nsIStreamListener> listener; > + nsISupports *ctxt = mListenerContext; > + rv = DoApplyContentConversions(mListener, getter_AddRefs(listener), ctxt); > + if (NS_FAILED(rv)) return rv; Maybe you can fix this line while you're at it? Add braces + newline I mean.
Attachment #8471719 - Flags: review?(daniel) → review+
Attached patch fix 3Splinter Review
Thanks Daniel.
Attachment #8471719 - Attachment is obsolete: true
Attachment #8472490 - Flags: review+
Keywords: checkin-needed
I don't see Daniel listed as a Necko peer. Is he? https://wiki.mozilla.org/Modules/Core#Necko
Keywords: checkin-needed
Ryan--thanks for noticing! :) Necko policy is that any necko peer can delegate a review to someone. I'm fine with Daniel having done the review here. But thanks so much for doing your best to keep random elements from landing code in our part of the tree :) I really do appreciate it.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Flags: needinfo?(nwinter)
blocking-b2g: 2.1? → ---
Depends on: 1067346
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: