Bug 1279584

Summary: Users have nil value for resulting in failed oo-admin-repair
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: ocAssignee: Rory Thrasher <rthrashe>
Status: CLOSED ERRATA QA Contact: Wei Sun <wsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.2.0CC: aos-bugs, erich, ffranz, jialiu, jokerman, mmccomas, pep, rhowe, rthrashe, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-controller-1.38.5.1-1.el6op Doc Type: Bug Fix
Doc Text:
There were certain situations when a user could have a plan_id that that didn't have a defined plan in the get_plan function. This would cause oo-admin-repair and oo-admin-chk to error out. There is now a check to see if the plan is defined, and if it fails then a default plan will be used. Oo-admin-repair and oo-admin-chk will no longer error out in this situation, and will provide a warning (but not a failure) that there is a plan_id with a plan that hasn't been defined.
Story Points: ---
Clone Of: 1272568 Environment:
Last Closed: 2016-03-22 16:51:23 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:
Bug Depends On: 1272568    
Bug Blocks: 1273542    

Comment 16 openshift-github-bot 2016-01-15 22:56:32 UTC
Commits pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/65f72bd7c6b022a6211c80670c2b40934f0802ec
admin_helper.rb: check for nil plans

Bug 1279584
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1279584

In situations where get_plans returns nil when trying to determine user
capabilities, attempting to populate_user_hash in oo-admin-chk and
oo-admin-repair would result in the script crashing due to an undefined method
exception.  The script will now check if get_plans comes back nil and will drop
back to using the default user capabilities, as well as displaying a warning
that plans will not be used.  This warning will not cause
oo-admin-chk or oo-admin-repair to fail.

https://github.com/openshift/origin-server/commit/cf252f41f6a5ecd58a178a2f1b8956ba78969043
Merge pull request #6348 from thrasher-redhat/bug1279584

Merged by openshift-bot

Comment 20 Rory Thrasher 2016-02-22 22:20:24 UTC
QE,

Can we test that oo-admin-chk will no longer fail when a user has a plan_id that has not been defined by the billing plugin's get_plans?


1. Create a user with a plan_id of 'foo'
2. Run oo-admin-chk

oo-admin-chk should not fail, and should print "Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered."


Puddle:http://etherpad.corp.redhat.com/puddle-2-2-2016-02-19

Thank you

Comment 21 Johnny Liu 2016-02-29 07:37:37 UTC
Verified this bug with rubygem-openshift-origin-controller-1.38.5.1-1.el6op.noarch, and PASS.


# oo-admin-ctl-user -l jialiu --setplan na

# oo-admin-repair --consumed-gears
Started at: 2016-02-29 07:35:24 UTC
Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered.


Finished at: 2016-02-29 07:35:24 UTC
Total time: 0.014s
SUCCESS


# oo-admin-chk 
Started at: 2016-02-29 07:37:05 UTC

Warning: At least one user has a plan id defined, but no plans could be found. Plan-defined user capabilities will not be considered.
User data populated in 0 seconds

Domain data populated in 0 seconds

District data populated in 0 seconds

Total gears found in mongo: 2
Application data populated in 0 seconds

Usage data populated in 0 seconds

Fetched all gears in 20 seconds
Total gears found on the nodes: 2
Total nodes that responded: 1
Checked application gears on nodes in 0 seconds

Checked application gears on nodes (reverse match) in 0 seconds


Finished at: 2016-02-29 07:37:25 UTC
Total time: 20.554s
SUCCESS

Comment 24 errata-xmlrpc 2016-03-22 16:51:23 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.

https://rhn.redhat.com/errata/RHSA-2016-0489.html