aws_elastic_ip MissingParameter error


#1

Anyone here know about the aws cookbook? I’ve set it up just as described
here: https://github.com/opscode/cookbooks/tree/master/aws I’m using a new
recipe in my app’s own cookbook to set up an elastic ip, like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError: aws_elastic_ip[umbuc_load_balancer_production]
(caramel::elastic_ip line 15) had an error: MissingParameter: Either public
IP or allocation id must be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


#2

Hi there,

Is your issue somehow related to this ticket:
http://tickets.opscode.com/browse/COOK-829

What is the output of gem list right_aws on your node?

On Wed, Nov 30, 2011 at 2:18 PM, Kevin Harvey kcharvey@gmail.com wrote:

Anyone here know about the aws cookbook? I’ve set it up just as described
here: https://github.com/opscode/cookbooks/tree/master/aws I’m using a
new recipe in my app’s own cookbook to set up an elastic ip, like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError: aws_elastic_ip[umbuc_load_balancer_production]
(caramel::elastic_ip line 15) had an error: MissingParameter: Either public
IP or allocation id must be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#3

Hey Stephen, I hadn’t seen that, but I just tried it (version “2.1.0”) and
I still got the same error.

gem list right_aws returns the following on my new node

*** LOCAL GEMS ***

right_aws (3.0.0)


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 5:28 PM, Stephen Delano stephen@opscode.com wrote:

Hi there,

Is your issue somehow related to this ticket:
http://tickets.opscode.com/browse/COOK-829

What is the output of gem list right_aws on your node?

On Wed, Nov 30, 2011 at 2:18 PM, Kevin Harvey kcharvey@gmail.com wrote:

Anyone here know about the aws cookbook? I’ve set it up just as described
here: https://github.com/opscode/cookbooks/tree/master/aws I’m using a
new recipe in my app’s own cookbook to set up an elastic ip, like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError: aws_elastic_ip[umbuc_load_balancer_production]
(caramel::elastic_ip line 15) had an error: MissingParameter: Either public
IP or allocation id must be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#4

Hi Kevin,

Try installing version 2.1.0 of the right_aws gem and deleting version
3.0.0. Can you also verify the version number of your aws cookbook?

Thanks!

On Wed, Nov 30, 2011 at 3:21 PM, Kevin Harvey kcharvey@gmail.com wrote:

Hey Stephen, I hadn’t seen that, but I just tried it (version “2.1.0”) and
I still got the same error.

gem list right_aws returns the following on my new node

*** LOCAL GEMS ***

right_aws (3.0.0)


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 5:28 PM, Stephen Delano stephen@opscode.comwrote:

Hi there,

Is your issue somehow related to this ticket:
http://tickets.opscode.com/browse/COOK-829

What is the output of gem list right_aws on your node?

On Wed, Nov 30, 2011 at 2:18 PM, Kevin Harvey kcharvey@gmail.com wrote:

Anyone here know about the aws cookbook? I’ve set it up just as
described here: https://github.com/opscode/cookbooks/tree/master/awsI’m using a new recipe in my app’s own cookbook to set up an elastic ip,
like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError:
aws_elastic_ip[umbuc_load_balancer_production] (caramel::elastic_ip line
15) had an error: MissingParameter: Either public IP or allocation id must
be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#5

That did it! However now I can’t run the knife ssh command. I assume that’s
because the node at OpsCode has a different public IP than the actual
instance does? The command I’m trying to run is:

knife ssh ‘name:i-xxxxxxxx’ ‘sudo chef-client -l debug’ -a
ec2.public_hostname -x ubuntu

Do I need to update the node manually, or is there something I can run to
sync them up?

The AWS cookbook is 0.99.0


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 7:29 PM, Stephen Delano stephen@opscode.com wrote:

Hi Kevin,

Try installing version 2.1.0 of the right_aws gem and deleting version
3.0.0. Can you also verify the version number of your aws cookbook?

Thanks!

On Wed, Nov 30, 2011 at 3:21 PM, Kevin Harvey kcharvey@gmail.com wrote:

Hey Stephen, I hadn’t seen that, but I just tried it (version “2.1.0”)
and I still got the same error.

gem list right_aws returns the following on my new node

*** LOCAL GEMS ***

right_aws (3.0.0)


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 5:28 PM, Stephen Delano stephen@opscode.comwrote:

Hi there,

Is your issue somehow related to this ticket:
http://tickets.opscode.com/browse/COOK-829

What is the output of gem list right_aws on your node?

On Wed, Nov 30, 2011 at 2:18 PM, Kevin Harvey kcharvey@gmail.comwrote:

Anyone here know about the aws cookbook? I’ve set it up just as
described here: https://github.com/opscode/cookbooks/tree/master/awsI’m using a new recipe in my app’s own cookbook to set up an elastic ip,
like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError:
aws_elastic_ip[umbuc_load_balancer_production] (caramel::elastic_ip line
15) had an error: MissingParameter: Either public IP or allocation id must
be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#6

I just manually ssh’d in to the server (ssh ubunut@xxx.xxx.xxx.xxx) and ran
chef-client. It appears that resync’d the instance at OpsCode. I’m now able
to run the knife ssh command. Does that sound right?

Thanks again.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Thu, Dec 1, 2011 at 8:03 AM, Kevin Harvey kcharvey@gmail.com wrote:

That did it! However now I can’t run the knife ssh command. I assume
that’s because the node at OpsCode has a different public IP than the
actual instance does? The command I’m trying to run is:

knife ssh ‘name:i-xxxxxxxx’ ‘sudo chef-client -l debug’ -a
ec2.public_hostname -x ubuntu

Do I need to update the node manually, or is there something I can run to
sync them up?

The AWS cookbook is 0.99.0


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 7:29 PM, Stephen Delano stephen@opscode.comwrote:

Hi Kevin,

Try installing version 2.1.0 of the right_aws gem and deleting version
3.0.0. Can you also verify the version number of your aws cookbook?

Thanks!

On Wed, Nov 30, 2011 at 3:21 PM, Kevin Harvey kcharvey@gmail.com wrote:

Hey Stephen, I hadn’t seen that, but I just tried it (version “2.1.0”)
and I still got the same error.

gem list right_aws returns the following on my new node

*** LOCAL GEMS ***

right_aws (3.0.0)


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com

On Wed, Nov 30, 2011 at 5:28 PM, Stephen Delano stephen@opscode.comwrote:

Hi there,

Is your issue somehow related to this ticket:
http://tickets.opscode.com/browse/COOK-829

What is the output of gem list right_aws on your node?

On Wed, Nov 30, 2011 at 2:18 PM, Kevin Harvey kcharvey@gmail.comwrote:

Anyone here know about the aws cookbook? I’ve set it up just as
described here: https://github.com/opscode/cookbooks/tree/master/awsI’m using a new recipe in my app’s own cookbook to set up an elastic ip,
like so:

include_recipe “aws”

aws = data_bag_item(“aws”, “main”)
ip_info = data_bag_item(“aws”, “project_load_balancer_production”)

aws_elastic_ip “project_load_balancer_production” do
aws_access_key aws[‘aws_access_key_id’]
aws_secret_access_key aws[‘aws_secret_access_key’]
ip ip_info[‘public_ip’]
action :associate
end

And I’m getting the same error described in this ticket:
http://tickets.opscode.com/browse/COOK-845?page=com.atlassian.streams.streams-jira-plugin%3Aactivity-stream-issue-tab#issue-tabs

FATAL: RightAws::AwsError:
aws_elastic_ip[umbuc_load_balancer_production] (caramel::elastic_ip line
15) had an error: MissingParameter: Either public IP or allocation id must
be specified

I get the same error if I enter all the data manually.


Kevin Harvey
Web Developer
615-686-8238
kcharvey@gmail.com


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


Stephen Delano
Software Development Engineer
Opscode, Inc.
1008 Western Avenue
Suite 601
Seattle, WA 98104


#7

On Thu, Dec 1, 2011 at 8:09 AM, Kevin Harvey kcharvey@gmail.com wrote:

I just manually ssh’d in to the server (ssh ubunut@xxx.xxx.xxx.xxx) and ran
chef-client. It appears that resync’d the instance at OpsCode. I’m now able

It is possible that the instance hadn’t populated that information
correctly with the server. It is hard to tell now that you fixed it,
so just glad it is working for you now.

Bryan


#8

Just want to note that there’s now an ohai resource (added in 0.10 I
think?) that will do the reload as well that looks a little cleaner
(to my eyes at least), though does exactly the same thing:
http://wiki.opscode.com/display/chef/Resources#Resources-Ohai

ohai “reload” do
action :reload
end

On Tue, Dec 6, 2011 at 10:42 AM, Joshua Timberman joshua@opscode.com wrote:

What happened, and this is normal without modification via a recipe:

  • Instance is launched rand new with no chef, original public ip from ec2 is assigned.
  • Chef gets installed and runs Ohai, which detects the ec2 assigned IP.
  • elastic ip is assigned by the recipe.
    (at this point you may lose connectivity if you were on the ec2 assign ip)
  • chef run completes and the node is saved.

At no point does chef rerun Ohai to detect the ip. It is correct after chef runs again because the elastic ip is now the default.

You can initialize rerunning Ohai in a chef run like this:

o = Ohai::System.new
o.all_plugins
node.automatic_attrs.merge! o.data

Put that in a ruby_block so it happens during the execute phase of convergence. You can also call node.save explicitly in the ruby_block.

On Dec 1, 2011, at 10:56, Bryan McLellan btm@loftninjas.org wrote:

On Thu, Dec 1, 2011 at 8:09 AM, Kevin Harvey kcharvey@gmail.com wrote:

I just manually ssh’d in to the server (ssh ubunut@xxx.xxx.xxx.xxx) and ran
chef-client. It appears that resync’d the instance at OpsCode. I’m now able

It is possible that the instance hadn’t populated that information
correctly with the server. It is hard to tell now that you fixed it,
so just glad it is working for you now.

Bryan


#9

What happened, and this is normal without modification via a recipe:

  • Instance is launched rand new with no chef, original public ip from ec2 is assigned.
  • Chef gets installed and runs Ohai, which detects the ec2 assigned IP.
  • elastic ip is assigned by the recipe.
    (at this point you may lose connectivity if you were on the ec2 assign ip)
  • chef run completes and the node is saved.

At no point does chef rerun Ohai to detect the ip. It is correct after chef runs again because the elastic ip is now the default.

You can initialize rerunning Ohai in a chef run like this:

o = Ohai::System.new
o.all_plugins
node.automatic_attrs.merge! o.data

Put that in a ruby_block so it happens during the execute phase of convergence. You can also call node.save explicitly in the ruby_block.

On Dec 1, 2011, at 10:56, Bryan McLellan btm@loftninjas.org wrote:

On Thu, Dec 1, 2011 at 8:09 AM, Kevin Harvey kcharvey@gmail.com wrote:

I just manually ssh’d in to the server (ssh ubunut@xxx.xxx.xxx.xxx) and ran
chef-client. It appears that resync’d the instance at OpsCode. I’m now able

It is possible that the instance hadn’t populated that information
correctly with the server. It is hard to tell now that you fixed it,
so just glad it is working for you now.

Bryan