Description of problem: With custom cartridge there is an issue where oo-admin-ctl-cartridge and MCO cartridge_list (RPC call) behave differently or cause one another to fail. The line of code causing the issue (is in node/lib/openshift-origin-node/model/cartridge_repository.rb line 441). In short, it's a feature in ruby that initializes a hash key when accessed, in this case, it defaults to an empty hash because of the way we defined the @index hash (in node/lib/openshift-origin-node/model/cartridge_repository.rb lines 107-109). Version-Release number of selected component (if applicable): 2.2 How reproducible: Very Steps to Reproduce: 1. oo-mco rpc openshift cartridge_repository "action=list" -I broker.openshift.domain - it will return a cart list 2. oo-mco rpc -I broker.openshift.local --agent openshift --action cartridge_do --arg action=cartridge-list --arg cartridge=blah - it will return a list 3. oo-mco rpc openshift cartridge_repository "action=list" -I broker.openshift.domain - it will return a cart list This is done to show that the process works out of the box (no custom cartridges). To see the error you need to create a custom cartridge (step 4) 4. go to /usr/libexec/openshift/cartridges and duplicate the cron directory as "cron2" . 4.1. change the version to 1.5 and increment the cart version 4.2. load the cart (oo-admin-cartridge -a install -s . 4.3. restart ruby193-mcollective Steps 5-7 duplicate steps 1-3. 5. oo-mco rpc openshift cartridge_repository "action=list" -I broker.openshift.domain - it will return a cart list 6. oo-mco rpc -I broker.openshift.local --agent openshift --action cartridge_do --arg action=cartridge-list --arg cartridge=blah - it will return a cart list 7. oo-mco rpc openshift cartridge_repository "action=list" -I broker.openshift.domain. - it will NOT work! - However if you restart mcollective, it will work once, again, but then fail the sequence again. - if you remove the cron1.5 cart - it will work all work perfectly again. Actual results: The denoted failure above. Expected results: The RPC call and the oo-tool should work in both case as the should traverse the same code paths. Additional info: (note) The bug related to the actual problem (is this bug), and the (it should offer as a resolution a) complete fix needed (fixing the bug causing the erroneous cartridge index entry, making the broker/node views of cartridges consistent, and how do we handle the broker db entries when importing cartridges that match this use case).
Other than getting a bogus response from oo-mco does this have any other nasty effects?
(In reply to Luke Meyer from comment #2) > Other than getting a bogus response from oo-mco does this have any other > nasty effects? I assume but have not confirmed that cartridge operations might also fail, should the broker make a request.
Okay, after reviewing the case notes, and digging through the code a bit more, I think we should be good with the proposed change that I made. As far as I can tell, everything else is properly choosing the latest version, and the troublesome method is only being called from the mcollective call that the user was running (which is not being used by openshift itself) and from oo-devel-node. I'll pick back up on this early next week and get the patch rebased for origin and reviewed upstream.
https://github.com/openshift/origin-server/pull/6044
Verified and pass on puddle-2-2-2015-03-16 I can reproduced on prior build and the bug are fixed on puddle-2-2-2015-03-16 1) the following error was found in step 7 on prior build oo-mco rpc openshift cartridge_repository "action=list" -I broker.ose22-host.com.cn * [ ============================================================> ] 1 / 1 broker.ose22-host.com.cn Invalid Request Data list failed for (redhat, , , ) undefined method `cartridge_vendor' for {}:Hash 2) The cartridge can be list in step 7 on puddle-2-2-2015-03-16 [root@broker ~]# oo-mco rpc openshift cartridge_repository "action=list" -I node1.ose22-host.com.cn * [ ============================================================> ] 1 / 1 node1.ose22-host.com.cn output: (redhat, ruby, 1.8, 0.0.24.1) (redhat, ruby, 1.9, 0.0.24.1) (redhat, ruby, 2.0, 0.0.24.1) (redhat, jenkins, 1, 0.0.18.1) (redhat, cron, 1.4, 0.0.13) (redhat, cron, 1.5, 0.0.14)
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/RHBA-2015-0779.html