Cookbooks uploaded to the Supermarket using knife cookbook site on OSX cause issues with Chef and Chef utilites, such as Berksfile. This is already documented in a few places:
Ultimately, the cause of the issue is that Minitar only supports POSIX tar, and doesn't support GNU, or, as is relevant to this issue, BSD tar. The cookbook-omnifetch gem is also vulnerable to this issue, as it, too, uses Minitar.
Here is an example of the issue as it occurs using chef install and TestKitchen:
Use chef install to fetch & install cookbook dependencies:
[birdsnest ~/pit/local/data/sis/git/cookbooks/cub_networking](CF-324-write-role-level-tests-for-vault-role|✚2…)[I]% kitchen destroy etc-networks-CUBoulder-rhel-7 && kitchen converge etc-networks-CUBoulder-rhel-7
-----> Starting Kitchen (v1.4.2)
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Destroying <etc-networks-CUBoulder-rhel-7>...
==> default: Running triggers before destroy...
==> default: Removing system from RHSM if it is registered.
==> default: Executing remote command "/usr/sbin/subscription-manager unregister"...
==> default: System has been unregistered.
==> default: Remote command execution finished.
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Vagrant instance <etc-networks-CUBoulder-rhel-7> destroyed.
Finished destroying <etc-networks-CUBoulder-rhel-7> (0m10.21s).
-----> Kitchen is finished. (0m11.42s)
-----> Starting Kitchen (v1.4.2)
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Using policyfile mode for chef-client
-----> Creating <etc-networks-CUBoulder-rhel-7>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'CUBoulder/rhel-7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'CUBoulder/rhel-7' is up to date...
==> default: Setting the name of the VM: kitchen-cub_networking-etc-networks-CUBoulder-rhel-7_default_1453227516160_79828
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Setting hostname...
==> default: Machine not provisioned because `--no-provision` is specified.
==> default: Running triggers after up...
==> default: Registering system to CU Boulder Satellite in the Vagrant Organization.
==> default: Executing remote command "rpm -Uvh http://redhat.colorado.edu/pub/katello-ca-consumer-latest.noarch.rpm && subscription-manager register --org 'vagrant' --activationkey 'vagrant'"...
==> default: Retrieving http://redhat.colorado.edu/pub/katello-ca-consumer-latest.noarch.rpm
==> default: Preparing... ########################################
==> default: Updating / installing...
==> default: katello-ca-consumer-redhat.colorado.ed########################################
==> default: The system has been registered with ID: dbea9fb3-6847-4d90-9e8d-ecba0175f567
==> default:
==> default: Installed Product Current Status:
==> default: Product Name: Red Hat Enterprise Linux Server
==> default: Status: Subscribed
==> default: Remote command execution finished.
[SSH] Established
Vagrant instance <etc-networks-CUBoulder-rhel-7> created.
Finished creating <etc-networks-CUBoulder-rhel-7> (0m56.79s).
-----> Converging <etc-networks-CUBoulder-rhel-7>...
Preparing files for transfer
Preparing dna.json
Preparing validation.pem
Preparing client.rb
-----> Installing Chef Omnibus (12.6.0)
Downloading https://www.chef.io/chef/install.sh to file /tmp/install.sh
Trying wget...
Download complete.
Getting information for chef stable 12.6.0 for el...
downloading https://omnitruck-direct.chef.io/stable/chef/metadata?v=12.6.0&p=el&pv=7&m=x86_64
to file /tmp/install.sh.9482/metadata.txt
trying wget...
url https://opscode-omnibus-packages.s3.amazonaws.com/el/7/x86_64/chef-12.6.0-1.el7.x86_64.rpm
md5 fe1ae43e8839a85a644305817004a21c
sha256 14557b1db3ee9bfc6072395de8d60bb8054c6cbdab9f2791e1ec9417970b6470
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/el/7/x86_64/chef-12.6.0-1.el7.x86_64.rpm
to file /tmp/install.sh.9482/chef-12.6.0-1.el7.x86_64.rpm
trying wget...
Comparing checksum with sha256sum...
Installing chef 12.6.0
installing with rpm...
warning: /tmp/install.sh.9482/chef-12.6.0-1.el7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 83ef826a: NOKEY
Preparing... ################################# [100%]
Updating / installing...
################################# [100%]
Thank you for installing Chef!
Transferring files to <etc-networks-CUBoulder-rhel-7>
Starting Chef Client, version 12.6.0
Creating a new client identity for etc-networks-CUBoulder-rhel-7 using the validator key.
Using policy 'cub_networking' at revision '162e1bf9aee9993656e7843678d6624fd5fd1db98c7c271aebe3babffd917776'
resolving cookbooks for run list: ["cub_networking::default@0.1.0 (57caef1)"]
Synchronizing Cookbooks:
- cub_networking (24711451235043958.56818798010675261.93701136206914)
================================================================================
Error Syncing Cookbooks:
================================================================================
Running handlers:
[2016-01-19T18:20:03+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-01-19T18:20:03+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 01 seconds
[2016-01-19T18:20:03+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
[2016-01-19T18:20:03+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-01-19T18:20:03+00:00] ERROR: 404 "Not Found"
[2016-01-19T18:20:04+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
>>>>>> Converge failed on instance <etc-networks-CUBoulder-rhel-7>.
>>>>>> Please see .kitchen/logs/etc-networks-CUBoulder-rhel-7.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: SSH exited (1) for command: [sh -c '
sudo -E /opt/chef/bin/chef-client --local-mode --config /tmp/kitchen/client.rb --log_level auto --force-formatter --no-color --chef-zero-port 8889
']
>>>>>> ----------------------
zlib(finalizer): the stream was freed prematurely.
One solution is to remove directories named "PaxHeader" after unpacking a cookbook with Minitar. Another solution is to abandon Minitar.
Cookbooks uploaded to the Supermarket using
knife cookbook site
on OSX cause issues with Chef and Chef utilites, such as Berksfile. This is already documented in a few places:Ultimately, the cause of the issue is that Minitar only supports POSIX tar, and doesn't support GNU, or, as is relevant to this issue, BSD tar. The cookbook-omnifetch gem is also vulnerable to this issue, as it, too, uses Minitar.
Here is an example of the issue as it occurs using
chef install
and TestKitchen:Use
chef install
to fetch & install cookbook dependencies:This creates a number of "PaxHeader" directories, because
network_interfaces_v2
was uploaded from OSX:Which, in turn, causes TestKitchen to fail:
One solution is to remove directories named "PaxHeader" after unpacking a cookbook with Minitar. Another solution is to abandon Minitar.