Bug 1179006 - oo-admin-ctl-cartridge and MCO cartridge_list (RPC call) behave differently or cause one another to fail
Summary: oo-admin-ctl-cartridge and MCO cartridge_list (RPC call) behave differently ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1179012
TreeView+ depends on / blocked
 
Reported: 2015-01-05 21:24 UTC by Eric Rich
Modified: 2019-05-20 11:25 UTC (History)
9 users (show)

Fixed In Version: rubygem-openshift-origin-node-1.35.4.1-1.el6op
Doc Type: Bug Fix
Doc Text:
Previously, it was possible for the MCO cartridge_list RPC call to fail with an "Invalid Request Data" error when custom cartridges were installed. This was due to erroneous cartridge index entries being created. This bug fix updates the node logic, and as a result the RPC call now returns as expected.
Clone Of:
: 1179012 (view as bug list)
Environment:
Last Closed: 2015-04-06 17:06:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0779 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.5 bug fix and enhancement update 2015-04-06 21:05:45 UTC

Description Eric Rich 2015-01-05 21:24:22 UTC
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).

Comment 2 Luke Meyer 2015-01-06 19:56:13 UTC
Other than getting a bogus response from oo-mco does this have any other nasty effects?

Comment 3 Eric Rich 2015-01-06 20:04:12 UTC
(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.

Comment 4 Jason DeTiberus 2015-01-09 22:31:24 UTC
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.

Comment 5 Jason DeTiberus 2015-01-14 17:48:22 UTC
https://github.com/openshift/origin-server/pull/6044

Comment 11 Anping Li 2015-03-18 05:22:46 UTC
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)

Comment 15 errata-xmlrpc 2015-04-06 17:06:07 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/RHBA-2015-0779.html


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