Skip to content
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

Closed
nagi2100 opened this issue Jan 4, 2015 · 10 comments
Closed

Comments

@nagi2100
Copy link

nagi2100 commented Jan 4, 2015

お世話になります。
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": [

    ]
  },
  "automatic": {
    "keys": {
      "ssh": {
        "host_dsa_public": "AAAAB3NzaC1kc3MAAACBAJlSiOAFh/5Qit6EW6GvOUoKCORUq1SiHHNjcVKGforPlmbzfqdqr7hN/5T6DuwWFgTjZJktDfmUzK4SEAdmMcpvi9s/0E7wRfKFGwSybM34YlODTfcHmyYJU1lfaSmuuAQ/CZwCPYwTpzCqRmjqOw4cW0wpf8SJR+tRiqbTbA/jAAAAFQDnPPLs4cbcZTQQUsdfv1SJegRLvwAAAIBgJE+/2c+s9QoxKeV7UA8yUDtkjSy5NkUe6lKW9GT+uYsspgBFVYSD/b1JDHZQxkXlRfllQ96lwShs87pvU7z50im4RsQRxxRytAuHsjAyE7aYbgj8XDJa55X5+Z+1oh7pIa7acd8uenZc91OXUvjw/nP+1BwCdZnevMCLn0eVawAAAIBHeHqqlr+wBt/jKpVmSB6Xq42/wlLgAWq02AAw551XqplyQwC0KgYHXcR6QP2kAZraIqu6PmMfw8IJuN/kGIL1n00uk7i2Gg4se6tGAyFLXFsATwAYO5MFsdeV5mRHsW/O5k/GUm6lWtxl8CLrcOtSTVJ915ER0hfrM76UFtSk6w==",
        "host_rsa_public": "AAAAB3NzaC1yc2EAAAABIwAAAQEA2Ye3DJ5t8b3ChtCt7TkSAwfucsku4JBlP9ap/ARtVPFymPMngWNc39rbY6X9KMSGTjYku5rRQQS/XGMcTQMvLJKCYuvpoZKDYbM6iUTRZQ9JE02RYObIWianfpatwoBDdocEBkAwKdQr7OImZ/gMDSKOlEMtjQmB99vhFkFqk2ijLFyad1r9vXB3tsKTXrr+Ht1UsnaO4p9TcsLa/3qgXOzJEWfy9pjRvfXfgDlZpCWK37Wh7UffEHIUXWzYoyfdtROiq09kZGpHuligE3nKzVX0e2WbRBAhVj6RPEn5o+OceqlDyBExih1odSZiUVz/N6enawQ9NXMcM/UoKP/fVQ=="
      }
    },
    "kernel": {
      "name": "Linux",
      "release": "2.6.32-504.1.3.el6.x86_64",
      "version": "#1 SMP Tue Nov 11 17:57:25 UTC 2014",
      "machine": "x86_64",
      "os": "GNU/Linux",
      "modules": {
        "ipt_REJECT": {
          "size": "2351",
          "refcount": "0"
        },
        "iptable_filter": {
          "size": "2793",
          "refcount": "1"
        },
        "ip_tables": {
          "size": "17831",
          "refcount": "1"
        },
        "ipv6": {
          "size": "334932",
          "refcount": "20"
        },
        "virtio_balloon": {
          "size": "4798",
          "refcount": "0"
        },
        "virtio_net": {
          "size": "22438",
          "refcount": "0"
        },
        "i2c_piix4": {
          "size": "11776",
          "refcount": "0"
        },
        "i2c_core": {
          "size": "29964",
          "refcount": "1"
        },
        "sg": {
          "size": "29318",
          "refcount": "0"
        },
        "ext4": {
          "size": "378476",
          "refcount": "1"
        },
        "jbd2": {
          "size": "93427",
          "refcount": "1"
        },
        "mbcache": {
          "size": "8193",
          "refcount": "1"
        },
        "virtio_blk": {
          "size": "7132",
          "refcount": "3"
        },
        "sr_mod": {
          "size": "15049",
          "refcount": "0"
        },
        "cdrom": {
          "size": "39085",
          "refcount": "1"
        },
        "virtio_pci": {
          "size": "7348",
          "refcount": "0"
        },
        "virtio_ring": {
          "size": "9115",
          "refcount": "4"
        },
        "virtio": {
          "size": "4977",
          "refcount": "4"
        },
        "pata_acpi": {
          "size": "3701",
          "refcount": "0"
        },
        "ata_generic": {
          "size": "3837",
          "refcount": "0"
        },
        "ata_piix": {
          "size": "24409",
          "refcount": "0"
        },
        "dm_mirror": {
          "size": "14384",
          "refcount": "0"
        },
        "dm_region_hash": {
          "size": "12085",
          "refcount": "1"
        },
        "dm_log": {
          "size": "9930",
          "refcount": "2"
        },
        "dm_mod": {
          "size": "95622",
          "refcount": "2"
        }
      }
    },
    "network": {
      "interfaces": {
        "lo": {
          "mtu": "65536",
          "flags": [
            "LOOPBACK",
            "UP",
            "LOWER_UP"
          ],
          "encapsulation": "Loopback",
          "addresses": {
            "127.0.0.1": {
              "family": "inet",
              "prefixlen": "8",
              "netmask": "255.0.0.0",
              "scope": "Node"
            },
            "::1": {
              "family": "inet6",
              "prefixlen": "128",
              "scope": "Node"
            }
          },
          "state": "unknown",
          "routes": [
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            },
            {
              "destination": "unreachable",
              "family": "inet6",
              "metric": "1024"
            }
          ]
        },
        "eth0": {
          "type": "eth",
          "number": "0",
          "mtu": "1500",
          "flags": [
            "BROADCAST",
            "MULTICAST",
            "UP",
            "LOWER_UP"
          ],
          "encapsulation": "Ethernet",
          "addresses": {
            "9C:A3:BA:25:5F:9B": {
              "family": "lladdr"
            },
            "153.120.25.197": {
              "family": "inet",
              "prefixlen": "24",
              "netmask": "255.255.255.0",
              "broadcast": "153.120.25.255",
              "scope": "Global"
            },
            "fe80::9ea3:baff:fe25:5f9b": {
              "family": "inet6",
              "prefixlen": "64",
              "scope": "Link"
            }
          },
          "state": "up",
          "arp": {
            "153.120.25.1": "00:00:0c:9f:f0:01"
          },
          "routes": [
            {
              "destination": "153.120.25.0/24",
              "family": "inet",
              "scope": "link",
              "proto": "kernel",
              "src": "153.120.25.197"
            },
            {
              "destination": "169.254.0.0/16",
              "family": "inet",
              "scope": "link",
              "metric": "1002"
            },
            {
              "destination": "default",
              "family": "inet",
              "via": "153.120.25.1"
            },
            {
              "destination": "fe80::/64",
              "family": "inet6",
              "metric": "256",
              "proto": "kernel"
            }
          ]
        }
      },
      "default_interface": "eth0",
      "default_gateway": "153.120.25.1"
    },
    "counters": {
      "network": {
        "interfaces": {
          "lo": {
            "rx": {
              "bytes": "62603",
              "packets": "86",
              "errors": "0",
              "drop": "0",
              "overrun": "0"
            },
            "tx": {
              "bytes": "62603",
              "packets": "86",
              "errors": "0",
              "drop": "0",
              "carrier": "0",
              "collisions": "0"
            }
          },
          "eth0": {
            "tx": {
              "queuelen": "1000",
              "bytes": "867605",
              "packets": "12417",
              "errors": "0",
              "drop": "0",
              "carrier": "0",
              "collisions": "0"
            },
            "rx": {
              "bytes": "47839871",
              "packets": "94621",
              "errors": "0",
              "drop": "0",
              "overrun": "0"
            }
          }
        }
      }
    },
    "ipaddress": "153.120.25.197",
    "macaddress": "9C:A3:BA:25:5F:9B",
    "languages": {
      "lua": {
        "version": "5.1.4"
      },
      "python": {
        "version": "2.6.6",
        "builddate": "Jan 22 2014, 09:42:36"
      },
      "perl": {
        "version": "5.10.1",
        "archname": "x86_64-linux-thread-multi"
      },
      "ruby": {
        "platform": "x86_64-linux",
        "version": "2.1.4",
        "release_date": "2014-10-27",
        "target": "x86_64-unknown-linux-gnu",
        "target_cpu": "x86_64",
        "target_vendor": "unknown",
        "target_os": "linux",
        "host": "x86_64-unknown-linux-gnu",
        "host_cpu": "x86_64",
        "host_os": "linux-gnu",
        "host_vendor": "unknown",
        "bin_dir": "/opt/chef/embedded/bin",
        "ruby_bin": "/opt/chef/embedded/bin/ruby",
        "gems_dir": "/opt/chef/embedded/lib/ruby/gems/2.1.0",
        "gem_bin": "/opt/chef/embedded/bin/gem"
      },
      "c": {
        "gcc": {
          "version": "4.4.7",
          "description": "gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) "
        },
        "glibc": {
          "version": "2.12",
          "description": "GNU C Library stable release version 2.12, by Roland McGrath et al."
        }
      }
    },
    "virtualization": {
      "systems": {

      }
    },
    "os": "linux",
    "os_version": "2.6.32-504.1.3.el6.x86_64",
    "lsb": {

    },
    "platform": "centos",
    "platform_version": "6.6",
    "platform_family": "rhel",
    "chef_packages": {
      "chef": {
        "version": "12.0.3",
        "chef_root": "/opt/chef/embedded/apps/chef/lib"
      },
      "ohai": {
        "version": "8.0.1",
        "ohai_root": "/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/ohai-8.0.1/lib/ohai"
      }
    },
    "cloud_v2": null,
    "cpu": {
      "0": {
        "vendor_id": "GenuineIntel",
        "family": "6",
        "model": "44",
        "model_name": "Intel(R) Xeon(R) CPU           X5675  @ 3.07GHz",
        "stepping": "2",
        "mhz": "3066.740",
        "cache_size": "4096 KB",
        "physical_id": "0",
        "core_id": "0",
        "cores": "1",
        "flags": [
          "fpu",
          "vme",
          "de",
          "pse",
          "tsc",
          "msr",
          "pae",
          "mce",
          "cx8",
          "apic",
          "mtrr",
          "pge",
          "mca",
          "cmov",
          "pat",
          "pse36",
          "clflush",
          "mmx",
          "fxsr",
          "sse",
          "sse2",
          "ss",
          "syscall",
          "nx",
          "lm",
          "constant_tsc",
          "up",
          "unfair_spinlock",
          "pni",
          "pclmulqdq",
          "ssse3",
          "cx16",
          "sse4_1",
          "sse4_2",
          "popcnt",
          "aes",
          "hypervisor",
          "lahf_lm"
        ]
      },
      "total": 1,
      "real": 1
    },
    "filesystem": {
      "/dev/vda2": {
        "kb_size": "16376928",
        "kb_used": "1619564",
        "kb_available": "13918804",
        "percent_used": "11%",
        "mount": "/",
        "total_inodes": "1048576",
        "inodes_used": "70700",
        "inodes_available": "977876",
        "inodes_percent_used": "7%",
        "fs_type": "ext4",
        "mount_options": [
          "rw"
        ],
        "uuid": "2a4a8b1b-fa41-4e94-b168-a2ab3b07cff9"
      },
      "tmpfs": {
        "kb_size": "510164",
        "kb_used": "0",
        "kb_available": "510164",
        "percent_used": "0%",
        "mount": "/dev/shm",
        "total_inodes": "127541",
        "inodes_used": "1",
        "inodes_available": "127540",
        "inodes_percent_used": "1%",
        "fs_type": "tmpfs",
        "mount_options": [
          "rw"
        ]
      },
      "proc": {
        "mount": "/proc",
        "fs_type": "proc",
        "mount_options": [
          "rw"
        ]
      },
      "sysfs": {
        "mount": "/sys",
        "fs_type": "sysfs",
        "mount_options": [
          "rw"
        ]
      },
      "devpts": {
        "mount": "/dev/pts",
        "fs_type": "devpts",
        "mount_options": [
          "rw",
          "gid=5",
          "mode=620"
        ]
      },
      "none": {
        "mount": "/proc/sys/fs/binfmt_misc",
        "fs_type": "binfmt_misc",
        "mount_options": [
          "rw"
        ]
      },
      "/dev/vda1": {
        "fs_type": "swap",
        "uuid": "c16a18d6-4988-493e-b6db-6bb0172ad83b"
      },
      "rootfs": {
        "mount": "/",
        "fs_type": "rootfs",
        "mount_options": [
          "rw"
        ]
      },
      "devtmpfs": {
        "mount": "/dev",
        "fs_type": "devtmpfs",
        "mount_options": [
          "rw",
          "relatime",
          "size=498996k",
          "nr_inodes=124749",
          "mode=755"
        ]
      },
      "/proc/bus/usb": {
        "mount": "/proc/bus/usb",
        "fs_type": "usbfs",
        "mount_options": [
          "rw",
          "relatime"
        ]
      }
    },
    "memory": {
      "swap": {
        "cached": "0kB",
        "total": "4200208kB",
        "free": "4200208kB"
      },
      "total": "1020332kB",
      "free": "243876kB",
      "buffers": "67420kB",
      "cached": "517076kB",
      "active": "202800kB",
      "inactive": "465096kB",
      "dirty": "64kB",
      "writeback": "0kB",
      "anon_pages": "83380kB",
      "mapped": "14924kB",
      "slab": "89108kB",
      "slab_reclaimable": "70068kB",
      "slab_unreclaim": "19040kB",
      "page_tables": "2632kB",
      "nfs_unstable": "0kB",
      "bounce": "0kB",
      "commit_limit": "4710372kB",
      "committed_as": "177592kB",
      "vmalloc_total": "34359738367kB",
      "vmalloc_used": "8104kB",
      "vmalloc_chunk": "34359726288kB"
    },
    "ip6address": "fe80::9ea3:baff:fe25:5f9b",
    "etc": {
      "passwd": {
        "root": {
          "dir": "/root",
          "gid": 0,
          "uid": 0,
          "shell": "/bin/bash",
          "gecos": "root"
        },
        "bin": {
          "dir": "/bin",
          "gid": 1,
          "uid": 1,
          "shell": "/sbin/nologin",
          "gecos": "bin"
        },
        "daemon": {
          "dir": "/sbin",
          "gid": 2,
          "uid": 2,
          "shell": "/sbin/nologin",
          "gecos": "daemon"
        },
        "adm": {
          "dir": "/var/adm",
          "gid": 4,
          "uid": 3,
          "shell": "/sbin/nologin",
          "gecos": "adm"
        },
        "lp": {
          "dir": "/var/spool/lpd",
          "gid": 7,
          "uid": 4,
          "shell": "/sbin/nologin",
          "gecos": "lp"
        },
        "sync": {
          "dir": "/sbin",
          "gid": 0,
          "uid": 5,
          "shell": "/bin/sync",
          "gecos": "sync"
        },
        "shutdown": {
          "dir": "/sbin",
          "gid": 0,
          "uid": 6,
          "shell": "/sbin/shutdown",
          "gecos": "shutdown"
        },
        "halt": {
          "dir": "/sbin",
          "gid": 0,
          "uid": 7,
          "shell": "/sbin/halt",
          "gecos": "halt"
        },
        "mail": {
          "dir": "/var/spool/mail",
          "gid": 12,
          "uid": 8,
          "shell": "/sbin/nologin",
          "gecos": "mail"
        },
        "uucp": {
          "dir": "/var/spool/uucp",
          "gid": 14,
          "uid": 10,
          "shell": "/sbin/nologin",
          "gecos": "uucp"
        },
        "operator": {
          "dir": "/root",
          "gid": 0,
          "uid": 11,
          "shell": "/sbin/nologin",
          "gecos": "operator"
        },
        "games": {
          "dir": "/usr/games",
          "gid": 100,
          "uid": 12,
          "shell": "/sbin/nologin",
          "gecos": "games"
        },
        "gopher": {
          "dir": "/var/gopher",
          "gid": 30,
          "uid": 13,
          "shell": "/sbin/nologin",
          "gecos": "gopher"
        },
        "ftp": {
          "dir": "/var/ftp",
          "gid": 50,
          "uid": 14,
          "shell": "/sbin/nologin",
          "gecos": "FTP User"
        },
        "nobody": {
          "dir": "/",
          "gid": 99,
          "uid": 99,
          "shell": "/sbin/nologin",
          "gecos": "Nobody"
        },
        "dbus": {
          "dir": "/",
          "gid": 81,
          "uid": 81,
          "shell": "/sbin/nologin",
          "gecos": "System message bus"
        },
        "vcsa": {
          "dir": "/dev",
          "gid": 69,
          "uid": 69,
          "shell": "/sbin/nologin",
          "gecos": "virtual console memory owner"
        },
        "ntp": {
          "dir": "/etc/ntp",
          "gid": 38,
          "uid": 38,
          "shell": "/sbin/nologin",
          "gecos": ""
        },
        "saslauth": {
          "dir": "/var/empty/saslauth",
          "gid": 76,
          "uid": 499,
          "shell": "/sbin/nologin",
          "gecos": "Saslauthd user"
        },
        "postfix": {
          "dir": "/var/spool/postfix",
          "gid": 89,
          "uid": 89,
          "shell": "/sbin/nologin",
          "gecos": ""
        },
        "abrt": {
          "dir": "/etc/abrt",
          "gid": 173,
          "uid": 173,
          "shell": "/sbin/nologin",
          "gecos": ""
        },
        "haldaemon": {
          "dir": "/",
          "gid": 68,
          "uid": 68,
          "shell": "/sbin/nologin",
          "gecos": "HAL daemon"
        },
        "sshd": {
          "dir": "/var/empty/sshd",
          "gid": 74,
          "uid": 74,
          "shell": "/sbin/nologin",
          "gecos": "Privilege-separated SSH"
        },
        "tcpdump": {
          "dir": "/",
          "gid": 72,
          "uid": 72,
          "shell": "/sbin/nologin",
          "gecos": ""
        },
        "ookita": {
          "dir": "/home/ookita",
          "gid": 500,
          "uid": 500,
          "shell": "/bin/bash",
          "gecos": ""
        }
      },
      "group": {
        "root": {
          "gid": 0,
          "members": [

          ]
        },
        "bin": {
          "gid": 1,
          "members": [
            "bin",
            "daemon"
          ]
        },
        "daemon": {
          "gid": 2,
          "members": [
            "bin",
            "daemon"
          ]
        },
        "sys": {
          "gid": 3,
          "members": [
            "bin",
            "adm"
          ]
        },
        "adm": {
          "gid": 4,
          "members": [
            "adm",
            "daemon"
          ]
        },
        "tty": {
          "gid": 5,
          "members": [

          ]
        },
        "disk": {
          "gid": 6,
          "members": [

          ]
        },
        "lp": {
          "gid": 7,
          "members": [
            "daemon"
          ]
        },
        "mem": {
          "gid": 8,
          "members": [

          ]
        },
        "kmem": {
          "gid": 9,
          "members": [

          ]
        },
        "wheel": {
          "gid": 10,
          "members": [

          ]
        },
        "mail": {
          "gid": 12,
          "members": [
            "mail",
            "postfix"
          ]
        },
        "uucp": {
          "gid": 14,
          "members": [

          ]
        },
        "man": {
          "gid": 15,
          "members": [

          ]
        },
        "games": {
          "gid": 20,
          "members": [

          ]
        },
        "gopher": {
          "gid": 30,
          "members": [

          ]
        },
        "video": {
          "gid": 39,
          "members": [

          ]
        },
        "dip": {
          "gid": 40,
          "members": [

          ]
        },
        "ftp": {
          "gid": 50,
          "members": [

          ]
        },
        "lock": {
          "gid": 54,
          "members": [

          ]
        },
        "audio": {
          "gid": 63,
          "members": [

          ]
        },
        "nobody": {
          "gid": 99,
          "members": [

          ]
        },
        "users": {
          "gid": 100,
          "members": [

          ]
        },
        "dbus": {
          "gid": 81,
          "members": [

          ]
        },
        "utmp": {
          "gid": 22,
          "members": [

          ]
        },
        "utempter": {
          "gid": 35,
          "members": [

          ]
        },
        "floppy": {
          "gid": 19,
          "members": [

          ]
        },
        "vcsa": {
          "gid": 69,
          "members": [

          ]
        },
        "stapusr": {
          "gid": 156,
          "members": [

          ]
        },
        "stapsys": {
          "gid": 157,
          "members": [

          ]
        },
        "stapdev": {
          "gid": 158,
          "members": [

          ]
        },
        "cdrom": {
          "gid": 11,
          "members": [

          ]
        },
        "tape": {
          "gid": 33,
          "members": [

          ]
        },
        "dialout": {
          "gid": 18,
          "members": [

          ]
        },
        "ntp": {
          "gid": 38,
          "members": [

          ]
        },
        "saslauth": {
          "gid": 76,
          "members": [

          ]
        },
        "postdrop": {
          "gid": 90,
          "members": [

          ]
        },
        "postfix": {
          "gid": 89,
          "members": [

          ]
        },
        "abrt": {
          "gid": 173,
          "members": [

          ]
        },
        "haldaemon": {
          "gid": 68,
          "members": [
            "haldaemon"
          ]
        },
        "sshd": {
          "gid": 74,
          "members": [

          ]
        },
        "tcpdump": {
          "gid": 72,
          "members": [

          ]
        },
        "slocate": {
          "gid": 21,
          "members": [

          ]
        },
        "ookita": {
          "gid": 500,
          "members": [

          ]
        }
      }
    },
    "current_user": "root",
    "uptime_seconds": 38325,
    "uptime": "10 hours 38 minutes 45 seconds",
    "idletime_seconds": 38257,
    "idletime": "10 hours 37 minutes 37 seconds",
    "hostname": "chefzero02",
    "machinename": "chefzero02.ec2.tokyo",
    "fqdn": "chefzero02.ec2.tokyo",
    "domain": "ec2.tokyo",
    "command": {
      "ps": "ps -ef"
    },
    "dmi": {
      "dmidecode_version": "2.12",
      "smbios_version": "2.4",
      "structures": {
        "count": "10",
        "size": "306"
      },
      "bios": {
        "all_records": [
          {
            "record_id": "0x0000",
            "size": "0",
            "application_identifier": "BIOS Information",
            "Vendor": "Seabios",
            "Version": "0.5.1",
            "Release Date": "01/01/2007",
            "Address": "0xE8000",
            "Runtime Size": "96 kB",
            "ROM Size": "64 kB",
            "Characteristics": {
              "BIOS characteristics not supported": null,
              "Targeted content distribution is supported": null
            },
            "BIOS Revision": "1.0"
          }
        ],
        "vendor": "Seabios",
        "version": "0.5.1",
        "release_date": "01/01/2007",
        "address": "0xE8000",
        "runtime_size": "96 kB",
        "rom_size": "64 kB",
        "bios_revision": "1.0"
      },
      "system": {
        "all_records": [
          {
            "record_id": "0x0100",
            "size": "1",
            "application_identifier": "System Information",
            "Manufacturer": "Red Hat",
            "Product Name": "KVM",
            "Version": "RHEL 6.2.0 PC",
            "Serial Number": "Not Specified",
            "UUID": "98B77220-A6A4-475E-8DA7-82A217FF6909",
            "Wake-up Type": "Power Switch",
            "SKU Number": "Not Specified",
            "Family": "Red Hat Enterprise Linux"
          }
        ],
        "manufacturer": "Red Hat",
        "product_name": "KVM",
        "version": "RHEL 6.2.0 PC",
        "serial_number": "Not Specified",
        "uuid": "98B77220-A6A4-475E-8DA7-82A217FF6909",
        "wake_up_type": "Power Switch",
        "sku_number": "Not Specified",
        "family": "Red Hat Enterprise Linux"
      },
      "chassis": {
        "all_records": [
          {
            "record_id": "0x0300",
            "size": "3",
            "application_identifier": "Chassis Information",
            "Manufacturer": "Red Hat",
            "Type": "Other",
            "Lock": "Not Present",
            "Version": "Not Specified",
            "Serial Number": "Not Specified",
            "Asset Tag": "Not Specified",
            "Boot-up State": "Safe",
            "Power Supply State": "Safe",
            "Thermal State": "Safe",
            "Security Status": "Unknown",
            "OEM Information": "0x00000000",
            "Height": "Unspecified",
            "Number Of Power Cords": "Unspecified"
          }
        ],
        "manufacturer": "Red Hat",
        "type": "Other",
        "lock": "Not Present",
        "version": "Not Specified",
        "serial_number": "Not Specified",
        "asset_tag": "Not Specified",
        "boot_up_state": "Safe",
        "power_supply_state": "Safe",
        "thermal_state": "Safe",
        "security_status": "Unknown",
        "oem_information": "0x00000000",
        "height": "Unspecified",
        "number_of_power_cords": "Unspecified"
      },
      "processor": {
        "all_records": [
          {
            "record_id": "0x0401",
            "size": "4",
            "application_identifier": "End Of Table",
            "Socket Designation": "CPU 1",
            "Type": "RAM",
            "Family": "Other",
            "Manufacturer": "Bochs",
            "ID": "C2 06 02 00 FF F3 8B 0F",
            "Version": "Not Specified",
            "Voltage": "Unknown",
            "External Clock": "Unknown",
            "Max Speed": "2000 MHz",
            "Current Speed": "2000 MHz",
            "Status": "No errors detected",
            "Upgrade": "Other",
            "L1 Cache Handle": "Not Provided",
            "L2 Cache Handle": "Not Provided",
            "L3 Cache Handle": "Not Provided",
            "Location": "Other",
            "Use": "System Memory",
            "Error Correction Type": "Multi-bit ECC",
            "Maximum Capacity": "1 GB",
            "Error Information Handle": "0x0000",
            "Number Of Devices": "1",
            "Array Handle": "0x1000",
            "Total Width": "64 bits",
            "Data Width": "64 bits",
            "Size": "1024 MB",
            "Form Factor": "DIMM",
            "Set": "None",
            "Locator": "DIMM 0",
            "Bank Locator": "Not Specified",
            "Type Detail": "None",
            "Starting Address": "0x00000000000",
            "Ending Address": "0x0003FFFFFFF",
            "Range Size": "1 GB",
            "Physical Array Handle": "0x1000",
            "Partition Width": "1",
            "Physical Device Handle": "0x1100",
            "Memory Array Mapped Address Handle": "0x1300",
            "Partition Row Position": "1"
          }
        ],
        "socket_designation": "CPU 1",
        "type": "RAM",
        "family": "Other",
        "manufacturer": "Bochs",
        "id": "C2 06 02 00 FF F3 8B 0F",
        "version": "Not Specified",
        "voltage": "Unknown",
        "external_clock": "Unknown",
        "max_speed": "2000 MHz",
        "current_speed": "2000 MHz",
        "status": "No errors detected",
        "upgrade": "Other",
        "l1_cache_handle": "Not Provided",
        "l2_cache_handle": "Not Provided",
        "l3_cache_handle": "Not Provided",
        "location": "Other",
        "use": "System Memory",
        "error_correction_type": "Multi-bit ECC",
        "maximum_capacity": "1 GB",
        "error_information_handle": "0x0000",
        "number_of_devices": "1",
        "array_handle": "0x1000",
        "total_width": "64 bits",
        "data_width": "64 bits",
        "size": "1024 MB",
        "form_factor": "DIMM",
        "set": "None",
        "locator": "DIMM 0",
        "bank_locator": "Not Specified",
        "type_detail": "None",
        "starting_address": "0x00000000000",
        "ending_address": "0x0003FFFFFFF",
        "range_size": "1 GB",
        "physical_array_handle": "0x1000",
        "partition_width": "1",
        "physical_device_handle": "0x1100",
        "memory_array_mapped_address_handle": "0x1300",
        "partition_row_position": "1"
      }
    },
    "init_package": "init",
    "root_group": "root",
    "block_device": {
      "ram0": {
        "size": "32768",
        "removable": "0"
      },
      "ram1": {
        "size": "32768",
        "removable": "0"
      },
      "ram2": {
        "size": "32768",
        "removable": "0"
      },
      "ram3": {
        "size": "32768",
        "removable": "0"
      },
      "ram4": {
        "size": "32768",
        "removable": "0"
      },
      "ram5": {
        "size": "32768",
        "removable": "0"
      },
      "ram6": {
        "size": "32768",
        "removable": "0"
      },
      "ram7": {
        "size": "32768",
        "removable": "0"
      },
      "ram8": {
        "size": "32768",
        "removable": "0"
      },
      "ram9": {
        "size": "32768",
        "removable": "0"
      },
      "ram10": {
        "size": "32768",
        "removable": "0"
      },
      "ram11": {
        "size": "32768",
        "removable": "0"
      },
      "ram12": {
        "size": "32768",
        "removable": "0"
      },
      "ram13": {
        "size": "32768",
        "removable": "0"
      },
      "ram14": {
        "size": "32768",
        "removable": "0"
      },
      "ram15": {
        "size": "32768",
        "removable": "0"
      },
      "loop0": {
        "size": "0",
        "removable": "0"
      },
      "loop1": {
        "size": "0",
        "removable": "0"
      },
      "loop2": {
        "size": "0",
        "removable": "0"
      },
      "loop3": {
        "size": "0",
        "removable": "0"
      },
      "loop4": {
        "size": "0",
        "removable": "0"
      },
      "loop5": {
        "size": "0",
        "removable": "0"
      },
      "loop6": {
        "size": "0",
        "removable": "0"
      },
      "loop7": {
        "size": "0",
        "removable": "0"
      },
      "sr0": {
        "size": "2097151",
        "removable": "1",
        "model": "QEMU DVD-ROM",
        "rev": "0.12",
        "state": "running",
        "timeout": "30",
        "vendor": "QEMU"
      },
      "sr1": {
        "size": "2097151",
        "removable": "1",
        "model": "QEMU DVD-ROM",
        "rev": "0.12",
        "state": "running",
        "timeout": "30",
        "vendor": "QEMU"
      },
      "vda": {
        "size": "41943040",
        "removable": "0",
        "vendor": "6900"
      }
    },
    "ohai_time": 1420377640.68401,
    "recipes": [

    ],
    "roles": [

    ]
  },
  "run_list": [
    "recipe[lamp]"
  ],
  "json_class": "Chef::Node",
  "chef_type": "node",
  "chef_environment": "_default",
  "override": {

  },
  "default": {

  }
}

],
"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 isSSH-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:

  • kex: diffie-hellman-group-exchange-sha1
  • host_key: ssh-rsa
  • encryption_server: aes128-cbc
  • encryption_client: aes128-cbc
  • hmac_client: hmac-sha1
  • hmac_server: hmac-sha1
  • compression_client: none
  • compression_server: none
  • language_client:
  • language_server:
    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:inrescue 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:innext_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:inblock 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:inssh_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:inblock 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:inrun_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:inrun'
    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:inload'
    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:ineval'
    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:inblock in ssh_command': undefined method forward' 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:ineach'
    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:inrun'
    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:inwith_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:inrun'
    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'

以上、ご確認のほどよろしくお願い致します。

@sawanoboly
Copy link
Member

コマンドラインオプションで、ユーザや鍵ファイルを明示的に指定してもこけますか?

@nagi2100
Copy link
Author

nagi2100 commented Jan 5, 2015

-xでユーザを明示的に指定しましたが同様にNGでした。
なお、ドメイン名はec2.tokyoとなっていて紛らわしいのですが
サーバの実体はさくらのクラウドです。そのため鍵認証は使用しておりません。
knife-zeroの使用は鍵認証が前提なのでしょうか。

[@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x ***
WARN: No cookbooks directory found at or above current directory. Assuming /home/
/chef-repo.
WARNING: Failed to connect to chefzero02.ec2.tokyo -- Net::SSH::AuthenticationFailed: Authentication failed for user ***
@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

@sawanoboly
Copy link
Member

なら認証はパスワードですか? このオプションを付けたらどうなるでしょうか。

-P, --ssh-password PASSWORD

@nagi2100
Copy link
Author

nagi2100 commented Jan 5, 2015

ありがとうございます。パスワードオプション付けたところSSHエラーは出なくなりました。
別のエラーが出ていますが、こちらの環境に問題がありそうなので調べてみます。
(単に/etc/chef/client.pemが読めてないだけっぽいですが。。)

[@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x ***** --ssh-password XXXXXXXX
WARN: No cookbooks directory found at or above current directory. Assuming /home/
/chef-repo.
chefzero02.ec2.tokyo Starting Chef Client, version 12.0.3
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::EACCES: Permission denied @ rb_sysopen - /etc/chef/client.pem>
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo Chef encountered an error attempting to create the client "chefzero02.ec2.tokyo"
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Private Key Not Found:
chefzero02.ec2.tokyo ----------------------
chefzero02.ec2.tokyo Your private key could not be loaded. If the key file exists, ensure that it is
chefzero02.ec2.tokyo readable by chef-client.
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Relevant Config Settings:
chefzero02.ec2.tokyo -------------------------
chefzero02.ec2.tokyo validation_key "/etc/chef/validation.pem"
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] FATAL: Stacktrace dumped to /home/**
***/.chef/cache/chef-stacktrace.out
chefzero02.ec2.tokyo Chef Client failed. 0 resources updated in 1.022760925 seconds
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] ERROR: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

@sawanoboly
Copy link
Member

おや、先にbootstrapしました?

@nagi2100
Copy link
Author

nagi2100 commented Jan 5, 2015

お手数をおかけしてすみません。2つ問題が判明し解決しました。
1.rootユーザでbootstrapして一般ユーザでchef_clientしていた
2. --sudoをつけ忘れていた

bootstrapおよびchef_clientの両方を一般ユーザのsudoで実行したところうまく動作しました。
(両方ともrootでやってもうまくいきましたが。。)

まだ以下エラーが出てcookbookの実行ができていないのですが、cookbookの配置が悪いのかという気がしており、調べてみます。ありがとうございます。
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
chefzero02.ec2.tokyo Starting Chef Client, version 12.0.3
chefzero02.ec2.tokyo resolving cookbooks for run list: ["lamp"]
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo Error Resolving Cookbooks for Run List:
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Missing Cookbooks:
chefzero02.ec2.tokyo ------------------
chefzero02.ec2.tokyo No such cookbook: lamp
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Expanded Run List:
chefzero02.ec2.tokyo ------------------
chefzero02.ec2.tokyo * lamp
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Running handlers:
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: Running exception handlers
chefzero02.ec2.tokyo Running handlers complete
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: Exception handlers complete
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
chefzero02.ec2.tokyo Chef Client failed. 0 resources updated in 1.383395461 seconds
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: 412 "Precondition Failed "
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

@sawanoboly
Copy link
Member

1.rootユーザでbootstrapして一般ユーザでchef_clientしていた
2. --sudoをつけ忘れていた

あー、なるほど。それならそういう挙動になりそうです。

Cookbooksのパスですが、chef-zeroの仕様でknife.rbは多分無視されます。
ログに出てるんで書いちゃますが以下のとこに置いてみてください。

/home/ookita/chef-repo/cookbooks/lamp/

@nagi2100
Copy link
Author

nagi2100 commented Jan 5, 2015

ありがとうございます。cookbookのpathが
/home/ookita/chef-repo/site-cookbooks/lamp
になっていたので、
/home/ookita/chef-repo/cookbooks/lamp
に変更したところcookbookが正常に実行されました。

knife-soloとだいぶ勝手が違い戸惑ってしまいました。。
ありがとうございました。

@sawanoboly
Copy link
Member

Berkshelf(またはlibrarian)でpath: 'site-cookbooks/hoghoge'のようにして、一回cookbooks/に集めるようにするといいかと思います。

ではcloseしてもいいですかね?

@nagi2100
Copy link
Author

nagi2100 commented Jan 6, 2015

はい、closeでお願い致します。
ありがとうございました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants