Bug 483693 - CRM #1891312 system.set_child_channels fails with exception: java.lang.Integer
CRM #1891312 system.set_child_channels fails with exception: java.lang.Integer
Status: CLOSED CURRENTRELEASE
Product: Red Hat Network
Classification: Red Hat
Component: RHN/Web Site (Show other bugs)
rhn509
All Linux
medium Severity medium
: ---
: ---
Assigned To: Sebastian Skracic
Red Hat Network Quality Assurance
US=75164
:
Depends On:
Blocks: rhn-sprint30
  Show dependency treegraph
 
Reported: 2009-02-02 21:13 EST by Issue Tracker
Modified: 2010-10-23 03:26 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-17 19:30:19 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 Issue Tracker 2009-02-02 21:13:40 EST
Escalated to Bugzilla from IssueTracker
Comment 1 Issue Tracker 2009-02-02 21:13:41 EST
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-02 21:13:43 EST
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 11:38:10 EST
This is indeed an issue, thanks for the patch. I'll add this to our backlog.
Comment 4 Sebastian Skracic 2009-08-26 06:23:13 EDT
Fixed in 7902c8d6b6b25956cb7603690bb44ede94843c26.
Comment 5 Denise Hughes 2009-08-27 10:55:13 EDT
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.