[MATCH HISTORY] I18n.js truncated when requested by certain IPs?

DossyNJ·10/10/2014, 9:57:01 PM·2 votes·1,136 views

I suspect this is a CloudFlare and/or CDN-related problem, but I'll let the Riot engineers figure out the root cuase. I'll describe the symptom:

When trying to view Match History -- any match, not any particular match -- the match history will fail to load, and in the JS console, the following errors are logged:

Uncaught SyntaxError: Unexpected token ILLEGAL I18n.js:7 Uncaught TypeError: Cannot read property 'trans' of undefined codex.js:1

When fetching I18n.js from one IP (I'm not going to post it publically, but Riot can contact me directly and I'll provide them), the response is truncated, with the last few bytes ending as:

"grid_section_damage_taken":"Damage Taken & Healed","breakdown_hea

It ends abruptly at that "breakdown_hea" ... and that's EOF.

The MD5 checksum of the truncated response I get is 1e5f239fbe526070d24cd16ad4e56b0a.

I thought it was just the file being broken on Riot's servers, but then everyone would be complaining that they can't get a Match History to load and it would get fixed real quickly, but this has been broken for me for days (maybe a week or more) now. So, I decided to troubleshoot a little, and use another IP address to request the same URL, and I get a different response -- one that looks like a complete JS file, not abruptly ended mid-string.

The MD5 checksum I get when requesting I18n.js from this other IP is cb9adb3d9c0271680617e1dfa271183c.

When I make the request and get this other I18n.js file, the match history loads just fine.

I'm wondering if there's some kind of GSLB or CDN in place that's got a bad version of this file in its cache, and I'm one of the unlucky ones getting my requests routed to it ...

If anyone wants/needs more details in order to troubleshoot and fix this, just let me know. I'd be glad to help.

5 Comments

RovingBlade10/14/2014, 2:21:52 AM2 votes

Nice thorough explanation of your findings, DossyNJ! Your post was the first I found when I started looking into this more deeply, after discovering the same issue you describe here (requests for the i18n.js file get a truncated response, ending with the same string you mention).

The CDN, CloudFlare, definitely seems like the culprit in that it has the bad truncated version of the file cached and is constantly returning the bad cached version in response to requests. The response includes these headers:

Cache-Control:public, max-age=14400 CF-Cache-Status:HIT

These headers indicate that the file was found in the CloudFlare cache, and that the cache should expire after 14,400 seconds (4 hours). However, since many of us seem to have been experiencing this issue for over a week, the cache either doesn't seem to be expiring correctly or it is refreshing with an equally bad copy of the fresh data.

With a bit more digging, I found that requesting the i18n.js file with some bogus query string appended to it will result in a response with the complete file. For example:

http://matchhistory.na.leagueoflegends.com/assets/1.0.0/codex/codex/util/I18n.js?v=1

Since that URL is new to CloudFlare, it doesn't use the same cached copy it has for the URL without the '?v=1' portion appended, so it sends the request all the way back to the canonical source (i.e. one of riots servers) and gets the correct data. From my limited vantage point, this seems to indicate that CloudFlare might be the problem and is not refreshing the cached version of this file in SOME of its databases/centers (another reasonable assumption, based on your observations).

So, not a lot we can do about this from our end without setting up a local proxy to modify the outbound request. Actually, after a quick google search for that, I found someone who wrote a chrome extension to do work around the issue! It blocks the browsers request to the (badly cached) I18n.js file, and has its own copy of that file bundled into the extension. A pretty hilarious hack / workaround, but I just installed it to check out the source code (simple and non-malicious) and to see if it works. Which it does! So, install it if you've got a match you are dying to look at. Otherwise, you'll just have to wait it out until Riot and CloudFlare find and fix the issue.

https://chrome.google.com/webstore/detail/league-of-legends-match-h/mdgeabipdapmbcpdldplafegigjhpain

Karlyr10/11/2014, 3:19:22 AM1 votes

Same here, match history is completly bugged out. Nothing is loading. Seems to happen all around Sherbrooke city (Quebec) I don't know if it's only around here or what but at least I'm not alone <3