Created attachment 404494 [details] python script to reproduce Description of problem: Attempting to call listSystemChannels through the API results in HTTP 500 Internal Server Error Version-Release number of selected component (if applicable): 5.2.1 How reproducible: Always Steps to Reproduce: 1. Execute attached python script (reproduce.py) to reproduce in WEBQA Actual results: xmlrpclib.ProtocolError: <ProtocolError for rhn.webqa.redhat.com/rpc/api: 500 Internal Server Error> Expected results: Either - 1. Returns a proper list with the system channels or 2. Returns an xmlrpc fault (similiar to xmlrpclib.Fault: <Fault -208: 'No such system'>) in the event Something Bad happens Additional info: See attached stack for server side error
Created attachment 404495 [details] stack from java01.rhn.qa.ext.intdev.redhat.com
Hmm, well the listSystemChannels seems to be working for all the systems I've tried it on. The stack trace you've posted seems to indicate that the query (which does a select based on org_id and system_id) was getting multiple results back. I don't see how that's possible given that system_id is supposed to be unique, and a database refresh seems to have washed the bad data away. If this arises again feel free to re-open the bug, but for now I'm going to assume that the data just got messed up somehow and everything is working as expected.
Upon further investigation, this is a result of a very rare but previously-known issue where we get duplicate data in the hardware profile tables. See BZ 235385 or the one it was closed as a dupe of, BZ 237898. BZ 237898 has scripts in it to remove the duplicate data from the database, we should run those scripts the next time we release.
Upon even further investigation, there are no duplicates currently in either webqa or production. So there's no point in running the clean-up script. Closing as a dupe of 235385. *** This bug has been marked as a duplicate of bug 235385 ***