Open sverch opened 7 years ago
Also hitting this on vagrant:
* execute[bundle install] action run
================================================================================
Error executing action `run` on resource 'execute[bundle install]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '23'
---- Begin output of bundle install --path vendor/bundle ----
STDOUT: There was an error while trying to write to
`/home/vagrant/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions`.
It is likely that you need to grant write permissions for that path.
STDERR:
---- End output of bundle install --path vendor/bundle ----
Ran bundle install --path vendor/bundle returned 23
Resource Declaration:
---------------------
# In /home/vagrant/.chef/local-mode-cache/cache/cookbooks/newrelic_plugins/definitions/bundle_install.rb
8: execute 'bundle install' do
9: cwd params[:path]
10: if params[:user] == 'root'
11: command 'bundle install'
12: else
13: command 'bundle install --path vendor/bundle'
14: end
15: user params[:user]
Compiled Resource:
------------------
# Declared in /home/vagrant/.chef/local-mode-cache/cache/cookbooks/newrelic_plugins/definitions/bundle_install.rb:8:in `block in from_file'
execute("bundle install") do
params {:path=>"/opt/newrelic/newrelic_aws_cloudwatch_plugin", :user=>"vagrant", :name=>nil}
action [:run]
default_guard_interpreter :execute
command "bundle install --path vendor/bundle"
backup 5
cwd "/opt/newrelic/newrelic_aws_cloudwatch_plugin"
returns 0
user "vagrant"
declared_type :execute
cookbook_name "newrelic_plugins"
recipe_name "aws_cloudwatch"
domain nil
only_if { #code block }
end
System Info:
------------
chef_version=13.1.31
platform=ubuntu
platform_version=14.04
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
program_name=chef-client worker: ppid=16392;start=19:44:47;
executable=/opt/chef/bin/chef-client
The first output was because of the fact that chefdk by default uses the bundler that came with it rather than the system bundler. See https://github.com/chef/chef-dk/issues/16. The second issue is just a permissions issue that probably has to do with setting the path correctly. I'm using bundler 1.14.6
so I shouldn't be affected by https://github.com/bundler/bundler/issues/4521.
Merging in https://github.com/sverch/newrelic_plugins_chef/pull/3 fixed some of the issues with installing this plugin, but unfortunately when the script actually runs it still can't find the dependencies.
I believe this has to do with the fact that bundler uses sudo, but this plugin uses su.