Bug 1044417 - oo-admin-chk will be broken when checking gears with tracked additional storage in applications collection but not in usage_records
Summary: oo-admin-chk will be broken when checking gears with tracked additional stora...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: Ravi Sankar
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-18 09:41 UTC by zhaozhanqi
Modified: 2015-05-15 00:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-26 19:08:58 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description zhaozhanqi 2013-12-18 09:41:24 UTC
Description of problem:
Given one jbosseap created.Add more storage to the cartridge to make the storage more than tracked storage. After that there will be created user_record with user_type 'ADDTL_FS_GB'. if deleting this record. run 'oo-admin-chk -l 1' will be broken with errors "/usr/sbin/oo-admin-chk:798:in `block in <main>': undefined method `gears' for nil:NilClass (NoMethodError)'

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

How reproducible:
always

Steps to Reproduce:
1.create one jbosseap app
2.setup the user tracked stoage to 10G via oo-admin-ctl-user
oo-admin-ctl-user -l $user --setmaxtrackedstorage 10

3.Add more than tracked number storage to the cartridge
 rhc cartridge-storage jbosseap-6 eap --add  11GB
4. Delete the record in collection 'user_record' with user_type 'ADDTL_FS_GB'
   db.user_record.remove({"usage_type": "ADDTL_FS_GB"})
5. run 'oo-admin-chk -l 1'


Actual results:
oot@ip-10-183-145-38 openshift]# oo-admin-chk -l1
Started at: 2013-12-18 03:30:47 -0500
Time to fetch mongo data: 0.043s
Total gears found in mongo: 4
Time to get all gears from nodes: 20.763s
Total gears found on the nodes: 4
Total nodes that responded : 1
Time to get all sshkeys for all gears from nodes: 20.066s
Total gears found on the nodes: 4
Total nodes that responded : 1
/usr/sbin/oo-admin-chk:798:in `block in <main>': undefined method `gears' for nil:NilClass (NoMethodError)
	from /usr/sbin/oo-admin-chk:782:in `each'
	from /usr/sbin/oo-admin-chk:782:in `<main>'


Expected results:
no this error and should detect like 'Found addtl storage for gear Id '51b938f3c9c6fe945b000021' but could not find corresponding usage record'

Additional info:

Comment 1 Ravi Sankar 2013-12-18 19:52:41 UTC
Fixed in master https://github.com/openshift/origin-server/pull/4374

Comment 3 zhaozhanqi 2013-12-19 02:40:29 UTC
Tested this issue on devenv_4154, it did not be fixed.

if adding more storage to the cartridge to make the storage more than tracked storage and then it will be block.

1.create one jbosseap app
2.setup the user tracked stoage to 10G via oo-admin-ctl-user
oo-admin-ctl-user -l $user --setmaxtrackedstorage 10

3.Add more than tracked number storage to the cartridge
 rhc cartridge-storage jbosseap-6 eap --add  11GB
4. oo-admin-chk -l 1

oo-admin-chk -l 1
Started at: 2013-12-19 02:31:20 UTC

Total gears found in mongo: 1
Total gears found on the nodes: 1
Total nodes that responded: 1
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.19.2/app/helpers/admin_helper.rb:618:in `block in find_app_storage_usage_record_inconsistencies': undefined local variable or method `usage_storage_hash' for main:Object (NameError)
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.19.2/app/helpers/admin_helper.rb:617:in `each'
	from /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-controller-1.19.2/app/helpers/admin_helper.rb:617:in `find_app_storage_usage_record_inconsistencies'
	from /usr/sbin/oo-admin-chk:172:in `<main>'

Comment 4 Ravi Sankar 2013-12-19 23:40:38 UTC
Fixed in https://github.com/openshift/origin-server/pull/4385

Comment 5 openshift-github-bot 2013-12-20 06:00:28 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/5054bd1b21fe1b81596d6dbf412fe4885cfd69a5
Bug 1044417 - Fix storage inconsistencies in oo-admin-chk

Comment 6 zhaozhanqi 2013-12-20 11:31:27 UTC
Check this bug on devenv_4162, it has been fixed.


1.create one jbosseap app
2.setup the user tracked stoage to 10G via oo-admin-ctl-user
oo-admin-ctl-user -l $user --setmaxtrackedstorage 10
oo-admin-ctl-user -l $user --setmaxuntrackedstorage 10


3.Add more than tracked number storage to the cartridge
 rhc cartridge-storage jbosseap-6 eap --add  7GB
 rhc cartridge-storage jbosseap-6 eap --add  5GB

4. delete the user_record with user_type 'ADDTL_FS_GB'


5. oo-admin-chk -l 1

oo-admin-chk -l 1
Started at: 2013-12-20 11:29:07 UTC

Total gears found in mongo: 3
Total gears found on the nodes: 3
Total nodes that responded: 1

Finished at: 2013-12-20 11:29:49 UTC
Total time: 41.457s
Found addtl storage mismatch for gear Id '52b4287f2a2b96e76c00004e', 8 in usage record vs 11 for corresponding gear in the application.
Found 1 un-ended records in usage collection for gear Id '52b4287f2a2b96e76c00004e' but could not find corresponding records in usage_records.
FAILED
Please refer to the oo-admin-repair tool to resolve some of these inconsistencies


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