Bug 492903 - Custom channel created through api does not show up in Channels tab
Summary: Custom channel created through api does not show up in Channels tab
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 530
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Pradeep Kilambi
QA Contact: Sayli Karmarkar
URL:
Whiteboard:
Depends On:
Blocks: 456996 486216
TreeView+ depends on / blocked
 
Reported: 2009-03-30 16:19 UTC by Sayli Karmarkar
Modified: 2015-03-23 01:09 UTC (History)
3 users (show)

Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-09-10 18:15:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sayli Karmarkar 2009-03-30 16:19:43 UTC
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 16:22:20 UTC
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-04-01 00:16:20 UTC
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-04-01 00:18:45 UTC
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 14:10:24 UTC
git commits:

backend: efa37dfc2f22740b44ce93d1e02c3541d75d244f, 7c5694297bdf5767eb2346840480de4092497c22

api/ui: cf74d0129af6493970fc715307eb0aab410dea8c

Comment 5 Sayli Karmarkar 2009-04-06 20:48:36 UTC
verified.

Comment 6 Sayli Karmarkar 2009-04-15 16:39:48 UTC
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 16:51:03 UTC
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 18:11:24 UTC
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 17:31:13 UTC
verified.

Comment 12 Milan Zázrivec 2009-09-03 13:43:01 UTC
Verified in stage -> RELEASE_PENDING

Comment 13 Brandon Perkins 2009-09-10 18:15:25 UTC
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.