Closed cheeseplus closed 5 years ago
Want to acknowledge that we've seen this one pop-up on our mailing list as well but so far nothing that we've been able to reproduce. As part of a broader refactoring I think we might inadvertently solve this moving some of our one-liner commands into scripts that the code consumes.
I have the same error when I try to run
chef-run XX.XX.XX.XX package ntp action=install
or
chef-run XX.XX.XX.XX my_receipe
The target host is a Ubuntu 18.04 x64 Digital Ocean droplet
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✖] Applying my_receipe::default from /Users/xxxxxxxxxxxxx to target.─ [✖] [xx.xx.xx.xx] The command 'bash -c 'd=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX);chmod 777 $d; echo $d'' exited with return code '2' on 'xx.xx.xx.xx'.
CHEFRMT001
The command 'bash -c 'd=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX); chmod 777 $d; echo $d''exited with return code '2' on 'xx.xx.xx.xx'.
The following error was reported:
bash: - : invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--rcfile
--restricted
--verbose
--version
Shell options:
-ilrsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
If you are not able to resolve this issue, please contact Chef support
at beta@chef.io
I'm using chef-run: 0.1.21
under macOS Mojave
I also have the same error. chef-run: 0.1.21
macos high sierra
I rolled back to version 0.1.18
, and it seems to have the same issue.
This is the output. I have redacted company information
chef-run -i /path/to/ssh/key some_ip_address /somepath/git/cookbook
[✔] Generating local policyfile... exporting... done!
[✖] Applying cookbook::default from /somepath/git/cookbook to target.
└── [✖] [target ip address] The command 'bash -c 'd=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX); chmod 777 $d; echo $d'' exited with return code '2' on 'someip'.
CHEFRMT001
The command 'bash -c 'd=$(mktemp -d -p${TMPDIR:-/tmp} chef_XXXXXX); chmod 777 $d; echo $d'' exited with return code '2' on 'someip'.
The following error was reported:
bash: - : invalid option
Usage: bash [GNU long option] [option] ...
bash [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--rpm-requires
--restricted
--verbose
--version
Shell options:
-irsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
If you are not able to resolve this issue, please contact Chef support
at beta@chef.io
I had the same issue with chef-run 0.1.21 against an Ubuntu 18.04 host (Digital Ocean). It seems to be related to sudo execution, since I was able to work around it with the following:
chef-run --user root --no-sudo cookbook
Thanks for the update @lingmann, that just might help us track this one down.
Hi, I'm the one who initially opened the problem and I have just tested with the latest chef-workstation version and it is solved for me.
Mac OS X 10.14.2 (macOS Mojave)
$ chef -v
Chef Workstation: 0.2.43
chef-run: 0.2.4
chef-client: 14.8.12
delivery-cli: master (5fb4908da53579c9dcf4894d4acf94d2d9ee6475)
berks: 7.0.7
test-kitchen: 1.24.0
inspec: 3.2.6
Digital Ocean droplet
Ubuntu 18.04 x64
$ chef-run -i ~/.ssh/github root@167.xxx.xxx.xxx package ntp action=install
[✔] Packaging cookbook... done!
[✔] Generating local policyfile... exporting... done!
[✔] Applying package[ntp] from resource to target.
└── [✔] [167.xxx.xxx.xxx] Successfully converged package[ntp].
So I guess that we can close this, or are you waiting on something else?
Description
EDIT: moving on behalf of @rbngzlv https://github.com/chef/chef-workstation/issues/230
When I run
chef-run
to test it, it outputs the following error:But the command doesn't throw an error if is executed manually on the target machine:
Chef Workstation Version
Platform Version
Chef Workstation is running on
OSX El Capitan 10.11.6
and the target machine is anUbuntu 14.04.5 LTS
I'm not sure if this the better place to report this, so if I have to do it somewhere else, tell me please.