Bug 483693 - CRM #1891312 system.set_child_channels fails with exception: java.lang.Integer
Summary: CRM #1891312 system.set_child_channels fails with exception: java.lang.Integer
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Network
Classification: Retired
Component: RHN/Web Site
Version: rhn509
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Sebastian Skracic
QA Contact: Red Hat Network Quality Assurance
URL:
Whiteboard: US=75164
Depends On:
Blocks: rhn-sprint30
TreeView+ depends on / blocked
 
Reported: 2009-02-03 02:13 UTC by Issue Tracker
Modified: 2018-10-27 14:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-17 23:30:19 UTC
Embargoed:


Attachments (Terms of Use)

Description Issue Tracker 2009-02-03 02:13:40 UTC
Escalated to Bugzilla from IssueTracker

Comment 1 Issue Tracker 2009-02-03 02:13:41 UTC
State whether Satellite or RHN hosted 
>> RHN Hosted API

Provide clear and concise problem description as it is understood at the time of escalation
>> Problem is being faced with system.set_child_channels API. Systems ID's are being passed in integer array. But looks to be a bug in API. It fails and throws the error -
Fault returned from XML RPC Server, fault code -2: unhandeled internal exception: java.lang.Integer 

Steps to reproduce:
You can use this API to reproduce the issue.
#!/usr/bin/perl

use Frontier::Client;
use Data::Dumper;
my $HOST = 'xmlrpc.rhn.redhat.com';
my $user = 'rhn-username';
my $pass = 'rhn-password';
my $client = new Frontier::Client(url => "http://$HOST/rpc/api");
my $session = $client->call('auth.login',$user, $pass);

my $systemid=1014400330;
my $success = $client->call('system.set_child_channels', $session, $systemid,["6950"]);

You might have to change the systemid and channel id's as per the system you use to test this issue.

Observed behavior
>> #perl set-child-channels.pl
Fault returned from XML RPC Server, fault code -2: unhandeled internal exception: java.lang.Integer 

Desired behavior 
>># perl set-child-channels.pl 
 $VAR1 = '1';

State specific action requested of SEG
>> Would like SEG to pass this on to RHN Hosted

State whether or not a defect in the product is suspected
>> Yes. Looks to be a bug in API. system.set_child_channels 

If there is a proposed patch, make sure it is in unified diff format (diff -pruN)
>>

--- UpdateChildChannelsCommand.java.org	2009-02-02 17:30:09.000000000 +0530
+++ UpdateChildChannelsCommand.java	2009-02-02 17:30:38.000000000 +0530
@@ -73,7 +73,7 @@
          */
         for (Iterator itr = server.getChannels().iterator(); itr.hasNext();) {
             Channel c = (Channel) itr.next();
-            Long cid = c.getId();
+            Long cid = new Long(c.getId().longValue());
             
             if (cids.contains(cid)) {
                 // already subscribed


Attach sosreport
>> Issue related to RHN hosted. Let me know if you still would like to have a sosreport of the system.

Let me know if you need any other information from my end.

Regards,
Paresh

This event sent from IssueTracker by xdmoon  [Support Engineering Group]
 issue 262070

Comment 2 Issue Tracker 2009-02-03 02:13:43 UTC
Thanks for the great report and proposed patch Paresh, I've verified this
occurs on Hosted (but not Satellite 5.2) and the suggested change looks
reasonable (perhaps add a null check).  Sending up to Hosted team.

Xixi


This event sent from IssueTracker by xdmoon  [Support Engineering Group]
 issue 262070

Comment 3 Stephen Herr 2009-02-03 16:38:10 UTC
This is indeed an issue, thanks for the patch. I'll add this to our backlog.

Comment 4 Sebastian Skracic 2009-08-26 10:23:13 UTC
Fixed in 7902c8d6b6b25956cb7603690bb44ede94843c26.

Comment 5 Denise Hughes 2009-08-27 14:55:13 UTC
Verified on webdev.

Test Steps:
1. Access RHN and click on Systems.  Select a system and annotate server id (sid).
2. Click on Alter Channel Subscriptions.  Annotate a child channel id.
3. Access command line and run callAnyMethod command with the server id and child channel id:

python callAnyMethod.py dhughesgit redhat system.setChildChannels 1014793341 [2863]

Results:
No error is displayed.

========================================
Calling: system.setChildChannels
With args:
[1014793341, [2863]]
========================================
Returned:
1


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