Bug 606555 - Misleading error message if arguments passed to RHN API call is of incorrectly type
Summary: Misleading error message if arguments passed to RHN API call is of incorrectl...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: API
Version: 530
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Petr Sklenar
URL:
Whiteboard: Fixed in the 5.4.0 Release - GA'd 201...
Depends On:
Blocks: sat540-canfix
TreeView+ depends on / blocked
 
Reported: 2010-06-21 23:19 UTC by Xixi
Modified: 2018-10-27 13:24 UTC (History)
5 users (show)

Fixed In Version: spacewalk-java-1.2.38-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-10-28 15:03:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xixi 2010-06-21 23:19:26 UTC
Description of problem:
The RHN API returns "Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: Could not find method" error if the data structure passed to API call is incorrectly typed, this is expected (as inherent in Java), but is misleading to the user.  Would be better to throw and catch another exception with a more helpful/instructive error message (possibly type checking or a generic message to check type?), if possible.

Example:
Write an API for channel.software.addPackages and instead of passing a reference of array, pass an array. So instead of \@addPkg pass @addPkg
Example:
my $success = $client->call('channel.software.addPackages', $session, 'activationkey-test',@addPkg);

This will return:
Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: Could not find method addPackages in class class com.redhat.rhn.frontend.xmlrpc.channel.software.ChannelSoftwareHandler

Version-Release number of selected component (if applicable):
Red Hat Network (RHN) Satellite 5.3.0

How reproducible:
Always.

Steps to Reproduce:
See above.

Actual results:
See above.

Expected results:
See above - a more helpful/instructive error message (possibly type checking or a generic message to suggest user to check type?).

Additional info:

Comment 1 Clifford Perry 2010-07-12 17:02:19 UTC
Lower priority. This may not be easy to implement or cause regressions in designing since it would be at a global level, or touching every lots of code everywhere. 

Cliff.

Comment 2 Tomas Lestach 2010-09-10 10:10:26 UTC
Adding information about the parameter types into the exception.
So, the example provided in #Description would return following (@addPkg contains two items):

Fault returned from XML RPC Server, fault code -1: redstone.xmlrpc.XmlRpcFault: Could not find method: addPackages in class: com.redhat.rhn.frontend.xmlrpc.channel.software.ChannelSoftwareHandler with params: [java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer]


Hope this helps the user to identify the problem quicker.

spacewalk.git: 079f75dfb66a8daf0b051d972c5d8bec6645861e

Comment 5 Clifford Perry 2010-10-28 15:03:10 UTC
The 5.4.0 RHN Satellite and RHN Proxy release has occurred. This issue has been resolved with this release. 


RHEA-2010:0801 - RHN Satellite Server 5.4.0 Upgrade
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10332

RHEA-2010:0803 - RHN Tools enhancement update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10333

RHEA-2010:0802 - RHN Proxy Server 5.4.0 bug fix update
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10334

RHEA-2010:0800 - RHN Satellite Server 5.4.0
https://rhn.redhat.com/rhn/errata/details/Details.do?eid=10335

Docs are available:

http://docs.redhat.com/docs/en-US/Red_Hat_Network_Satellite/index.html 

Regards,
Clifford


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