mardi 16 février 2016

ERROR: Errno::EINVAL: Invalid argument @ io_write -

I am provisioning ubuntu instance on aws using the following code. I am using power shell and chef-apply to run my file and I am getting this error. I am missing some argument. I am pretty new to ruby.

provision_cmd = [
  "knife ec2 server create",
  "--image #{image}",
  "--flavor #{flavor}",
  "--region #{region}",
  "--availability-zone #{availability_zone}",
  "--ssh-user #{ssh_user}",
  "--identity-file #{identity_file}",
  "--security-group-ids #{security_group_ids}",
  "--node-name #{chef_node_name}",
  "--verbose"
].join(" ")
puts provision_cmd
ip_addr = nil
IO.popen(provision_cmd, 'r+') do |pipe|
  begin
    while line = pipe.readline
      puts line
      if line =~ /^Public IP Address: (.*)$/
        ip_addr = $1.strip
        Process.kill("TERM", pipe.pid)
        break
      end
    end
  rescue EOFError
  end
end
if ip_addr.nil?
  puts "ERROR: Unable to get new instance's IP address"
  exit -1
end

ERROR: Errno::EINVAL: Invalid argument @ io_write - [2016-02-11T15:49:54+05:30] FATAL: Stacktrace dumped to C:/chef/cache/chef- stacktrace.out [2016-02-11T15:49:54+05:30] FATAL: ArgumentError: Invalid Memory object

Aucun commentaire:

Enregistrer un commentaire