sous-chefs/nodejs

Ark does not support xz by default when using nodejs_from_binary

tanner-bruce opened this issue · 6 comments

If the xz binary is not pre-installed nodejs_from_binary will fail with the following output:


55: ark archive_name do
56:   url nodejs_bin_url
57:   version node['nodejs']['version']
58:   checksum checksum
59:   has_binaries binaries
60:   action :install
61: end

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/nodejs/recipes/nodejs_from_binary.rb:55:in `from_file'

ark("nodejs-binary") do
action [:install]
updated true
updated_by_last_action true
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :ark
cookbook_name "nodejs"
recipe_name "nodejs_from_binary"
url "https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz"
version "6.9.1"
checksum "d4eb161e4715e11bbef816a6c577974271e2bddae9cf008744627676ff00036a"
has_binaries ["bin/node", "bin/npm"]
extension "tar.xz"
prefix_bin "/usr/local/bin"
prefix_root "/usr/local"
home_dir "/usr/local/nodejs-binary"
owner "root"
path "/usr/local/nodejs-binary-6.9.1"
release_file "/var/chef/cache/nodejs-binary-6.9.1.tar.xz"
end

Platform:
---------
x86_64-linux

[2017-02-16T18:39:45+00:00] INFO: Running queued delayed notifications before re-raising exception
[2017-02-16T18:39:45+00:00] ERROR: Running exception handlers
[2017-02-16T18:39:45+00:00] ERROR: Exception handlers complete
[2017-02-16T18:39:45+00:00] INFO: Sending resource update report (run-id: 9251770c-ac2f-4bd6-9d4a-b52696f4c3b3)
[2017-02-16T18:39:46+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-02-16T18:39:46+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-02-16T18:39:46+00:00] ERROR: ark[nodejs-binary] (nodejs::nodejs_from_binary line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[unpack /var/chef/cache/nodejs-binary-6.9.1.tar.xz] (/var/chef/cache/cookbooks/ark/providers/default.rb line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '2'
---- Begin output of /bin/tar xJf /var/chef/cache/nodejs-binary-6.9.1.tar.xz --strip-components=1 ----
STDOUT:
STDERR: tar (child): xz: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now
---- End output of /bin/tar xJf /var/chef/cache/nodejs-binary-6.9.1.tar.xz --strip-components=1 ----
Ran /bin/tar xJf /var/chef/cache/nodejs-binary-6.9.1.tar.xz --strip-components=1 returned 2
[2017-02-16T18:39:46+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

should be gz, not xz looks like a typo to me..

xz is not a typo.

your right, I did look back at newer releases, however I was installing a really old version, where there were no archives built using xz,

tas50 commented

What version of the ark cookbook are you running. 1.0+ should have xz support

tas50 commented

I'm realizing the design of the ark cookbook is pretty lacking here and I'm going to tackle that there, but for now I'm switched back to .tar.gz here since all the nodejs releases are still showing as .tar.gz

Thanks! I would agree the ark cookbook is lacking, it's functionality is non-obvious. We tend to use poise-archive for all things archive.