fog / fog-aws

Module for the 'fog' gem to support Amazon Web Services http://aws.amazon.com/
MIT License
297 stars 353 forks source link

Fog::Compute::AWS::Error iamInstanceProfile.name is invalid #410

Closed binlialfie closed 3 years ago

binlialfie commented 6 years ago

Hello, I am re-running some of my script to start EC2 server using knife ec2 server create

It indeed works before, but now it gave the errors:

ERROR: Fog::Compute::AWS::Error: InvalidParameterValue => Value (VPC-DEV_eu-west-1_elk) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name

VPC-DEV_eu-west-1_elk do exist in EC2 IAM, it is a value i copied from AWS console which do exist.

here is my fog related gem versions if any help:

$ chef gem list |grep fog chef-provisioning-fog (0.21.0) fog (1.41.0) fog-aliyun (0.2.0) fog-atmos (0.1.0) fog-aws (1.4.1) fog-brightbox (0.13.0) fog-cloudatcost (0.1.2) fog-core (1.45.0) fog-digitalocean (0.3.0) fog-dnsimple (1.0.0) fog-dynect (0.0.3) fog-ecloud (0.3.0) fog-google (0.1.0) fog-internet-archive (0.0.1) fog-joyent (0.0.1) fog-json (1.0.2) fog-local (0.4.0) fog-openstack (0.1.21) fog-powerdns (0.1.1) fog-profitbricks (4.0.0) fog-rackspace (0.1.5) fog-radosgw (0.0.5) fog-riakcs (0.1.0) fog-sakuracloud (1.7.5) fog-scaleway (0.3.0) fog-serverlove (0.1.2) fog-softlayer (1.1.4) fog-storm_on_demand (0.1.1) fog-terremark (0.1.0) fog-vmfusion (0.1.0) fog-voxel (0.1.0) fog-vsphere (1.12.0) fog-xenserver (0.3.0) fog-xml (0.1.3)

geemus commented 6 years ago

Nothing explicit/obvious jumping out for me there. I would double check that the image in question still exists, as the error sounds like it is simply not there (rather than being an interface/library thing).

binlialfie commented 6 years ago

when using -VV option in knife ec2 server create

        /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/excon-0.59.0/lib/excon/middlewares/expects.rb:7:in `response_call': InvalidParameterValue => Value (VPC-DEV_eu-west-1_clusterKafka) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name (Fog::Compute::AWS::Error)
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/excon-0.59.0/lib/excon/middlewares/response_parser.rb:9:in `response_call'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/excon-0.59.0/lib/excon/connection.rb:389:in `response'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/excon-0.59.0/lib/excon/connection.rb:253:in `request'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/fog-xml-0.1.3/lib/fog/xml/sax_parser_connection.rb:35:in `request'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/fog-xml-0.1.3/lib/fog/xml/connection.rb:7:in `request'
    from /home/org-home/bin.li/.chefdk/gem/ruby/2.4.0/gems/fog-aws-1.4.1/lib/fog/aws/compute.rb:547:in `_request'
    from /home/org-home/bin.li/.chefdk/gem/ruby/2.4.0/gems/fog-aws-1.4.1/lib/fog/aws/compute.rb:538:in `request'
    from /home/org-home/bin.li/.chefdk/gem/ruby/2.4.0/gems/fog-aws-1.4.1/lib/fog/aws/requests/compute/request_spot_instances.rb:85:in `request_spot_instances'
    from /home/org-home/bin.li/.chefdk/gem/ruby/2.4.0/gems/fog-aws-1.4.1/lib/fog/aws/models/compute/spot_request.rb:108:in `save'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/fog-core-1.45.0/lib/fog/core/collection.rb:50:in `create'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/knife-ec2-0.15.0/lib/chef/knife/ec2_server_create.rb:457:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/knife.rb:442:in `block in run_with_pretty_exceptions'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/local_mode.rb:44:in `with_server_connectivity'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/knife.rb:441:in `run_with_pretty_exceptions'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/knife.rb:219:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/lib/chef/application/knife.rb:156:in `run'
    from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.4.19/bin/knife:25:in `<top (required)>'
    from /usr/bin/knife:267:in `load'
    from /usr/bin/knife:267:in `<main>'

i also tried in a brand new machine, install latest ChefDK, same error. sorry, but does this indicate the bug in ChefDK not fog-aws?

binlialfie commented 6 years ago

$chef -v Chef Development Kit Version: 2.3.4 chef-client version: 13.4.19 delivery version: master (73ebb72a6c42b3d2ff5370c476be800fee7e5427) berks version: 6.3.1 kitchen version: 1.17.0 inspec version: 1.36.1

geemus commented 6 years ago

It is possible that knife is somehow not passing what you expect. I don't think fog should mutate the argument itself, but I'm not certain. I haven't heard of this error from anyone else that I'm aware of though, so asking in chef/knife repo might not be a bad idea. Sorry I'm not able to be more directly helpful, it isn't a part of fog I have direct experience with.

github-actions[bot] commented 3 years ago

This issue has been marked inactive and will be closed if no further activity occurs.