Installing or updating any gem fails with "(Zlib::DataError) incorrect header check"

wmb's Avatar

wmb

07 Nov, 2011 08:51 PM

I had a very frustrating weekend.. I was unable to install or update any gems.

Every attempt to install or update a gem produced:

ERROR:  While executing gem ... (Zlib::DataError)
incorrect header check.

After eliminating every conceivable cause and following several wild goose chases, I eventually discovered that the rubygem mirrors had been miscategorized and blocked by a corporate web filter. I added some debugging that allowed me to see the url's and the issue became apparent.

http://production.cf.rubygems.org/quick/Marshal.4.8/rake-0.9.2.2.ge...

was being hijacked, and instead of rake-0.9.2.2.gemspec.rz, it was getting html to the effect of:

Content blocked by your organization
Reason:    This Websense category is filtered: Blogs and Personal Sites.
URL:    http://production.cf.rubygems.org/quick/Marshal.4.8/rake-0.9.2.2.gemspec.rz

So.. if you're having issues with gems, make sure the requests aren't being hijacked or magled by something..

It would also seem appropriate for gem to do some content verification before blindly sending to zlib. It would have been extremely helpful to know the returned content did not match the expected mime type, content length, and certainly didn't produce a correct hash.

  1. Nick Quaranto closed this discussion on 04 Aug, 2012 06:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

29 Aug, 2014 06:23 PM
28 Aug, 2014 07:18 PM
27 Aug, 2014 12:03 PM
26 Aug, 2014 07:09 PM
26 Aug, 2014 07:07 PM