Bug 492903 - Custom channel created through api does not show up in Channels tab
Custom channel created through api does not show up in Channels tab
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API (Show other bugs)
530
All Linux
medium Severity high
: ---
: ---
Assigned To: Pradeep Kilambi
Sayli Karmarkar
:
Depends On:
Blocks: 456996 486216
  Show dependency treegraph
 
Reported: 2009-03-30 12:19 EDT by Sayli Karmarkar
Modified: 2015-03-22 21:09 EDT (History)
3 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 14:15:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sayli Karmarkar 2009-03-30 12:19:43 EDT
Description of problem:
Custom channel created through api does not show up in Channels tab. Also, if you try executing a script something like:

import xmlrpclib
server = xmlrpclib.Server("http://saturl/rpc/api", verbose = 0)
key = server.auth.login("admin", "password")
server.channel.software.create(key, "foobar", "foobar-name", "foobar-summary", "channel-ia32", "")
server.channel.software.getDetails(key, "foobar")

it returns "xmlrpclib.Fault: <Fault -210: 'redstone.xmlrpc.XmlRpcFault: No such channel'>".

Now, if we click on "manage software channels", we can see the channel over there and after that we can see it in "channels" tab as well. Everything works smoothly after this. So, if we run above script after this, it will return details of newly created channels.
Comment 1 Sayli Karmarkar 2009-03-30 12:22:20 EDT
Increasing severity of the bug to "high" because this means none of the custom channel related api involving channel creation would succeed.
Comment 2 Brad Buckingham 2009-03-31 20:16:20 EDT
After further investigation, found that the channel created is not showing up from the Channel tab because there does not exist a proper record in the rhnPrivateChannelFamily.

Visiting the "Manage Software Channels" page fixes this, because when this page is loaded it will add the records (if needed) to rhnChannelFamily and rhnPrivateChannelFamily.

This bug was actually introduced by the fix for bug 486018.  

In the past, when a channel was created (via CreateChannelCommand.create()) entries were added to rhnChannelFamily/rhnPrivateChannelFamily via the ChannelFamilyFactory (via updateFamilyPermissions).

The fix implemented for bug 486018 added updated org creation logic to add a record to rhnChannelFamily, but did not add an entry to rhnPrivateChannelFamily. As a result, when a channel was created using the API the ChannelFamilyFactory will now skip creating the rhnPrivateChannelFamily record based on the existance of the proper record in rhnChannelFamily.

In order to fix this, will be updating the following scenarios to use the ChannelFamilyFactory for the following scenarios:
- org creation (ui & api - org.createOrg)
- channel creation (api - channel.software.create)
- channel cloning (api - channel.software.clone)
Comment 3 Brad Buckingham 2009-03-31 20:18:45 EDT
In addition, the backend code is also being updated to ensure that these entries are added for org=1.
Comment 4 Brad Buckingham 2009-04-01 10:10:24 EDT
git commits:

backend: efa37dfc2f22740b44ce93d1e02c3541d75d244f, 7c5694297bdf5767eb2346840480de4092497c22

api/ui: cf74d0129af6493970fc715307eb0aab410dea8c
Comment 5 Sayli Karmarkar 2009-04-06 16:48:36 EDT
verified.
Comment 6 Sayli Karmarkar 2009-04-15 12:39:48 EDT
This doesn't appear to be a problem for newly created orgs, but it seems to
reappear for org=1. It seems something is changed from previous iso which has
altered the behavior. Moving to fails_qa so that we can resolve this issue.
Comment 7 Brad Buckingham 2009-04-15 12:51:03 EDT
Satellite-5.3.0-RHEL5-re20090414.0-i386-embedded-oracle.iso

Saw this problem after the initial install, satellite-sync followed by a run of the API tests on org=1.

Created a second org, ran the API tests and verified that the the run was successful.  Also, verified that the rhnPrivateChannelFamily was populated for that new org.

Since this issue appears associated only with org=1, I'm reassigning it to Pradeep for further investigation.
Comment 9 Sayli Karmarkar 2009-04-27 14:11:24 EDT
The fix seems to be present but the issue can be reproduced on latest satellite. 

import xmlrpclib
server = xmlrpclib.Server("http://saturl/rpc/api", verbose = 0)
key = server.auth.login("admin", "password")
server.channel.software.create(key, "foobar", "foobar-name", "foobar-summary",
"channel-ia32", "")
server.channel.software.getDetails(key, "foobar")

it returns "xmlrpclib.Fault: <Fault -210: 'redstone.xmlrpc.XmlRpcFault: No such
channel'>".
Comment 11 Sayli Karmarkar 2009-05-11 13:31:13 EDT
verified.
Comment 12 Milan Zázrivec 2009-09-03 09:43:01 EDT
Verified in stage -> RELEASE_PENDING
Comment 13 Brandon Perkins 2009-09-10 14:15:25 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

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