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

undefined local variable or method `logger' on kitchen create #142

Closed
joelhandwell opened this issue May 31, 2015 · 4 comments · Fixed by #146
Closed

undefined local variable or method `logger' on kitchen create #142

joelhandwell opened this issue May 31, 2015 · 4 comments · Fixed by #146
Assignees
Labels

Comments

@joelhandwell
Copy link

Got following error under Ruby 2.2.2, test-kitchen 1.4.0, kitchen-ec2 2-0.9.3 anyone saw this or come up with work around?

$ kitchen create apache
-----> Starting Kitchen (v1.4.0)
-----> Creating <test-w-apache-ubuntu-1204>...
       Creating <>...
If you are not using an account that qualifies under the AWS
free-tier, you may be charged to run these suites. The charge
should be minimal, but neither Test Kitchen nor its maintainers
are responsible for your incurred costs.

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007fa8f01818e8>]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Following was found in log file:

Kitchen: ------Backtrace-------
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/logging.rb:44:in `block in logger_method'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:139:in `block in debug_if_root_device'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `each'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `find'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `debug_if_root_device'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:120:in `block_device_mappings'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:56:in `ec2_instance_data'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:297:in `submit_server'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:188:in `create'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `public_send'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `block in perform_action'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `call'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `synchronize_or_call'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:453:in `block in action'
Kitchen: /home/Joel/.rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:288:in `measure'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:452:in `action'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `perform_action'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:352:in `create_action'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:341:in `block in transition_to'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `each'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `transition_to'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:127:in `create'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `public_send'
Kitchen: /home/Joel/.gem/ruby/2.2.2/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
Kitchen: ----------------------

@airom
Copy link

airom commented Jun 2, 2015

I am facing the same issue. I have removed and installed the chefdk and kitchen-ec2 numerous times. I have gotten no where.
Here is the log :

$ kitchen converge -l debug
-----> Starting Kitchen (v1.4.0)
D      Berksfile found at /Users/MyUser/source/chef-repo/cookbooks/mycookbook/Berksfile, loading Berkshelf
D      Berkshelf 3.2.4 library loaded
-----> Creating <default-amazon>...
       Creating <>...
If you are not using an account that qualifies under the AWS
free-tier, you may be charged to run these suites. The charge
should be minimal, but neither Test Kitchen nor its maintainers
are responsible for your incurred costs.
D      Creating EC2 Instance..
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007f86494b25b8>]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

D      ------Exception-------
D      Class: Kitchen::ActionFailed
D      Message: Failed to complete #create action: [undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007f86494b25b8>]
D      ---Nested Exception---
D      Class: NameError
D      Message: undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007f86494b25b8>
D      ------Backtrace-------
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/logging.rb:44:in `block in logger_method'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:139:in `block in debug_if_root_device'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `each'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `find'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `debug_if_root_device'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:120:in `block_device_mappings'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:56:in `ec2_instance_data'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:297:in `submit_server'
D      /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:188:in `create'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `public_send'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `block in perform_action'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `call'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `synchronize_or_call'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:453:in `block in action'
D      /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:452:in `action'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `perform_action'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:352:in `create_action'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:341:in `block in transition_to'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `each'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `transition_to'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:138:in `converge'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `public_send'
D      /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
D      ----------------------
$cat .kitchen/logs/kitchen.log
I, [2015-06-02T12:11:14.607015 #43185]  INFO -- Kitchen: -----> Starting Kitchen (v1.4.0)
I, [2015-06-02T12:11:15.191057 #43185]  INFO -- Kitchen: -----> Creating <default-amazon>...
D, [2015-06-02T12:11:16.092931 #43185] DEBUG -- Kitchen: ------Exception-------
D, [2015-06-02T12:11:16.092987 #43185] DEBUG -- Kitchen: Class: Kitchen::ActionFailed
D, [2015-06-02T12:11:16.093007 #43185] DEBUG -- Kitchen: Message: Failed to complete #create action: [undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007f86494b25b8>]
D, [2015-06-02T12:11:16.093025 #43185] DEBUG -- Kitchen: ---Nested Exception---
D, [2015-06-02T12:11:16.093041 #43185] DEBUG -- Kitchen: Class: NameError
D, [2015-06-02T12:11:16.093056 #43185] DEBUG -- Kitchen: Message: undefined local variable or method `logger' for #<Kitchen::Driver::Aws::InstanceGenerator:0x007f86494b25b8>
D, [2015-06-02T12:11:16.093071 #43185] DEBUG -- Kitchen: ------Backtrace-------
D, [2015-06-02T12:11:16.093086 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/logging.rb:44:in `block in logger_method'
D, [2015-06-02T12:11:16.093102 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:139:in `block in debug_if_root_device'
D, [2015-06-02T12:11:16.093129 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `each'
D, [2015-06-02T12:11:16.093146 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `find'
D, [2015-06-02T12:11:16.093161 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:137:in `debug_if_root_device'
D, [2015-06-02T12:11:16.093176 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:120:in `block_device_mappings'
D, [2015-06-02T12:11:16.093192 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/aws/instance_generator.rb:56:in `ec2_instance_data'
D, [2015-06-02T12:11:16.093207 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:297:in `submit_server'
D, [2015-06-02T12:11:16.093222 #43185] DEBUG -- Kitchen: /Users/MyUser/.chefdk/gem/ruby/2.1.0/gems/kitchen-ec2-0.9.3/lib/kitchen/driver/ec2.rb:188:in `create'
D, [2015-06-02T12:11:16.093238 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `public_send'
D, [2015-06-02T12:11:16.093253 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `block in perform_action'
D, [2015-06-02T12:11:16.093269 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `call'
D, [2015-06-02T12:11:16.093284 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:488:in `synchronize_or_call'
D, [2015-06-02T12:11:16.093299 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:453:in `block in action'
D, [2015-06-02T12:11:16.093326 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
D, [2015-06-02T12:11:16.093342 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:452:in `action'
D, [2015-06-02T12:11:16.093358 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:424:in `perform_action'
D, [2015-06-02T12:11:16.093373 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:352:in `create_action'
D, [2015-06-02T12:11:16.093388 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:341:in `block in transition_to'
D, [2015-06-02T12:11:16.093403 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `each'
D, [2015-06-02T12:11:16.093428 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:340:in `transition_to'
D, [2015-06-02T12:11:16.093445 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/instance.rb:138:in `converge'
D, [2015-06-02T12:11:16.093461 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `public_send'
D, [2015-06-02T12:11:16.093476 #43185] DEBUG -- Kitchen: /opt/chefdk/embedded/apps/test-kitchen/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
D, [2015-06-02T12:11:16.093492 #43185] DEBUG -- Kitchen: ----------------------

@opsline-radek
Copy link

I'm getting the same with 0.9.3.

@joelhandwell
Copy link
Author

@tyler-ball Any idea?

@tyler-ball
Copy link
Contributor

Yeah, this is a totally valid bug. I can repro it locally. Another bug fix release incoming!

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

Successfully merging a pull request may close this issue.

4 participants