Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 267318 - net-proxy/squid-3.0.13 : causes "content encoding error" in firefox for certain sites
Summary: net-proxy/squid-3.0.13 : causes "content encoding error" in firefox for cert...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Gentoo Network Proxy Developers (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-24 12:11 UTC by Aurélien Requiem
Modified: 2009-05-09 07:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aurélien Requiem 2009-04-24 12:11:00 UTC
Hi Gentoo's team.

1- I recently upgraded to squid 3.0.13 (STABLE13).
2- I upgraded the conf and restarted the service
3- After browsing few websites, firefox complained on a specific one "Content encoding error"

It seems to be a well know problem. The fix has been imported to squid 2.6 and 3.1 branch but not the current 3.0

There's some interesting stuff there :
http://squidproxy.wordpress.com/2008/04/29/chunked-decoding/
and there :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501192

Maybe it might be interesting to revert squid 3.0 to ~x86 (and others) until this problem is fixed by the squid-cache team ?
Or at least put a few word in the ebuild about the issue ?



Reproducible: Always

Steps to Reproduce:
1. install squid 3.0.13
2. use default squid conf
3. browse http://www.gridvm.org/ with Firefox
4. see the result

Actual Results:  
Content Encoding Error

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

    * Please contact the website owners to inform them of this problem.

Expected Results:  
The content of the website
Comment 1 Alin Năstac (RETIRED) gentoo-dev 2009-04-25 18:14:34 UTC
Here is the workaround:
  acl broken dstdomain www.gridvm.org
  request_header_access Accept-Encoding deny broken

Amos, can you help me fix this issue? I would appreciate if the solution implemented in 3.1 is backported to 3.0 branch, but a patch is also good.
Comment 2 Aurélien Requiem 2009-04-25 22:18:02 UTC
Hi Alin

I'm not sure the workaround is a good solution because in case of many websites it will force the admin sys to add many rules like this one. At the end, it will be an extra work for the admin sys and also to the users who will have to report each "broken" websites.

That's why I've initially proposed a downgrade on squid...

Cheers
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2009-04-25 23:02:37 UTC
How about "request_header_access Accept-Encoding deny all"? 
This should help you circumvent the issue till a proper fix is released.
Comment 4 Amos Jeffries 2009-04-26 00:00:50 UTC
We have found the encoding problem to be generated by IIS 6.0 installs with incorrect settings (when apache showed up, it turned out to be accelerating a IIS .NET system).

Only a handful of such bad installs have come to light in the last year and many of them are fixed when the relevant admin are notified of the issue. So I don't believe its a hard task to config around specifics.

Unfortunately the fix inside Squid is heavily linked to many ICAP and encoder alterations. So a back-port is not going to be easy. I'd rather the 3.1 or 2.7 packages are used if the work-around is not wanted.
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2009-04-26 11:45:44 UTC
I beg to differ... A stable version should work at least at the same level as its predecessor. and Gentoo strive to be a "just works" kind of distribution.

IMO these are the options:
  1) A port of the solution from branches that do not have this problem, 2.7 or 3.1 (preferred)
  2) I could add "request_header_access Accept-Encoding deny all" to the default squid.conf installed on Gentoo (would this have any unfortunate side effects?)
  3) Drop Gentoo stable keywords for squid-3.0 branch (I would prefer not to do that, but if previous solutions are not feasible, I will have to) 
Comment 6 Aurélien Requiem 2009-04-26 11:55:00 UTC
I think Alin is right.

To me, gentoo is a quality based dstrib.
According to squid-cache website, 2.7 branch is considered stable and doesn't have this problem.

for point 2, I really have no idea on possible side effects. If someone has...

cheers
Comment 7 Amos Jeffries 2009-04-26 12:26:42 UTC
(In reply to comment #5)
> I beg to differ... A stable version should work at least at the same level as
> its predecessor. and Gentoo strive to be a "just works" kind of distribution.
> 

2.5 is the predecessor for 3.0. It is likewise broken in this regard. (2.6/2.7 are an almost completely separate side branch of Squid also derived from 2.5).

Our view of 3.0 is that it is stable, though incomplete of features, and we won't be adding anything beyond bug fixes to the official package that cause any risk of destabilizing it.
3.1 is the next step up with more feature parity from 2.7 and big bug fixes like this one. Now almost complete though not yet fully proven.


> IMO these are the options:
>   1) A port of the solution from branches that do not have this problem, 2.7 or
> 3.1 (preferred)

If you so wish, the patches made to 3.1 which I can identify as the core of the encoding feature are:
    http://www.squid-cache.org/Versions/v3/3.1/changesets/11273.patch
    http://www.squid-cache.org/Versions/v3/3.1/changesets/11274.patch
    http://www.squid-cache.org/Versions/v3/3.1/changesets/11276.patch
    http://www.squid-cache.org/Versions/v3/3.1/changesets/b9189.patch

 Be aware they introduce exception throwing, which 3.0 is not hardened to cope with at the event-loop level. A try-catch is added, but untested outside the hardening done for 3.1.


>   2) I could add "request_header_access Accept-Encoding deny all" to the
> default squid.conf installed on Gentoo (would this have any unfortunate side
> effects?)

Yes that would cause gzip,bzip,deflate and other working compressions also to be disabled on all Internet traffic through the configured proxy.


>   3) Drop Gentoo stable keywords for squid-3.0 branch (I would prefer not to do
> that, but if previous solutions are not feasible, I will have to) 
> 

This chunk-encoding is not a stability issue of squid, but of miss-configured external software acting in violation of HTTP. Akin to a firewall blocking HTTP access to one particular virtual hosting server.

FWIW: The site in question here no longer appears to be broken in this way.
If you can still see the breakage I'd like to know what headers are transferring.
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2009-04-26 13:00:29 UTC
(In reply to comment #7)
> FWIW: The site in question here no longer appears to be broken in this way.
> If you can still see the breakage I'd like to know what headers are
> transferring.

There you go...

GET / HTTP/1.0

User-Agent: Wget/1.11.1

Accept: */*

Host: www.gridvm.org

Connection: Keep-Alive



HTTP/1.1 200 OK

Date: Sun, 26 Apr 2009 12:55:22 GMT

Server: Apache

X-Powered-By: PHP/5.2.6-pl7-gentoo

X-Pingback: http://www.gridvm.org/press/xmlrpc.php

Status: 200 OK

Cache-Control: max-age=300

Expires: Sun, 26 Apr 2009 13:00:22 GMT

Vary: Accept-Encoding,User-Agent

Keep-Alive: timeout=15, max=100

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: text/html; charset=UTF-8

I know www.gridvm.org is broken, but still, if previous Gentoo version worked, the current stable version must work as well. As simple as that...
Comment 9 Alin Năstac (RETIRED) gentoo-dev 2009-05-02 15:19:43 UTC
Fixed in squid-3.0.14-r2 by applying http://dev.gentoo.org/~mrness/distfiles/squid-3.0.14-chunk-encoding.patch.gz .

@BobCaTT : Please test this version. Reopen this bug if squid process suddenly stops. If it works, I'll request stabilization after a wait period of 2 weeks. 

@Amos: This patch should really find its way into upstream source tree. 
Comment 10 Aurélien Requiem 2009-05-03 03:47:15 UTC
Ok, I've installed your patch and it seems to work, even on other broken sites.
I'll continue my testings for a couple of days and I'll update the bug accordingy.

Thanks for the great job !
Comment 11 Amos Jeffries 2009-05-08 01:30:12 UTC
Thanks for the work porting and testing. Upstream have discussed and voted to include this starting from 3.0.STABLE16-RC1 which will be out shortly.
Comment 12 Aurélien Requiem 2009-05-08 01:40:20 UTC
After 5 days of testings, I had no problem so far. squid didn't restarted or crashed. Web sites display properly and no more error message with firefox.

Thanks again for the work.
Comment 13 Alin Năstac (RETIRED) gentoo-dev 2009-05-09 07:43:08 UTC
Big thanks to both of you!

I've requested stable keywords for squid-3.0.14-r2 (see bug 269096).