evertrue / zookeeper-cookbook

Chef cookbook for installing and managing Zookeeper.
https://supermarket.chef.io/cookbooks/zookeeper
Apache License 2.0
81 stars 117 forks source link

zookeeper-3.5.3-beta artifact breaks due to (lack of) gzip compression #206

Closed strong-code closed 4 years ago

strong-code commented 7 years ago

This is more of a "heads up" than an issue with this cookbook, per se. The latest release of ZK zookeeper-3.5.3-beta was improperly released to distribution channels. The artifact is labeled as zookeeper-3.5.3-beta.tar.gz but it is not actually a gzipped archive:

chl @ ~/Desktop ⤳  file zookeeper-3.5.3-beta.tar.gz 
zookeeper-3.5.3-beta.tar.gz: POSIX tar archive

This causes the ark resource to fail when attempting to gunzip/unpack since it always expects a properly gzipped archive here: https://github.com/evertrue/zookeeper-cookbook/blob/master/resources/default.rb#L70

Which can be replicated as such:

/bin/tar xzf /var/chef/cache/zookeeper-3.5.3-beta.tar.gz

gzip: stdin: not in gzip format
/bin/tar: Child returned status 1

The Apache team is aware of this but they don't seem to be prioritizing fixing the existing beta release: https://issues.apache.org/jira/browse/ZOOKEEPER-2885

I hope this issue prevents others from banging their head against a wall in the future like I did!

jeffbyrnes commented 7 years ago

Thanks for sharing that, @strong-code. We’ll leave this open for a while so others might spot it!

strong-code commented 7 years ago

And as a temporary workaround, we self-hosted our own archive.

  1. Download the zookeeper-3.5.3-beta.tar.gz from one of the official mirrors, but remove the .gz ending for the archive.
  2. gzip zookeeper-3.5.3-beta.tar locally to create a properly compressed archive
  3. Create a publicly-accessible AWS S3 bucket with a folder named zookeeper-3.5.3-beta inside of it, then upload your properly gzipped archive to the folder. Make sure the archive is publicly accessible. The path should now look like https://s3.amazonaws.com/<your bucket name>/zookeeper-3.5.3-beta/zookeeper-3.5.3-beta.tar.gz
  4. You can now change the install resource to use your AWS S3 mirror like so:
zookeeper '3.5.3-beta' do
  mirror 'https://s3.amazonaws.com/<your bucket name>'
end

Hope this helps!

jeffbyrnes commented 4 years ago

Solved with v13.0.0