Hi community,
I am new to Chef.
When I execute the command chef generate cookbook motd
on Chef-DK running on RHEL 7 referring to Learning Chef issued by O’REILLY, some errors occurred as shown below. Seems like they are relevant to accessing Git. But I can see the child directories have been created (as you can see the end of this posting). Could someone advise what happened at the moment and if there was something I needed to do prior to executing the command? Are these errors negligible?
Here’s the version of Chef-DK,
chefdk-1.0.3-1.el7.x86_64
Thank you in advance!
-
Nakmark
[root@DEMOCHEFDK learningchef]# chef generate cookbook motd
Generating cookbook motd- Ensuring correct cookbook file content
- Committing cookbook files to git
================================================================================
Error executing actionrun
on resource ‘execute[git-commit-new-files]’Mixlib::ShellOut::ShellCommandFailed
Expected process to exit with [0], but received ‘128’
---- Begin output of git commit -m “Add generated cookbook content” ----
STDOUT:
STDERR: *** Please tell me who you are.Run
git config --global user.email "you@example.com"
git config --global user.name “Your Name”to set your account’s default identity.
Omit --global to set the identity only in this repository.fatal: unable to auto-detect email address (got ‘root@DEMOCHEFDK.(none)’)
---- End output of git commit -m “Add generated cookbook content” ----
Ran git commit -m “Add generated cookbook content” returned 128Resource Declaration:
In /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.0.3/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb
124: execute(“git-commit-new-files”) do
125: command(“git commit -m “Add generated cookbook content””)
126: cwd cookbook_dir
127: end
128: endCompiled Resource:
Declared in /opt/chefdk/embedded/lib/ruby/gems/2.3.0/gems/chef-dk-1.0.3/lib/chef-dk/skeletons/code_generator/recipes/cookbook.rb:124:in `from_file’
execute(“git-commit-new-files”) do
action [:run]
retries 0
retry_delay 2
default_guard_interpreter :execute
command "git commit -m “Add generated cookbook content”"
backup 5
cwd "/learningchef/motd"
returns 0
declared_type :execute
cookbook_name :code_generator
recipe_name "cookbook"
endPlatform:
x86_64-linux
ERROR: Chef failed to converge: execute[git-commit-new-files] (code_generator::cookbook line 124) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘128’
---- Begin output of git commit -m “Add generated cookbook content” ----
STDOUT:
STDERR: *** Please tell me who you are.Run
git config --global user.email "you@example.com"
git config --global user.name “Your Name”to set your account’s default identity.
Omit --global to set the identity only in this repository.fatal: unable to auto-detect email address (got ‘root@DEMOCHEFDK.(none)’)
---- End output of git commit -m “Add generated cookbook content” ----
Ran git commit -m “Add generated cookbook content” returned 128
Caused by: (Mixlib::ShellOut::ShellCommandFailed) execute[git-commit-new-files] (code_generator::cookbook line 124) had an error: Mixlib::ShellOut::ShellCommandFailed : Expected process to exit with [0], but received ‘128’
---- Begin output of git commit -m “Add generated cookbook content” ----
STDOUT:
STDERR: *** Please tell me who you are.Run
git config --global user.email "you@example.com"
git config --global user.name “Your Name”to set your account’s default identity.
Omit --global to set the identity only in this repository.fatal: unable to auto-detect email address (got ‘root@DEMOCHEFDK.(none)’)
---- End output of git commit -m “Add generated cookbook content” ----
Ran git commit -m “Add generated cookbook content” returned 128
[root@DEMOCHEFDK learningchef]# echo $?
1[root@DEMOCHEFDK motd]# ls -R
.:
Berksfile README.md chefignore metadata.rb recipes spec test./recipes:
default.rb./spec:
spec_helper.rb unit./spec/unit:
recipes./spec/unit/recipes:
default_spec.rb./test:
recipes./test/recipes:
default_test.rb