0

我对宝石刀独奏有疑问。首先,我想解释我的错误并对此进行调查。

首先,在我之后knife solo cook。我遇到了运行时错误。

RuntimeError: Couldn't find Chef >=0.10.4 on myhost. Please run `knife solo prepare root@myhost` to ensure Chef is installed and up to date.

然后我在谷歌叔叔中搜索:-D 我找到了这种方式链接

这是我的错误来自`knife solo cook root@myhost -VV

$ knife solo cook root@ipaddress  -c solo.rb -i /Users/me/Documents/WORK/project/certificate.pem -VV
Starting 'Run'
Checking Chef version...
Enter the password for root@ipaddress:
DEBUG: Initial command sudo chef-solo --version
DEBUG: Initial command sudo -V
DEBUG: Running processed command sudo -V
DEBUG: sudo -V stdout: Sudo version 1.8.3p1
Configure options: --prefix=/usr -v --with-all-insults --with-pam --with-fqdn --with-logging=syslog --with-logfac=authpriv --with-env-editor --with-editor=/usr/bin/editor --with-timeout=15 --with-password-timeout=0 --with-passprompt=[sudo] password for %p:  --without-lecture --with-tty-tickets --disable-root-mailer --enable-admin-flag --with-sendmail=/usr/sbin/sendmail --with-timedir=/var/lib/sudo --mandir=/usr/share/man --libexecdir=/usr/lib/sudo

DEBUG: sudo -V stdout: Sudoers policy plugin version 1.8.3p1
Sudoers file grammar version 40

Sudoers path: /etc/sudoers

DEBUG: sudo -V stdout: Authentication methods: 'pam'
Syslog facility if syslog is being used for logging: authpriv

DEBUG: sudo -V stdout: Syslog priority to use when user authenticates successfully: notice
Syslog priority to use when user authenticates unsuccessfully: alert
Send mail if user authentication fails
Send mail if the user is not in sudoers

DEBUG: sudo -V stdout: Use a separate timestamp for each user/tty combo
Lecture user the first time they run sudo
Require users to authenticate by default
Root may run sudo
Allow some information gathering to give useful error messages
Require fully-qualified hostnames in the sudoers file

DEBUG: sudo -V stdout: Visudo will honor the EDITOR environment variable
Set the LOGNAME and USER environment variables

DEBUG: sudo -V stdout: Length at which to wrap log file lines (0 for no wrap): 80

DEBUG: sudo -V stdout: Authentication timestamp timeout: 15.0 minutes
Password prompt timeout: 0.0 minutes

DEBUG: sudo -V stdout: Number of tries to enter a password: 3
Umask to use or 0777 to use user's: 022

DEBUG: sudo -V stdout: Path to mail program: /usr/sbin/sendmail
Flags for mail program: -t

DEBUG: sudo -V stdout: Address to send mail to: root
Subject line for mail messages: *** SECURITY information for %h ***
Incorrect password message: Sorry, try again.
Path to authentication timestamp dir: /var/lib/sudo

DEBUG: sudo -V stdout: Default password prompt: [sudo] password for %p:
Default user to run commands as: root
Value to override user's $PATH with: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

DEBUG: sudo -V stdout: Path to the editor for use by visudo: /usr/bin/editor
When to require a password for 'list' pseudocommand: any
When to require a password for 'verify' pseudocommand: all

DEBUG: sudo -V stdout: File descriptors >= 3 will be closed before executing a command

DEBUG: sudo -V stdout: Reset the environment to a default set of variables

DEBUG: sudo -V stdout: Environment variables to check for sanity:
     TERM
DEBUG: sudo -V stdout:
     LINGUAS
DEBUG: sudo -V stdout:
     LC_*

DEBUG: sudo -V stdout:      LANGUAGE

DEBUG: sudo -V stdout:      LANG

DEBUG: sudo -V stdout:      COLORTERM

DEBUG: sudo -V stdout: Environment variables to remove:
     RUBYOPT

DEBUG: sudo -V stdout:      RUBYLIB
     PYTHONUSERBASE

DEBUG: sudo -V stdout:      PYTHONINSPECT
     PYTHONPATH

DEBUG: sudo -V stdout:      PYTHONHOME

DEBUG: sudo -V stdout: TMPPREFIX
     ZDOTDIR
DEBUG: sudo -V stdout:
     READNULLCMD

DEBUG: sudo -V stdout:      NULLCMD
     FPATH
DEBUG: sudo -V stdout:
     PERL5DB

DEBUG: sudo -V stdout:      PERL5OPT
     PERL5LIB

DEBUG: sudo -V stdout:      PERLLIB
     PERLIO_DEBUG

DEBUG: sudo -V stdout:      JAVA_TOOL_OPTIONS
DEBUG: sudo -V stdout:
     SHELLOPTS

DEBUG: sudo -V stdout:      GLOBIGNORE
DEBUG: sudo -V stdout:
     PS4
DEBUG: sudo -V stdout:
     BASH_ENV

DEBUG: sudo -V stdout:      ENV

DEBUG: sudo -V stdout: TERMCAP

DEBUG: sudo -V stdout:      TERMPATH
     TERMINFO_DIRS

DEBUG: sudo -V stdout:      TERMINFO
DEBUG: sudo -V stdout:
     _RLD*

DEBUG: sudo -V stdout:      LD_*
     PATH_LOCALE

DEBUG: sudo -V stdout:      NLSPATH
     HOSTALIASES
     RES_OPTIONS

DEBUG: sudo -V stdout: LOCALDOMAIN
     CDPATH

DEBUG: sudo -V stdout:      IFS
Environment variables to preserve:

DEBUG: sudo -V stdout:      XAUTHORIZATION

DEBUG: sudo -V stdout:      XAUTHORITY

DEBUG: sudo -V stdout: TZ

DEBUG: sudo -V stdout:      PS2
     PS1
DEBUG: sudo -V stdout:
     PATH

DEBUG: sudo -V stdout:      LS_COLORS
     KRB5CCNAME
DEBUG: sudo -V stdout:
     HOSTNAME

DEBUG: sudo -V stdout:      HOME
     DISPLAY
DEBUG: sudo -V stdout:
     COLORS

DEBUG: sudo -V stdout: Locale to use while parsing sudoers: C

DEBUG: sudo -V stdout: Directory in which to store input/output logs

DEBUG: sudo -V stdout: File in which to store the input/output log

DEBUG: sudo -V stdout: Add an entry to the utmp/utmpx file when allocating a pty


DEBUG: sudo -V stdout: Local IP address and netmask pairs:

DEBUG: sudo -V stdout:      ipaddress/255.255.255.0

DEBUG: sudo -V stdout: fe80::250:56ff:feb0:1934/ffff:ffff:ffff:ffff::


DEBUG: sudo -V stdout: Sudoers I/O plugin version 1.8.3p1

DEBUG: Running processed command sudo -p 'knife sudo password: ' chef-solo --version
DEBUG: sudo -p 'knife sudo password: ' chef-solo --version stdout: sudo: chef-solo: command not found

/usr/local/rvm/gems/ruby-1.9.3-p392/gems/knife-solo-0.2.0/lib/chef/knife/solo_cook.rb:161:in 'check_chef_version': Couldn't find Chef >=0.10.4 on ipaddress. Please run knife solo prepare root@ipaddress -i /Users/me/Documents/WORK/project/certificate.pem' to ensure Chef is installed and up to date. (RuntimeError)
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/knife-solo-0.2.0/lib/chef/knife/solo_cook.rb:63:in 'block in run'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/knife-solo-0.2.0/lib/chef/knife/solo_cook.rb:122:in 'time'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/knife-solo-0.2.0/lib/chef/knife/solo_cook.rb:55:in 'run'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/chef-11.12.8/lib/chef/knife.rb:492:in 'run_with_pretty_exceptions'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/chef-11.12.8/lib/chef/knife.rb:174:in 'run'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/chef-11.12.8/lib/chef/application/knife.rb:135:in 'run'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/gems/chef-11.12.8/bin/knife:25:in '<top (required)>'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/knife:19:in 'load'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/knife:19:in '<main>'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in 'eval'
     from /usr/local/rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in '<main>’ 

所以决定添加它--no-chef-check,我没有收到“找不到厨师”的错误。我测试它有这个错误

 $knife solo cook root@ipaddress  -c solo.rb -i /Users/me/Documents/WORK/project/certificate.pem --no-chef-check
Enter the password for root@ipaddress:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/me/Documents/WORK/project/certificate.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/me/Documents/WORK/project/certificate.pem
root@ipaddress's password:

Permission denied, please try again.
root@ipaddress's password:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/me/Documents/WORK/project/certificate.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/me/Documents/WORK/project/certificate.pem
root@ipaddress's password:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/me/Documents/WORK/project/certificate.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/me/Documents/WORK/project/certificate.pem
root@ipaddress's password:
sudo: chef-solo: command not found
ERROR: RuntimeError: chef-solo failed. See output above.
4

1 回答 1

0

pen文件的权限必须为600(只有文件所有者可读可写)

所以你应该跑

sudo chmod 600 /Users/me/Documents/WORK/project/certificate.pem

一切都会好起来的。

于 2014-08-29T12:36:16.750 回答