apache / incubator-pagespeed-mod

Apache module for rewriting web pages to reduce latency and bandwidth.
http://modpagespeed.com
Apache License 2.0
697 stars 159 forks source link

Page speed cause JS errors #993

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I recently started tracking JS errors using Sentry and Raven.

I have noticed a few error report come through that seem to stem from PageSpeed:
Object doesn't support property or method 'getPixelatorParameters'
'pagespeed' is undefined
mod_pagespeed_9QW0VDBRAu is not defined
Cannot read property 'checkImageForCriticality' of undefined
It happens sporadically, and so I can't get a reproducible test case.

What version of the product are you using (please check X-Mod-Pagespeed
header)?
X-Mod-Pagespeed:1.9.32.1-4238

On what operating system?
Debian 6

Which version of Apache?
Apache/2.2.16 (Debian)

Which MPM?
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)

Original issue reported on code.google.com by Peta...@gmail.com on 25 Sep 2014 at 7:34

GoogleCodeExporter commented 9 years ago
Can you share the URL for your site?

Original comment by jmara...@google.com on 25 Sep 2014 at 7:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by jmara...@google.com on 25 Sep 2014 at 7:39

GoogleCodeExporter commented 9 years ago
Its happening across many sites I can share some of them:
mod_pagespeed_9QW0VDBRAu is not defined was on http://www.nzbgba.co.nz/boergoats

'pagespeed' is undefined was on 
http://www.inghamdriven.com/specials/mercedes-benz

Object doesn't support property or method 'getPixelatorParameters' was on 
http://www.inghamdriven.com/competition-entry?utm_source=INGHAM+HYUNDAI+CUSTOMER
S&utm_campaign=5dd112f9ee-INH_OctNov_Newsletter&utm_medium=email&utm_term=0_dd28
82aaeb-5dd112f9ee-121054777
(I think this might be embedded into a FB page tab)

I can't share the one for Cannot read property 'checkImageForCriticality' of 
undefined sorry

Original comment by Peta...@gmail.com on 25 Sep 2014 at 7:44

GoogleCodeExporter commented 9 years ago
Can you tell me what browsers those failures might be occurring on?  They seem 
to work fine on Chrome.

Original comment by jmara...@google.com on 25 Sep 2014 at 7:53

GoogleCodeExporter commented 9 years ago
mod_pagespeed_9QW0VDBRAu is not defined was Mozilla/5.0 (X11; CrOS x86_64 
5712.88.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.155 
Safari/537.36

'pagespeed' is undefined was Mozilla/5.0 (Windows NT 6.1; Trident/7.0; SLCC2; 
.NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 
6.0; .NET4.0C; .NET4.0E; CMDTDFJS; Tablet PC 2.0; rv:11.0) like Gecko

Object doesn't support property or method 'getPixelatorParameters' was 
Mozilla/5.0 (Windows NT 6.1; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 
3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; eSobiSubscriber 2.0.4.16; 
OfficeLiveConnector.1.5; OfficeLivePatch.1.3; Tablet PC 2.0; .NET4.0C; 
InfoPath.3; .NET4.0E; rv:11.0) like Gecko

Cannot read property 'checkImageForCriticality' of undefined was Mozilla/5.0 
(Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/37.0.2062.120 Safari/537.36

Original comment by Peta...@gmail.com on 25 Sep 2014 at 7:56

GoogleCodeExporter commented 9 years ago
One other shot in the dark -- do you have multiple machines running 
mod_pagespeed behind a load balancer?  Are they all configured the same?  Do 
they all run the same version of MPS?

Original comment by jmara...@google.com on 25 Sep 2014 at 7:59

GoogleCodeExporter commented 9 years ago
No, its just a single server.

Original comment by Peta...@gmail.com on 25 Sep 2014 at 8:00

GoogleCodeExporter commented 9 years ago
One thing that might cause this to transiently fail is that the browser's 
request for a JS file might fail somewhere along the path between it and your 
server.

What exactly are Sentry and Raven (I know I could search...)?  How do they 
track JS errors?

In any case, all of the errors are consistent with a JavaScript file failing to 
load into the browser.

Can you get a sense of what percentage of the time these errors occur?

Original comment by jmara...@google.com on 25 Sep 2014 at 8:24

GoogleCodeExporter commented 9 years ago
Sentry is a service used to collect error reports. Raven is the library used to 
catch and send the errors.

https://getsentry.com/welcome/
https://github.com/getsentry/raven-js

AFAIK Raven binds to window.onerror to catch all errors.

There has been 23 error reports in the last 20 hours from approx 3000 pageviews.

Original comment by Peta...@gmail.com on 25 Sep 2014 at 8:34

GoogleCodeExporter commented 9 years ago
0.6% error rate sounds a bit high.  Can you correlate those errors with 4xx or 
5xx errors on javascript files in your apache access.log?

If there was correlations that would give us a place to troubleshoot.  You 
might also check any proxies (Varnish etc).

I tried traceroute from the US on both www.inghamdriven.com and 
www.nzbgba.co.nz and they both are in New Zealand.  I'm not sure what 
implication that might have for fetches to time out.  If most of the traffic is 
also from New Zealand then it's probably a no-op.  But if you have some traffic 
from overseas maybe the distance helps increase the chances that some of the 
browser fetches wind up timing out.

Original comment by jmara...@google.com on 25 Sep 2014 at 10:20

GoogleCodeExporter commented 9 years ago
Looking up 1 IP it was from the US. I had a quick look at some logs but 
couldn't correlate and errors. 

I got sidetracked though. 

I will leave it over the weekend and if it keeps occurring. No errors have been 
reported for the last 13 hours. 

Original comment by Peta...@gmail.com on 26 Sep 2014 at 8:16

GoogleCodeExporter commented 9 years ago
Did you get anymore errors like this?

Original comment by jefftk@google.com on 5 Nov 2014 at 9:16

GoogleCodeExporter commented 9 years ago
Yes it is happening consistently, but I am just putting it down as transient 
connection issues. 

Original comment by Peta...@gmail.com on 5 Nov 2014 at 9:17