Bug 1402324

Summary: oo-admin-chk level 1 will be broken when user document is deleted.
Product: OpenShift Container Platform Reporter: Jaspreet Kaur <jkaur>
Component: ocAssignee: Abhishek Gupta <abhgupta>
Status: CLOSED EOL QA Contact: Xingxing Xia <xxia>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 2.2.0CC: abhgupta, aos-bugs, bmeng, decarr, jhou, jkaur, jokerman, libra-bugs, mmccomas, mwhittin, rhowe, rpenta, rthrashe, xtian, zzhao
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1040312 Environment:
Last Closed: 2017-01-13 21:56:19 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:
Bug Depends On: 1040312    
Bug Blocks:    

Description Jaspreet Kaur 2016-12-07 09:11:20 UTC
Description of problem:
Register one account and create one domain. Attempt to delete the user document in mongodb. and then run 'oo-admin-chk -l1' will be failed with error "block in populate_app_hash': undefined method `[]' for nil:NilClass'

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

How reproducible:
always

Steps to Reproduce:
1. Register one account and create one domain.
2. On broker, remove user's document from openshift_broker_dev collection
3. run 'oo-admin-chk -l1 '

Actual results:
oo-admin-chk -l 1

/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.18.2/app/helpers/admin_helper.rb:301:in `block in populate_app_hash': undefined method `[]' for nil:NilClass (NoMethodError)
        from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.18.2/lib/openshift/data_store.rb:27:in `block (2 levels) in find'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/mongo-1.8.1/lib/mongo/cursor.rb:286:in `each'
        from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.18.2/lib/openshift/data_store.rb:26:in `block in find'
        from /opt/rh/ruby193/root/usr/local/share/gems/gems/mongo-1.8.1/lib/mongo/collection.rb:276:in `find'
        from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.18.2/lib/openshift/data_store.rb:25:in `find'
        from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.18.2/app/helpers/admin_helper.rb:173:in `populate_app_hash'
        from /usr/sbin/oo-admin-chk:107:in `<main>'


Expected results:

No this error and will give a prompt like "User '5163a253ba1f068c8500006c' for domain '5163a266ba1f068c8500006e' does not exist in mongo.'

Comment 4 Meng Bo 2016-12-15 10:29:04 UTC
Not sure how did you do the step 2, but seems you corrupt the data structure in mongodb. There is a know issue that modification through the rockmongo may cause this.

Comment 5 Jaspreet Kaur 2016-12-15 10:30:40 UTC
Is there a way to correct it ?

Comment 6 Meng Bo 2016-12-15 10:56:38 UTC
Sorry, I am not sure.

Comment 14 Abhishek Gupta 2017-01-04 19:01:23 UTC
Any updates on this?

Comment 15 Jaspreet Kaur 2017-01-05 05:10:04 UTC
Thanks a lot. Customer added the users deleted and is now resolved.

Comment 16 Rory Thrasher 2017-01-13 21:56:19 UTC
OpenShift Enterprise v2 has officially reached EoL.  This product is no longer supported and bugs will be closed.

Please look into the replacement enterprise-grade container option, OpenShift Container Platform v3.  https://www.openshift.com/container-platform/

More information can be found here: https://access.redhat.com/support/policy/updates/openshift/