Skip to content

Instantly share code, notes, and snippets.

@maoueh
Last active August 29, 2015 14:08
Show Gist options
  • Save maoueh/5a21d106e13a6e6ba459 to your computer and use it in GitHub Desktop.
Save maoueh/5a21d106e13a6e6ba459 to your computer and use it in GitHub Desktop.
Resource execute rights problem (chef-apply recipe.rb)
[2014-11-03T10:19:02-05:00] WARN: Cloning resource attributes for group[user1] from prior resource (CHEF-3694)
[2014-11-03T10:19:02-05:00] WARN: Previous group[user1]: recipe.rb:1:in `run_chef_recipe'
[2014-11-03T10:19:02-05:00] WARN: Current group[user1]: recipe.rb:7:in `run_chef_recipe'
[2014-11-03T10:19:02-05:00] WARN: Cloning resource attributes for group[user2] from prior resource (CHEF-3694)
[2014-11-03T10:19:02-05:00] WARN: Previous group[user2]: recipe.rb:2:in `run_chef_recipe'
[2014-11-03T10:19:02-05:00] WARN: Current group[user2]: recipe.rb:13:in `run_chef_recipe'
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* group[user1] action create
- alter group group[user1]
- replace group members with new list of members
* group[user2] action create
- alter group group[user2]
- replace group members with new list of members
* user[user1] action create (up to date)
* user[user2] action create (up to date)
* group[user1] action modify
- modify group group[user1]
- add missing member(s): user1
* group[user2] action modify
- modify group group[user2]
- add missing member(s): user1, user2
* file[/tmp/testfile] action create (up to date)
* execute[user1 reads file with owner user2 and group user2 with mode 0440] action run
================================================================================
Error executing action `run` on resource 'execute[user1 reads file with owner user2 and group user2 with mode 0440]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of cat /tmp/testfile ----
STDOUT:
STDERR: cat: /tmp/testfile: Permission denied
---- End output of cat /tmp/testfile ----
Ran cat /tmp/testfile returned 1
Resource Declaration:
---------------------
# In recipe.rb
25: execute "user1 reads file with owner user2 and group user2 with mode 0440" do
26: command "cat /tmp/testfile"
27: user "user1"
28: group "user1"
29: end
Compiled Resource:
------------------
# Declared in recipe.rb:25:in `run_chef_recipe'
execute("user1 reads file with owner user2 and group user2 with mode 0440") do
action "run"
retries 0
retry_delay 2
guard_interpreter :default
command "cat /tmp/testfile"
backup 5
group "user1"
returns 0
user "user1"
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end
[2014-11-03T10:19:02-05:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-11-03T10:19:02-05:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[user1 reads file with owner user2 and group user2 with mode 0440] ((chef-apply cookbook)::(chef-apply recipe) line 25) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of cat /tmp/testfile ----
STDOUT:
STDERR: cat: /tmp/testfile: Permission denied
---- End output of cat /tmp/testfile ----
Ran cat /tmp/testfile returned 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment