openlibrary.org/stats is serving insecure content from graphite.us.archive.org
charts/graphs on openlibrary.org/stats are not displaying due to what appears to be a javascript error:
jquery-migrate.js:1 Possible Unhandled Promise Rejection: ReferenceError: insertSteps is not defined
at graphs.bcd36affe16d84907807.js:7
at S (graphs.bcd36affe16d84907807.js:7)
at new o (graphs.bcd36affe16d84907807.js:7)
at Function.e.plot (graphs.bcd36affe16d84907807.js:7)
at a (graphs.bcd36affe16d84907807.js:2)
at graphs.bcd36affe16d84907807.js:2
at r (graphs.bcd36affe16d84907807.js:2)
at a (graphs.bcd36affe16d84907807.js:2)
at Module.l (graphs.bcd36affe16d84907807.js:2)
at jquery-migrate.js:1
but even if that error was resolved I do not believe modern browsers would display the content as it is coming over an insecure connection from graphite.us.archive.org
I may very well be wrongly putting two separate bugs into a single issue but I thought there was a slight chance the resolution of the SSL cert issue may also resolve the javascript error. So here we are with one issue until the gods decide otherwise.
Evidence / Screenshot (if possible)

Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure element '<URL>'. This request was automatically upgraded to HTTPS, For more information see <URL>
stats:4 Mixed Content: The page at 'https://openlibrary.org/stats' was loaded over HTTPS, but requested an insecure element 'http://graphite.us.archive.org/render/?min=0&template=plain&lineMode=staircase&areaMode=stacked&areaAlpha=0.5&yAxisSide=right&title=openlibrary+++Unique+IPs+per+day+++(uip_openlibrary)&hideLegend=true&target=cactiStyle(alias(summarize(sumSeries(group(stats.uniqueips.openlibrary)),%221day%22),%22openlibrary+++Unique+IPs+per+day+++(uip_openlibrary)%22))&colorList=00ff00&height=200&width=900&from=-60days'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html
Relevant url?
openlibrary.org/stats graphite.us.archive.org
Steps to Reproduce
- using open openlibrary.org/stats
- notice a lack of charts/graphs
Details
- Chrome Version 86.0.4240.75 (Official Build) (64-bit)
- Windows 10
- prod
@perryjr -- this is very timely, I was talking to @jamesachamp about this issue today. Thank you for creating an issue and providing so much description.
I think you're right that we may be conflating 2 issues here -- because on the bottom of the homepage, I don't believe we're making any calls to graphite and yet the graphs at the bottom of the homepage seem not to render.
@jdlrobson is this something you may have 5 minutes to investigate (if the answer looks obvious to you?)
cc: @jamesachamp + @cdrini + @jdlrobson
One thing we may want to test is changing these urls to http to see if that resolves some of our issues (or we can possibly proxy them through Open Library and request.get() them.
The mixed content is not why the graphs are not showing. There is a very obvious JS error inside the vendor JS which will not run in strict mode. ReferenceError: assignment to undeclared variable insertSteps. Looking at the code there is no variable declaration but the file hasn't been touched since 2011 so this has been broken for some time.
Did you recently merge a patch that started loaded jquery.flot or changed how it loaded or start to use strict ? that would likely lead to the breakage of the graphs themselves. I've not been following changes to the JS or this page so I'm not sure when this happened but unmaintained JS is never a good thing, I'd recommend throwing out jquery.flot for something new.
The mixed content is not good but is not why the graphs are not showing but very easy to fix - I've sent #3933 for you - hope that's helpful.
graphite.us.archive.org/ doesn't support https. That needs to be fixed first by installing the right certificates etc. You'll need to talk to someone in ops.
Note: These images are full not-displaying on Chrome, but are displayed (with a little warning) on FF.
Yes I noted this in https://github.com/internetarchive/openlibrary/pull/3933#issuecomment-711103143 and https://github.com/internetarchive/openlibrary/issues/3924#issuecomment-711103207 an associated ops change is needed
It's arguably worse to load http over https but this is a security trade off.
This has been fixed; the endpoint now supports https! Thanks to @traceypooh &co