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

Test Kitchen issues on EC2 using RHEL platform? #181

Closed
gstankovski opened this issue Jul 26, 2015 · 4 comments
Closed

Test Kitchen issues on EC2 using RHEL platform? #181

gstankovski opened this issue Jul 26, 2015 · 4 comments

Comments

@gstankovski
Copy link

Hi,

I'm setting up Test Kitchen for the first time on one of my cookbooks.

I'm trying to test my cookbook on RHEL 6.5 AMI in EC2 using Test Kitchen.

kitchen create works ok and EC2 instance is created (RHEL 6.5).

When I run kitchen converge, I get the following error:

kitchen converge default-redhat-65
-----> Starting Kitchen (v1.4.0)
-----> Converging ...
Preparing files for transfer

------Exception-------
Class: Kitchen::ActionFailed

Message: Failed to complete #converge action: [undefined method `merge' for #String:0x007f9173ed2748]

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

Stack trace below:

I, [2015-07-27T10:02:27.628246 #27566] INFO -- default-redhat-65: -----> Converging ...
I, [2015-07-27T10:02:27.628656 #27566] INFO -- default-redhat-65: Preparing files for transfer
E, [2015-07-27T10:02:27.628851 #27566] ERROR -- default-redhat-65: Converge failed on instance .
E, [2015-07-27T10:02:27.628939 #27566] ERROR -- default-redhat-65: ------Exception-------
E, [2015-07-27T10:02:27.628953 #27566] ERROR -- default-redhat-65: Class: NoMethodError
E, [2015-07-27T10:02:27.628963 #27566] ERROR -- default-redhat-65: Message: undefined method merge' for #<String:0x007fcdb25766b0> E, [2015-07-27T10:02:27.628991 #27566] ERROR -- default-redhat-65: ------Backtrace------- E, [2015-07-27T10:02:27.629001 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/chef/common_sandbox.rb:271:inprepare_json'
E, [2015-07-27T10:02:27.629009 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/chef/common_sandbox.rb:48:in populate' E, [2015-07-27T10:02:27.629018 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/chef_base.rb:99:increate_sandbox'
E, [2015-07-27T10:02:27.629029 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/chef_zero.rb:52:in create_sandbox' E, [2015-07-27T10:02:27.629038 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/provisioner/base.rb:61:incall'
E, [2015-07-27T10:02:27.629046 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:366:in block in converge_action' E, [2015-07-27T10:02:27.629055 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:incall'
E, [2015-07-27T10:02:27.629063 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in synchronize_or_call' E, [2015-07-27T10:02:27.629071 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:453:inblock in action'
E, [2015-07-27T10:02:27.629080 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in measure' E, [2015-07-27T10:02:27.629088 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:452:inaction'
E, [2015-07-27T10:02:27.629098 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:362:in converge_action' E, [2015-07-27T10:02:27.629107 #27566] ERROR -- default-redhat-65: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:341:inblock in transition_to'

Any ideas?

@zl4bv
Copy link
Contributor

zl4bv commented Jul 27, 2015

Have you defined attributes anywhere in your .kitchen.yml? It looks like it's having trouble parsing them.

@gstankovski
Copy link
Author

Yes! That was it.

I had an attribute defined in single quotes. I changed this to double quotes and it now converges.

For my learning, how did you derive this from the stack trace?

Now its failing due to dependent cookbooks not existing during kitchen converge, so am looking at Berkshelf now to hopefully resolve these.

@zl4bv
Copy link
Contributor

zl4bv commented Jul 27, 2015

For my learning, how did you derive this from the stack trace?

The first line of the stack trace refers to test-kitchen/lib/kitchen/provisioner/chef/common_sandbox.rb:271, which gets attributes from the config and tries to merge a hash into it. The error message undefined method 'merge' for #<String:0x007fcdb25766b0> suggests it was given a string but it expected a hash, so I figured the attributes in your .kitchen.yml file were defined in some mysterious way.

@gstankovski
Copy link
Author

Thanks for the clarification. Much appreciated.

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

No branches or pull requests

2 participants