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

Error when converging cookbooks depending on 'aws' cookbook #68

Open
esciara opened this issue Jan 26, 2015 · 15 comments
Open

Error when converging cookbooks depending on 'aws' cookbook #68

esciara opened this issue Jan 26, 2015 · 15 comments
Milestone

Comments

@esciara
Copy link

esciara commented Jan 26, 2015

Whenever a cookbook using the chef-provisioning-aws driver depends on the 'aws' cookbook, converging fails at cookbooks compilation time with the following error:

[..]
Compiling Cookbooks...

================================================================================
Recipe Compile Error in /path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb
================================================================================

TypeError
---------
superclass mismatch for class AwsEbsVolume

Cookbook Trace:
---------------
  /path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:15:in `require'
  /path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:15:in `from_file'

Relevant File Content:
----------------------
/path/to/your/cookbook/development/directory/.chef/local-mode-cache/cache/cookbooks/aws-bug-cookbook/recipes/default.rb:

  8:  #
  9:  # Licensed under the Apache License, Version 2.0 (the "License");
 10:  # you may not use this file except in compliance with the License.
 11:  # You may obtain a copy of the License at
 12:  #
 13:  #     http://www.apache.org/licenses/LICENSE-2.0
 14:  
 15>> require 'chef/provisioning/aws_driver'
 16:  with_driver 'aws'
 17:  
[..]

Full instructions on https://gist.github.com/esciara/d0921bded64568dc6424

This stops me completly from deploying cookbooks such as https://github.com/bflad/chef-confluence .

@Jimflip
Copy link

Jimflip commented Jan 27, 2015

That gist is missing

@esciara
Copy link
Author

esciara commented Jan 27, 2015

@Jimflip sorry... had left a '/edit' in the link. Corrected now, you should be able to access it

@pburkholder
Copy link
Contributor

The aws LWRP is going to create these resources:

Chef::Resource::AwsEbsRaid             
Chef::Resource::AwsEbsVolume           
Chef::Resource::AwsElasticIp           
Chef::Resource::AwsElasticLb           
Chef::Resource::AwsInstanceMonitoring  
Chef::Resource::AwsResourceTag

of which AwsEbsVolume is going to have the superclass conflict. Not sure how to work around that.

@esciara
Copy link
Author

esciara commented Feb 3, 2015

Yep, we had a discussion around that on https://gitter.im/chef/chef-provisioning/archives/2015/01/27 and PR #70 has been created to fix this.

Another solution is not to use the https://github.com/opscode-cookbooks/aws cookbook. I don't really understand how it is called in the cookbook I am using (https://github.com/bflad/chef-confluence) since, from what I can see, it is only referred to in dependencies with suggest or recommend, and not depends. Need to dig a little deeper...

@pburkholder
Copy link
Contributor

I saw in Gitter that you'd asked about how the 'aws' cookbook creates the Chef::Resource::AwsEbsVolume class. That's part of the LWRP magic, e.g. http://www.rubydoc.info/github/opscode/chef/Chef/Resource/LWRPBase, which takes the names you're providing in the LWRP and generates Chef::Resource::CookbooknameResourceName resources.

Since the cookbook is 'aws' and the resource is 'ebs_volume' you got AwsEbsVolume from this file: https://github.com/opscode-cookbooks/aws/blob/master/resources/ebs_volume.rb

@esciara
Copy link
Author

esciara commented Feb 3, 2015

Thanks @pburkholder . I ended up working this out but did not have any reference, which you now gave!

@pburkholder
Copy link
Contributor

I think we should close this, per the discussion in #70. The AWS cookbook and this have a name collision you shouldn't use both in the same cookbook dependency chain until the functionality of the two are merged.

@jkeiser
Copy link
Contributor

jkeiser commented Feb 21, 2015

I do wonder ... what if we modified the aws cookbook so it used chef-provisioning, and made sure we supported the same attributes?

@jkeiser jkeiser modified the milestones: 1.0, Later Feb 21, 2015
@jkeiser
Copy link
Contributor

jkeiser commented Feb 26, 2015

Our answer for this at the moment is indeed "at 1.0, you should not use both at the same time." I'd like to see if we can find a way through, so leaving it open at the moment and putting milestone=Later.

@robcoward
Copy link

Is any progress being made on this ? I am trying to converge a node that will be the provisioning node running chef-provisioning-aws recipes to create all the other servers in the local infrastructure. I need to use the aws cookbook for the aws_s3_file lwrp to retrieve files from S3 when converging my provisioning server.
I like @jkeiser's suggestion of implementing the aws cookbook using chef-provisioning. Is anyone actually working on a solution at this time ?

@gmiranda23
Copy link

@robcoward The Chef Provisioning team sat down to hash out a pathway forward. #223 is a step toward making this a reality, but it may be a short while before we get there.

Perhaps we should close this (per #70 and #223)? The aws_ebs_volume and aws_eip_address resources should round out the things we need to cannibalize out of the aws cookbook.

@robcoward
Copy link

Hi @gmiranda23, as a work around for now, I have implemented the aws_s3_file lwrp in my own cookbook to remove the aws cookbook dependency, so I'll be keeping a close eye on #223.
I don't see any problem in closing this issue given the team has a plan moving forward.
Thanks for all the hard work :-)

@magicaltrevor
Copy link

This is sloppy, this is what's driving people from Chef. You guys maintain BOTH repositories.

@shortdudey123
Copy link

@gmiranda23 @jkeiser any update on this?
haven't seen any movement in over a year

@joemoore13
Copy link

Is there any progress at all on this? over 2 years from the time this issue was noticed...

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

No branches or pull requests

9 participants