sous-chefs / aws

Development repository for the aws cookbook
https://supermarket.chef.io/cookbooks/aws
Apache License 2.0
602 stars 552 forks source link

resource_tag update fails when attempting to use multiple resource_id values #243

Open eedwardsdisco opened 8 years ago

eedwardsdisco commented 8 years ago

Cookbook version

3.3.3

Chef-client version

Chef 12.7.2

Platform Details

AWS Ubuntu

Scenario:

use multiple resource_id values with aws_resource_tag

Steps to Reproduce:

  aws_resource_tag 'bunch_of_things_getting_tagged' do
    tags ({'my-tag-name' => 'my-tag-value'})
    resource_id array_of_ebs_volume_ids
    action :update
  end

Expected Result:

All volumes listed in resource_id will have the relevant tag updated

Actual Result:

Error, appears that providers/resource_tag.rb: load_current_resource fails to handle multiple resource_id values

sanitized to remove proprietary information

================================================================================
Error executing action `update` on resource 'aws_resource_tag[bunch_of_things_getting_tagged]'
================================================================================

ArgumentError
-------------
expected params[:filters][0][:values][0] to be a string

Cookbook Trace:
---------------
/var/chef/runs/40d7e64f-be7f-451b-92de-2b08a33c2463/local-mode-cache/cache/cookbooks/aws/providers/resource_tag.rb:90:in `load_current_resource'
/var/chef/runs/40d7e64f-be7f-451b-92de-2b08a33c2463/local-mode-cache/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'

Resource Declaration:
---------------------
# In /var/chef/runs/40d7e64f-be7f-451b-92de-2b08a33c2463/local-mode-cache/cache/cookbooks/my-cookbook/recipes/ebs.rb

160:   aws_resource_tag 'bunch_of_things_getting_tagged' do
161:     tags ({'my-tag-name' => 'my-tag-value'})
162:     resource_id array_of_ebs_volume_ids
163:     action :update
164:   end
165: else

Compiled Resource:
------------------
# Declared in /var/chef/runs/40d7e64f-be7f-451b-92de-2b08a33c2463/local-mode-cache/cache/cookbooks/my-cookbook/recipes/ebs.rb:160:in `from_file'

aws_resource_tag("bunch_of_things_getting_tagged") do
action [:update]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :aws_resource_tag
cookbook_name "my-cookbook"
recipe_name "ebs"
tags {"my-tag-name"=>"my-tag-value"}
resource_id ["vol-1234567", "vol-2345678", "vol-3456789"]
end

[2016-05-30T21:04:30+00:00] INFO: Running queued delayed notifications before re-raising exception
[2016-05-30T21:04:30+00:00] ERROR: Running exception handlers
[2016-05-30T21:04:30+00:00] ERROR: Exception handlers complete
[2016-05-30T21:04:30+00:00] FATAL: Stacktrace dumped to /var/chef/runs/40d7e64f-be7f-451b-92de-2b08a33c2463/local-mode-cache/cache/chef-stacktrace.out
[2016-05-30T21:04:30+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-05-30T21:04:30+00:00] ERROR: aws_resource_tag[bunch_of_things_getting_tagged] (my-cookbook::ebs line 160) had an error: ArgumentError: expected params[:filters][0][:values][0] to be a string
[2016-05-30T21:04:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
jas0nfl0yd commented 7 years ago

Would be great to see a fix for this.

tas50 commented 7 years ago

The 7.0 cookbook release refactored this resource a bit and added testing. Can someone take a look and see if this is still an issue

gopisaba commented 6 years ago

I am seeing the same problem in 7.4.0 as well.

sayshh commented 3 years ago

This issue is still there in 8.3.0. Not sure what more information is required. A comment about the same would be helpful.

ashishranacse commented 3 years ago

I am facing this issue with 8.0.4 as well and the issue is in 'Needs Information'. Please confirm what information is required in order to fix this.