Bug 1530644 - [Regression] Quota check for users errors out with "no implicit conversion of nil into String" for service provisioning
Summary: [Regression] Quota check for users errors out with "no implicit conversion of...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.9.0
Assignee: William Fitzgerald
QA Contact: Vatsal Parekh
URL:
Whiteboard:
Depends On: 1509977
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-03 14:50 UTC by Satoe Imaishi
Modified: 2018-03-06 15:08 UTC (History)
9 users (show)

Fixed In Version: 5.9.0.15
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1509977
Environment:
Last Closed: 2018-03-06 15:08:21 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1532502 0 high CLOSED User automate method stays in 'pending' if user doesn't have email 2021-02-22 00:41:40 UTC

Internal Links: 1532502

Comment 3 CFME Bot 2018-01-03 16:31:59 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:
https://github.com/ManageIQ/manageiq/commit/c0d07f2dc102e6cb7be4b35fddbe66817c9e8ce2

commit c0d07f2dc102e6cb7be4b35fddbe66817c9e8ce2
Author:     Greg McCullough <gmccullo>
AuthorDate: Tue Dec 19 20:38:18 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Jan 3 09:50:40 2018 -0500

    Merge pull request #16693 from tinaafitz/miq_provision_email_fix
    
    Fix email issue in miq_provision_quota_mixin active_provision by_owner method.
    (cherry picked from commit 748ba9b820a5bc14e23c34c6c7edfbd56053ea1b)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1530644

 app/models/mixins/miq_provision_quota_mixin.rb               | 5 ++---
 spec/models/miq_provision_request_spec.rb                    | 6 ++++++
 spec/models/service_template_provision_request_quota_spec.rb | 6 ++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

Comment 4 CFME Bot 2018-01-03 17:30:03 UTC
New commit detected on ManageIQ/manageiq-content/gaprindashvili:
https://github.com/ManageIQ/manageiq-content/commit/9c904b621f5f20a7919bf271f90a3341057b496a

commit 9c904b621f5f20a7919bf271f90a3341057b496a
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Dec 20 09:19:11 2017 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Wed Jan 3 11:47:16 2018 -0500

    Merge pull request #230 from billfitzgerald0120/user_quota_email
    
    Check for both owner email and requester email for user quota.
    (cherry picked from commit 25317bff448819df562122d670999db6b2813b94)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1530644

 .../QuotaMethods.class/__methods__/used.rb         | 32 +++++++++----
 .../QuotaMethods.class/__methods__/used_spec.rb    | 54 ++++++++++++++++++++--
 2 files changed, 75 insertions(+), 11 deletions(-)

Comment 6 William Fitzgerald 2018-01-08 16:43:36 UTC
Vatsal,


We have to fail a Service provision when the quota type is set to User and the User doesn’t have an email address. We changed the code to log an error message, raise an error and abort in the Used Automate method.

Automation.log

[----] I, [2018-01-08T03:57:41.597454 #13141:11d913c]  INFO -- : Q-task_id([service_template_provision_request_2]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/used]> Starting
[----] I, [2018-01-08T03:57:42.152490 #13141:11cb80c]  INFO -- : <AEMethod used> Quota Used: {:cpu=>0, :memory=>0, :vms=>0, :storage=>0, :provisioned_storage=>0}
[----] I, [2018-01-08T03:57:42.154985 #13141:11cb80c]  INFO -- : <AEMethod used> Quota source type: user
[----] E, [2018-01-08T03:57:42.161054 #13141:11cb80c] ERROR -- : <AEMethod used> Owner email not specified for User Quota
[----] E, [2018-01-08T03:57:42.161665 #13141:11cb80c] ERROR -- : <AEMethod used> The following error occurred during method evaluation:
[----] E, [2018-01-08T03:57:42.162209 #13141:11cb80c] ERROR -- : <AEMethod used>   RuntimeError: ERROR - Owner email not specified for User Quota
[----] E, [2018-01-08T03:57:42.164711 #13141:11cb80c] ERROR -- : <AEMethod used>   /ManageIQ/System/CommonMethods/QuotaMethods/used:66:in `validate_user_email'
/ManageIQ/System/CommonMethods/QuotaMethods/used:30:in `used'
/ManageIQ/System/CommonMethods/QuotaMethods/used:18:in `main'
[----] E, [2018-01-08T03:57:42.169692 #13141:11cb80c] ERROR -- : Method STDERR: /ManageIQ/System/CommonMethods/QuotaMethods/used:66:in `validate_user_email': ERROR - Owner email not specified for User Quota (RuntimeError)
[----] E, [2018-01-08T03:57:42.170130 #13141:11cb80c] ERROR -- : Method STDERR:         from /ManageIQ/System/CommonMethods/QuotaMethods/used:30:in `used'
[----] E, [2018-01-08T03:57:42.170643 #13141:11cb80c] ERROR -- : Method STDERR:         from /ManageIQ/System/CommonMethods/QuotaMethods/used:18:in `main'
[----] E, [2018-01-08T03:57:42.171123 #13141:11cb80c] ERROR -- : Method STDERR:         from /ManageIQ/System/CommonMethods/QuotaMethods/used:90:in `<main>'
[----] I, [2018-01-08T03:57:42.197715 #13141:11d913c]  INFO -- : Q-task_id([service_template_provision_request_2]) <AEMethod [/ManageIQ/System/CommonMethods/QuotaMethods/used]> Ending

Thanks 

Billy

Comment 7 William Fitzgerald 2018-01-08 17:03:28 UTC
Vatsal,

Moving the ticket back to ON_QA since it is working as designed.

Let me know if you have any questions.

Thanks

Billy

Comment 8 Vatsal Parekh 2018-01-09 06:36:11 UTC
After adding email to the user, this seems to work now on Version 5.9.0.15.20180103231404_ee61a82

Comment 9 William Fitzgerald 2018-01-09 14:31:37 UTC
Vatsal,

I'm not sure why you changed this to assigned. 
Can you change this to verified?  

Thanks

Billy


Note You need to log in before you can comment on or make changes to this bug.