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 trying to tag instance before it exists #138

Closed
tyler-ball opened this issue May 29, 2015 · 7 comments · Fixed by #140
Closed

Error trying to tag instance before it exists #138

tyler-ball opened this issue May 29, 2015 · 7 comments · Fixed by #140
Assignees
Labels

Comments

@tyler-ball
Copy link
Contributor

I, [2015-05-28T20:26:05.427218 #22655]  INFO -- Kitchen: -----> Starting Kitchen (v1.4.0)
I, [2015-05-28T20:26:05.856924 #22655]  INFO -- Kitchen: -----> Cleaning up any prior instances of <webapp-ubuntu-1204>
I, [2015-05-28T20:26:05.857180 #22655]  INFO -- Kitchen: -----> Destroying <webapp-ubuntu-1204>...
I, [2015-05-28T20:26:05.858304 #22655]  INFO -- Kitchen: -----> Testing <webapp-ubuntu-1204>
I, [2015-05-28T20:26:05.858469 #22655]  INFO -- Kitchen: -----> Creating <webapp-ubuntu-1204>...
E, [2015-05-28T20:26:07.249275 #22655] ERROR -- Kitchen: ------Exception-------
E, [2015-05-28T20:26:07.249342 #22655] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2015-05-28T20:26:07.249385 #22655] ERROR -- Kitchen: Message: Failed to complete #create action: [The instance ID 'i-e55fc612' does not exist]
E, [2015-05-28T20:26:07.249426 #22655] ERROR -- Kitchen: ---Nested Exception---
E, [2015-05-28T20:26:07.249476 #22655] ERROR -- Kitchen: Class: Aws::EC2::Errors::InvalidInstanceIDNotFound
E, [2015-05-28T20:26:07.249516 #22655] ERROR -- Kitchen: Message: The instance ID 'i-e55fc612' does not exist
E, [2015-05-28T20:26:07.249554 #22655] ERROR -- Kitchen: ------Backtrace-------
E, [2015-05-28T20:26:07.249595 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call'
E, [2015-05-28T20:26:07.249640 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/seahorse/client/plugins/param_conversion.rb:22:in `call'
E, [2015-05-28T20:26:07.249708 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
E, [2015-05-28T20:26:07.249756 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/seahorse/client/plugins/response_target.rb:18:in `call'
E, [2015-05-28T20:26:07.249837 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/seahorse/client/request.rb:70:in `send_request'
E, [2015-05-28T20:26:07.249889 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-core-2.0.46/lib/seahorse/client/base.rb:216:in `block (2 levels) in define_operation_methods'
E, [2015-05-28T20:26:07.249937 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-resources-2.0.46/lib/aws-sdk-resources/request.rb:24:in `call'
E, [2015-05-28T20:26:07.250001 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-resources-2.0.46/lib/aws-sdk-resources/operations.rb:41:in `call'
E, [2015-05-28T20:26:07.250061 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-resources-2.0.46/lib/aws-sdk-resources/operations.rb:87:in `call'
E, [2015-05-28T20:26:07.250108 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/aws-sdk-resources-2.0.46/lib/aws-sdk-resources/operation_methods.rb:19:in `block in add_operation'
E, [2015-05-28T20:26:07.250148 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/bundler/gems/kitchen-ec2-15121090abcb/lib/kitchen/driver/ec2.rb:329:in `tag_server'
E, [2015-05-28T20:26:07.250189 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/bundler/gems/kitchen-ec2-15121090abcb/lib/kitchen/driver/ec2.rb:191:in `create'
E, [2015-05-28T20:26:07.250228 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `public_send'
E, [2015-05-28T20:26:07.250267 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `block in perform_action'
E, [2015-05-28T20:26:07.250306 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `call'
E, [2015-05-28T20:26:07.250367 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:488:in `synchronize_or_call'
E, [2015-05-28T20:26:07.250445 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:453:in `block in action'
E, [2015-05-28T20:26:07.250512 #22655] ERROR -- Kitchen: /home/travis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-05-28T20:26:07.250566 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:452:in `action'
E, [2015-05-28T20:26:07.250607 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:424:in `perform_action'
E, [2015-05-28T20:26:07.250647 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:352:in `create_action'
E, [2015-05-28T20:26:07.250687 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:341:in `block in transition_to'
E, [2015-05-28T20:26:07.250726 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `each'
E, [2015-05-28T20:26:07.250764 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:340:in `transition_to'
E, [2015-05-28T20:26:07.250802 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:160:in `verify'
E, [2015-05-28T20:26:07.250862 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:189:in `block in test'
E, [2015-05-28T20:26:07.250901 #22655] ERROR -- Kitchen: /home/travis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-05-28T20:26:07.250940 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/instance.rb:185:in `test'
E, [2015-05-28T20:26:07.250978 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `public_send'
E, [2015-05-28T20:26:07.251017 #22655] ERROR -- Kitchen: /home/travis/.rvm/gems/ruby-2.1.5/gems/test-kitchen-1.4.0/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
E, [2015-05-28T20:26:07.251056 #22655] ERROR -- Kitchen: ----------------------
@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

@tyler-ball Weirdly, this still seems to be happening periodically on the chef kitchen-tests. For example, https://travis-ci.org/chef/chef/jobs/73639153 .

I checked, and the version we're pulling from kitchen-tests/Gemfile pulls from master, so I don't think it's due to an old version.

I'm a little confused why we're not getting to see the stacktrace from the job though! Can't be sure it's exactly the same stacktrace, just that it's the same error.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

Found the stack!

I, [2015-07-31T23:25:58.966892 #2385]  INFO -- Kitchen: -----> Starting Kitchen (v1.4.1)
I, [2015-07-31T23:25:59.341292 #2385]  INFO -- Kitchen: -----> Cleaning up any prior instances of <webapp-ubuntu-1204>
I, [2015-07-31T23:25:59.341575 #2385]  INFO -- Kitchen: -----> Destroying <webapp-ubuntu-1204>...
I, [2015-07-31T23:25:59.342771 #2385]  INFO -- Kitchen: -----> Testing <webapp-ubuntu-1204>
I, [2015-07-31T23:25:59.342946 #2385]  INFO -- Kitchen: -----> Creating <webapp-ubuntu-1204>...
E, [2015-07-31T23:26:00.622472 #2385] ERROR -- Kitchen: ------Exception-------
E, [2015-07-31T23:26:00.622543 #2385] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2015-07-31T23:26:00.622594 #2385] ERROR -- Kitchen: Message: Failed to complete #create action: [stopped waiting due to an unexpected error: The instance ID 'i-2d4b8adb' does not exist]
E, [2015-07-31T23:26:00.622643 #2385] ERROR -- Kitchen: ---Nested Exception---
E, [2015-07-31T23:26:00.622691 #2385] ERROR -- Kitchen: Class: Aws::Waiters::Errors::UnexpectedError
E, [2015-07-31T23:26:00.622737 #2385] ERROR -- Kitchen: Message: stopped waiting due to an unexpected error: The instance ID 'i-2d4b8adb' does not exist
E, [2015-07-31T23:26:00.622785 #2385] ERROR -- Kitchen: ------Backtrace-------
E, [2015-07-31T23:26:00.622838 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:111:in `block in poll'
E, [2015-07-31T23:26:00.622892 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:101:in `loop'
E, [2015-07-31T23:26:00.622945 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:101:in `poll'
E, [2015-07-31T23:26:00.623038 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:91:in `block (2 levels) in wait'
E, [2015-07-31T23:26:00.623099 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:90:in `catch'
E, [2015-07-31T23:26:00.623159 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:90:in `block in wait'
E, [2015-07-31T23:26:00.623215 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:89:in `catch'
E, [2015-07-31T23:26:00.623265 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/waiters/waiter.rb:89:in `wait'
E, [2015-07-31T23:26:00.623313 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/aws-sdk-core-2.1.11/lib/aws-sdk-core/client_waiters.rb:110:in `wait_until'
E, [2015-07-31T23:26:00.623371 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/bundler/gems/kitchen-ec2-9b29fcfca091/lib/kitchen/driver/ec2.rb:196:in `create'
E, [2015-07-31T23:26:00.623419 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:424:in `public_send'
E, [2015-07-31T23:26:00.623466 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:424:in `block in perform_action'
E, [2015-07-31T23:26:00.623513 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:488:in `call'
E, [2015-07-31T23:26:00.623561 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:488:in `synchronize_or_call'
E, [2015-07-31T23:26:00.623609 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:453:in `block in action'
E, [2015-07-31T23:26:00.623668 #2385] ERROR -- Kitchen: /home/travis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-07-31T23:26:00.623719 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:452:in `action'
E, [2015-07-31T23:26:00.623767 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:424:in `perform_action'
E, [2015-07-31T23:26:00.623840 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:352:in `create_action'
E, [2015-07-31T23:26:00.623889 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:341:in `block in transition_to'
E, [2015-07-31T23:26:00.623937 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:340:in `each'
E, [2015-07-31T23:26:00.623985 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:340:in `transition_to'
E, [2015-07-31T23:26:00.624032 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:160:in `verify'
E, [2015-07-31T23:26:00.624079 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:189:in `block in test'
E, [2015-07-31T23:26:00.624126 #2385] ERROR -- Kitchen: /home/travis/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/benchmark.rb:279:in `measure'
E, [2015-07-31T23:26:00.624174 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/instance.rb:185:in `test'
E, [2015-07-31T23:26:00.624223 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/command.rb:176:in `public_send'
E, [2015-07-31T23:26:00.624277 #2385] ERROR -- Kitchen: /home/travis/build/chef/chef/kitchen-tests/vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.4.1/lib/kitchen/command.rb:176:in `block (2 levels) in run_action'
E, [2015-07-31T23:26:00.624329 #2385] ERROR -- Kitchen: ----------------------

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

Yep, it's the same issue, just an the fix wasn't quite enough. It looks to me like it's stopping right away instead of looping like it's supposed to..

https://github.com/test-kitchen/kitchen-ec2/blob/master/lib/kitchen/driver/ec2.rb#L196-L199

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

According to AWS, the default delay for :instance_exists is 5s.

But I'm seeing it stop instantaneously!

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

Further investigation: the error being raised is UnexpectedError, which the docs say are raised when the encountered error isn't one that was expected to come back from the API. The error itself is "The instance ID 'i-2d4b8adb' does not exist." My best guess is that :instance_exists is what we want, not :instance_running (which is what we're doing).

A barely related point: it would be more efficient to rescue the error when tagging and do the loop there, because most of the time the tag succeeds out of the gate.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

OK, yeah, :instance_running doesn't do what we want, but :instance_exists does.

@jkeiser
Copy link
Contributor

jkeiser commented Aug 3, 2015

I see why we were doing instance_running ... so that it would wait for the instance to be running. We need to loop until instance is running as well as until it exists. Blargh.

Side note: this is one reason I hate unit tests. They give you false confidence. (The tests tested that we called the AWS functions we wanted to call, but not whether we'd accomplished what we wanted.)

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.

3 participants