Bug 855717

Summary: Deployments launch fails with error "undefined method `minutes' for nil:NilClass".
Product: [Retired] CloudForms Cloud Engine Reporter: Aziza Karol <akarol>
Component: aeolus-conductorAssignee: Imre Farkas <ifarkas>
Status: CLOSED ERRATA QA Contact: Rehana <aeolus-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.1.0CC: athomas, dajohnso, dmacpher, morazi, tzumainn
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
The Penalty for Failure strategy caused an error when launching an application due to compatibility issues with Ruby. This change fixes the compatibility issues and lauches applications successfully while the Penalty for Failure strategy is enabled.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 15:18:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
err none

Description Aziza Karol 2012-09-10 05:48:37 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.Install aeolus and configure ec2.
2.Build/push and create a deployable.
3.click on luanch button.
  
Actual results:
undefined method `minutes' for nil:NilClass is displayed.see attached screenshot

Expected results:
deployment launch should be successful.


Additional info:
rpm -qa | grep aeolus
aeolus-all-0.13.0-0.20120910030008gitb478e0c.fc16.noarch
rubygem-aeolus-image-0.6.0-0.20120909230031git902c81c.fc16.noarch
aeolus-conductor-daemons-0.13.0-0.20120910030008gitb478e0c.fc16.noarch
aeolus-configure-2.8.0-0.20120909230024gitb24d837.fc16.noarch
aeolus-conductor-0.13.0-0.20120910030008gitb478e0c.fc16.noarch
rubygem-aeolus-cli-0.7.0-0.20120909230025git8a46b3f.fc16.noarch
aeolus-conductor-doc-0.13.0-0.20120910030008gitb478e0c.fc16.noarch

Comment 1 Aziza Karol 2012-09-10 05:49:12 UTC
Created attachment 611297 [details]
err

Comment 3 Tzu-Mainn Chen 2012-09-10 15:38:28 UTC
I can't seem to duplicate this, do you have a stack trace?

Comment 4 Tzu-Mainn Chen 2012-09-10 19:48:58 UTC
Partial stack trace:

/usr/share/aeolus-conductor/vendor/provider_selection/strategies/penalty_for_failure/strategy.rb:41:in `calculate'
/usr/share/aeolus-conductor/vendor/provider_selection/strategies/penalty_for_failure/strategy.rb:39:in `each'
/usr/share/aeolus-conductor/vendor/provider_selection/strategies/penalty_for_failure/strategy.rb:39:in `calculate'
/usr/share/aeolus-conductor/lib/provider_selection/base.rb:85:in `match_exists?'
/usr/share/aeolus-conductor/app/models/deployment.rb:603:in `provider_selection_match_exists?'
/usr/share/aeolus-conductor/app/models/deployment.rb:391:in `check_assemblies_matches'
/usr/share/aeolus-conductor/app/controllers/deployments_controller.rb:89:in `launch_time_params'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.10/lib/action_controller/metal/implicit_render.rb:4:in `send_action'

Re-assigning to ifarkas, as he knows the most about provider selection (I think; Imre, correct me if I'm wrong).  It looks like the problem is with this line:

            failures_count[provider_account] =
              provider_account.failure_count(:from => Time.now - @options[:time_period_minutes].minutes)

I can't figure out how @options is set. . . ?

Comment 5 Imre Farkas 2012-09-11 10:34:38 UTC
It's set in the included module which you can find in lib/provider_selection/chainable_strategy.rb.

Comment 6 Imre Farkas 2012-09-11 11:27:57 UTC
I am unable to replicate this issue too. 

I guess the steps in the description is missing the enabling and the configuration of the Penalty for Failure strategy because the stacktrace is from this strategy.

What was the settings for the Penalty for Failure strategy when you experienced the issue?

Comment 7 Aziza Karol 2012-09-11 12:04:40 UTC
Yes, you are right.I missed this step.The setting for Penalty for Failure strategy was enabled.

if the penalty for Failure strategy is on,we get the error.
I am able to replicate this issue.

Comment 8 Imre Farkas 2012-09-11 13:34:16 UTC
Pull request sent:
https://github.com/aeolusproject/conductor/pull/53

Comment 9 Tzu-Mainn Chen 2012-09-11 16:01:47 UTC
ACK'd and merged to master

Comment 10 Tzu-Mainn Chen 2012-09-11 22:16:16 UTC
Reviewed followup patch to fix minor issue:

https://github.com/aeolusproject/conductor/pull/54

Both patches in master and 1.1.

Comment 12 Aziza Karol 2012-09-17 09:56:08 UTC
Deployment launch successful after enabling Penalty for Failure strategy.

verified:
rpm -qa | grep aeolus
aeolus-conductor-0.13.7-1.el6cf.noarch
aeolus-all-0.13.7-1.el6cf.noarch
rubygem-aeolus-cli-0.7.1-1.el6cf.noarch
aeolus-conductor-doc-0.13.7-1.el6cf.noarch
aeolus-configure-2.8.6-1.el6cf.noarch
rubygem-aeolus-image-0.3.0-12.el6.noarch
aeolus-conductor-daemons-0.13.7-1.el6cf.noarch

Comment 14 errata-xmlrpc 2012-12-04 15:18:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-1516.html