Last modified: 2012-02-20 15:15:39 UTC
While repeatedly fetching the URL http://en.wikipedia.org/w/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:Candidates_for_speedy_deletion with "Accept-encoding: gzip" set, occasionally (about 10% probability) I will receive a response that is uncompressed. I've received reports this also happens when using API login (see [[User talk:MER-C#Wiki.java...again]]). Test code: import java.io.*; import java.net.*; public class Blah { public static void main(String[] args) throws IOException { for (int i = 0; i < 25; i++) { URLConnection connection = new URL("http://en.wikipedia.org/w/api.php?format=xml&action=query&list=categorymembers&cmtitle=Category:Candidates_for_speedy_deletion").openConnection(); connection.setRequestProperty("Accept-encoding", "gzip"); connection.setRequestProperty("User-Agent", "Test script"); connection.connect(); System.out.println(connection.getHeaderFields()); } } } This merely dumps the HTTP headers. Sample output: {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:51 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq38.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq38.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:52 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq64.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq64.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:52 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq64.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq64.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:54 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq65.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq65.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:57 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq64.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq64.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:57 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq74.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq74.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:58 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq60.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq60.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:58 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq37.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq37.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:48:59 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq66.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq66.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:00 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq65.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq65.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:00 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq66.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq66.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:02 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq77.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq77.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:04 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq37.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq37.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:05 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq39.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq39.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:06 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq40.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq40.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:06 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq62.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq62.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:07 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[759], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq72.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq72.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:07 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq75.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq75.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:08 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq72.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq72.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:09 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq66.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq66.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:11 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq72.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq72.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:13 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[759], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq60.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq60.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:14 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[759], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq60.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq60.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:14 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq62.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq62.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} {null=[HTTP/1.0 200 OK], Date=[Tue, 11 Oct 2011 08:49:15 GMT], Vary=[Accept-Encoding,X-Forwarded-Proto], Content-Length=[332], Content-Encoding=[gzip], Content-Type=[text/xml; charset=utf-8], X-Cache-Lookup=[MISS from sq73.wikimedia.org:80, MISS from sq34.wikimedia.org:3128], Connection=[keep-alive], Server=[Apache], X-Cache=[MISS from sq73.wikimedia.org, MISS from sq34.wikimedia.org], X-Content-Type-Options=[nosniff], Cache-Control=[private]} This wasn't an issue prior to the 1.18 upgrade on Wikimedia.
Created attachment 9214 [details] Output of test program Attached output, I forgot that bugzilla wraps lines. (And I can't edit it out.)
How occasionally is occasionally? Seems it might be more likely we've got a bad API Apache
@Reedy: in MER-C's example, three of 25 requests fail. I was seeing some level of errors, now when I run that script all 25 succeed. Keep in mind this isn't/wasn't a problem with 'categorymembers', it is/was a general problem.
Accept-Encoding=gzip is optional for the server. You should not insist on that, because the server can you also send an uncompress result. Check with "gzip".equals( connection.getHeaderField( "Content-Encoding" ) ) if the server send you an gzipped result and you have to wrap your InputStream into a GZIPInputStream or not.
(In reply to comment #4) > Accept-Encoding=gzip is optional for the server. You should not insist on that, > because the server can you also send an uncompress result. Sorry, that is wrong, but makes the world easy. http://www.ietf.org/rfc/rfc2068.txt - 14.3 Accept-Encoding If an Accept-Encoding header is present, and if the server cannot send a response which is acceptable according to the Accept-Encoding header, then the server SHOULD send an error response with the 406 (Not Acceptable) status code.
I experienced this bug as well yesterday, but the issues appear to have gone away. All the test cases I ran just now succeeded. Despite this, it may still be worth looking into; bugs do not just magically appear and then disappear.
Even more sounds like a bad server
Any more recent replications of this bug? I'm moving it to site related stuff also
I ran a 5000+ request program on the Saturday after Thanksgiving without encountering this problem.
Issue seems to have been fixed per comment 9. So I am closing this bug.