-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
knife zero chef_clientを実行するとChef Clientへのsshに失敗する #13
Comments
コマンドラインオプションで、ユーザや鍵ファイルを明示的に指定してもこけますか? |
-xでユーザを明示的に指定しましたが同様にNGでした。 [@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x *** |
なら認証はパスワードですか? このオプションを付けたらどうなるでしょうか。
|
ありがとうございます。パスワードオプション付けたところSSHエラーは出なくなりました。 [@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x ***** --ssh-password XXXXXXXX |
おや、先にbootstrapしました? |
お手数をおかけしてすみません。2つ問題が判明し解決しました。 bootstrapおよびchef_clientの両方を一般ユーザのsudoで実行したところうまく動作しました。 まだ以下エラーが出てcookbookの実行ができていないのですが、cookbookの配置が悪いのかという気がしており、調べてみます。ありがとうございます。 |
あー、なるほど。それならそういう挙動になりそうです。 Cookbooksのパスですが、chef-zeroの仕様で
|
ありがとうございます。cookbookのpathが knife-soloとだいぶ勝手が違い戸惑ってしまいました。。 |
Berkshelf(またはlibrarian)で ではcloseしてもいいですかね? |
はい、closeでお願い致します。 |
お世話になります。
knife zero chef_clientを実行するとsshに失敗しています。
root@chefzero02.ec2.tokyo@chefzero02.ec2.tokyoと@が2つ続いて表示されるのがおかしいような気がしております。
以下実行結果
[**@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:'
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
WARNING: Failed to connect to chefzero02.ec2.tokyo -- Net::SSH::AuthenticationFailed: Authentication failed for user root@chefzero02.ec2.tokyo@chefzero02.ec2.tokyo
ERROR: knife encountered an unexpected error
This may be a bug in the 'zero chef client' knife command or plugin
Please collect the output of this command with the
-VV
option before filing a bug report.Exception: NoMethodError: undefined method `forward' for nil:NilClass
node list出力結果
[***@chefzero01 chef-repo]$ knife node list
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
chefzero02.ec2.tokyo
node情報
[***@chefzero01 chef-repo]$ knife node show chefzero02.ec2.tokyo
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
Node Name: chefzero02.ec2.tokyo
Environment: _default
FQDN: chefzero02.ec2.tokyo
IP: 153.120.25.197
Run List: recipe[lamp]
Roles:
Recipes:
Platform: centos 6.6
Tags:
デバッグ出力
[**@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:' -VV
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
INFO: Using configuration from /home/ookita/chef-repo/.chef/knife.rb
INFO: Started chef-zero at http://localhost:8889 with repository at /home/ookita/chef-repo
One version per cookbook
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to http://localhost:8889/search/node?q=name:_&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-REMOTE-REQUEST-ID: 20d69639-4c6e-4eb3-916e-e6dfafc1f8c6
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: #<ChefZero::RestRequest:0x0000000108b190 @env={"GATEWAY_INTERFACE"=>"CGI/1.1", "PATH_INFO"=>"/search/node", "QUERY_STRING"=>"q=name:_&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000", "REMOTE_ADDR"=>"::1", "REMOTE_HOST"=>"localhost", "REQUEST_METHOD"=>"GET", "REQUEST_URI"=>"http://localhost:8889/search/node?q=name:*&sort=X_CHEF_id_CHEF_X%20asc&start=0&rows=1000", "SCRIPT_NAME"=>"", "SERVER_NAME"=>"localhost", "SERVER_PORT"=>"8889", "SERVER_PROTOCOL"=>"HTTP/1.1", "SERVER_SOFTWARE"=>"WEBrick/1.3.1 (Ruby/2.0.0/2014-11-13) OpenSSL/1.0.1e", "HTTP_ACCEPT"=>"application/json", "HTTP_ACCEPT_ENCODING"=>"gzip;q=1.0,deflate;q=0.6,identity;q=0.3", "HTTP_X_REMOTE_REQUEST_ID"=>"20d69639-4c6e-4eb3-916e-e6dfafc1f8c6", "HTTP_X_CHEF_VERSION"=>"12.0.3", "HTTP_HOST"=>"localhost:8889", "HTTP_USER_AGENT"=>"Chef Knife/12.0.3 (ruby-2.0.0-p598; ohai-8.0.1; x86_64-linux; +http://opscode.com)", "HTTP_CONNECTION"=>"close", "rack.version"=>[1, 3], "rack.input"=>#StringIO:0x0000000101cdd0, "rack.errors"=>#IO:, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "rack.url_scheme"=>"http", "rack.hijack?"=>true, "rack.hijack"=>#<Proc:0x00000001021dd0@/usr/local/rvm/gems/ruby-2.0.0-p598/gems/rack-1.6.0/lib/rack/handler/webrick.rb:77 (lambda)>, "rack.hijack_io"=>nil, "HTTP_VERSION"=>"HTTP/1.1", "REQUEST_PATH"=>"/search/node"}, @rest_base_prefix=["organizations", "chef"]>
DEBUG:
DEBUG:
--- RESPONSE (200) ---
{
"rows": [
{
"name": "chefzero02.ec2.tokyo",
"normal": {
"tags": [
],
"start": 0,
"total": 1
}
--- END RESPONSE ---
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: content-type: application/json
DEBUG: server: chef-zero
DEBUG: access-control-allow-origin: *
DEBUG: date: Sun, 04 Jan 2015 13:30:28 GMT
DEBUG: content-length: 36585
DEBUG: connection: close
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: Content-Length validated correctly.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONToModelOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
DEBUG: Using node attribute 'fqdn' as the ssh target
DEBUG: Adding chefzero02.ec2.tokyo
DEBUG: establishing connection to chefzero02.ec2.tokyo:22
DEBUG: connection established
INFO: negotiating protocol version
DEBUG: remote is
SSH-2.0-OpenSSH_5.3' DEBUG: local is
SSH-2.0-Ruby/Net::SSH_2.9.1 x86_64-linux'DEBUG: read 840 bytes
DEBUG: received packet nr 0 type 20 len 836
INFO: got KEXINIT from server
INFO: sending KEXINIT
DEBUG: queueing packet nr 0 type 20 len 2020
DEBUG: sent 2024 bytes
INFO: negotiating algorithms
DEBUG: negotiated:
DEBUG: exchanging keys
DEBUG: queueing packet nr 1 type 34 len 20
DEBUG: sent 24 bytes
DEBUG: read 152 bytes
DEBUG: received packet nr 1 type 31 len 148
DEBUG: queueing packet nr 2 type 32 len 140
DEBUG: sent 144 bytes
DEBUG: read 720 bytes
DEBUG: received packet nr 2 type 33 len 700
DEBUG: queueing packet nr 3 type 21 len 20
DEBUG: sent 24 bytes
DEBUG: received packet nr 3 type 21 len 12
DEBUG: beginning authentication of
root' DEBUG: queueing packet nr 4 type 5 len 28 DEBUG: sent 52 bytes DEBUG: read 52 bytes DEBUG: received packet nr 4 type 6 len 28 DEBUG: trying none DEBUG: queueing packet nr 5 type 50 len 44 DEBUG: sent 68 bytes DEBUG: read 68 bytes DEBUG: received packet nr 5 type 51 len 44 DEBUG: allowed methods: publickey,password DEBUG: none failed DEBUG: trying publickey DEBUG: connecting to ssh-agent ERROR: could not connect to ssh-agent DEBUG: trying password ERROR: all authorization methods failed (tried none, publickey, password) WARNING: Failed to connect to chefzero02.ec2.tokyo -- Net::SSH::AuthenticationFailed: Authentication failed for user root@chefzero02.ec2.tokyo@chefzero02.ec2.tokyo DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/net-ssh-multi-1.2.0/lib/net/ssh/multi/server.rb:193:in
rescue in new_session'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/net-ssh-multi-1.2.0/lib/net/ssh/multi/server.rb:182:in
new_session' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/monkey_patches/net-ssh-multi.rb:79:in
next_session'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/net-ssh-multi-1.2.0/lib/net/ssh/multi/server.rb:138:in
session' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:19:in
block in ssh_command'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:18:in
each' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:18:in
ssh_command'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife/ssh.rb:514:in
run' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:417:in
block in run_with_pretty_exceptions'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/local_mode.rb:38:in
with_server_connectivity' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:416:in
run_with_pretty_exceptions'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:213:in
run' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/application/knife.rb:139:in
run'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/bin/knife:25:in
<top (required)>' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/bin/knife:23:in
load'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/bin/knife:23:in
<main>' DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in
eval'DEBUG: /usr/local/rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in
<main>' /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:20:in
block in ssh_command': undefined methodforward' for nil:NilClass (NoMethodError) from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:18:in
each'from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/knife-zero-1.1.2/lib/knife-zero/bootstrap_ssh.rb:18:in
ssh_command' from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife/ssh.rb:514:in
run'from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:417:in
block in run_with_pretty_exceptions' from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/local_mode.rb:38:in
with_server_connectivity'from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:416:in
run_with_pretty_exceptions' from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/knife.rb:213:in
run'from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/lib/chef/application/knife.rb:139:in
run' from /usr/local/rvm/gems/ruby-2.0.0-p598/gems/chef-12.0.3/bin/knife:25:in
<top (required)>'from /usr/local/rvm/gems/ruby-2.0.0-p598/bin/knife:23:in
load' from /usr/local/rvm/gems/ruby-2.0.0-p598/bin/knife:23:in
'from /usr/local/rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in
eval' from /usr/local/rvm/gems/ruby-2.0.0-p598/bin/ruby_executable_hooks:15:in
'以上、ご確認のほどよろしくお願い致します。
The text was updated successfully, but these errors were encountered: