Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore PaxHeader subfolder from tar archives #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zuazo
Copy link
Contributor

@zuazo zuazo commented Sep 14, 2014

Some tar archives from community site can include a subfolder named PaxHeader, which will cause the following error:

librarian/chef/source/site.rb:309:in `unpack_package!': The package archive has too many children! (RuntimeError)

How to reproduce

Use the following Cheffile to download a cookbook with this header:

#!/usr/bin/env ruby
#^syntax detection

site 'https://supermarket.getchef.com/api/v1'

cookbook 'zookeeper'
$ librarian-chef update

Full Exception

~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:309:in `unpack_package!': The package archive has too many children! (RuntimeError)
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:224:in `cache_version_uri_unpacked!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:93:in `block in version_uri_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:381:in `memo'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:92:in `version_uri_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:88:in `version_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:54:in `version_dependencies'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/lib/librarian/chef/source/site.rb:462:in `fetch_dependencies'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/manifest.rb:125:in `fetch_dependencies!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/manifest.rb:117:in `fetched_dependencies'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/manifest.rb:81:in `dependencies'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:117:in `block in check_manifest_for_cycles'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:117:in `each'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:117:in `map'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:117:in `check_manifest_for_cycles'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:64:in `block in recursive_resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:154:in `block (3 levels) in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:187:in `block in scope_checking_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:186:in `scope_checking_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:153:in `block (2 levels) in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:211:in `block in map_find'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `each'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `map_find'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `block in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `block (2 levels) in scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `block in scope_checking_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `block in scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:70:in `block in recursive_resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:154:in `block (3 levels) in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:187:in `block in scope_checking_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:186:in `scope_checking_manifest'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:153:in `block (2 levels) in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:211:in `block in map_find'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `each'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `map_find'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `block in resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `block (2 levels) in scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `block in scope_checking_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `block in scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:50:in `resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/resolver.rb:23:in `resolve'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/action/resolve.rb:26:in `run'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:169:in `resolve!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:113:in `update'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block (2 levels) in bin!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `block in bin!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/gems/librarian-chef-0.0.4/bin/librarian-chef:7:in `<top (required)>'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/bin/librarian-chef:23:in `load'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/bin/librarian-chef:23:in `<main>'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/bin/ruby_executable_hooks:15:in `eval'
        from ~/.rvm/gems/ruby-2.0.0-p481@chef-dev/bin/ruby_executable_hooks:15:in `<main>'

@tkrueger
Copy link

Just ran into this, too. Currently operating from a fork. Any plans regarding if/when this will be merged?

@ianbamforth
Copy link

+1 for merging this, I'm also operating from a patch now. Preventing install of zookeeper cookbook.

@adamb0mb
Copy link

+1

@patoarvizu
Copy link

+1 I'm having trouble installing the nagios cookbook, which depends on zap because of this.

@adamb0mb
Copy link

I actually ended up forking and taking this pull request.

https://github.com/payscale/librarian-chef

@vtintillier
Copy link

@yfeldblum @zuazo Any chance this PR can be accepted and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants