Bug 1279584 - Users have nil value for resulting in failed oo-admin-repair
Summary: Users have nil value for resulting in failed oo-admin-repair
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Rory Thrasher
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On: 1272568
Blocks: 1273542
TreeView+ depends on / blocked
 
Reported: 2015-11-09 19:36 UTC by Ryan Howe
Modified: 2019-10-10 10:28 UTC (History)
10 users (show)

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.
Clone Of: 1272568
Environment:
Last Closed: 2016-03-22 16:51:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:0489 0 normal SHIPPED_LIVE Important: Red Hat OpenShift Enterprise 2.2.9 security, bug fix, and enhancement update 2016-03-22 20:49:04 UTC

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


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