Bug 1524211

Summary: Internal Server Error When Setting Kickstart Package List via Spacewalk API
Product: [Community] Spacewalk Reporter: jsanders
Component: ServerAssignee: Jiří Dostál <jdostal>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.7CC: jdostal
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-20 12:32:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1564160    
Attachments:
Description Flags
Tomcat Log none

Description jsanders 2017-12-10 20:05:03 UTC
Created attachment 1365706 [details]
Tomcat Log

Description of problem:
Calling the kickstart.profile.software.setSoftwareList method of the Spacewalk API via XMLRPC returns an internal server error to the client.  On the server side, the catalina.out logs show a org.hibernate.NonUniqueObjectException.  Full exception log is attached.

Version-Release number of selected component (if applicable):
2.7

How reproducible:
Every time

Steps to Reproduce:
1. Have a preexisting kickstart profile on Spacewalk server
2. Using Python 2.7 and xmlrpclib v1.0.1, create instance of xmlrpclib.Server with Spacewalk API URL
3. Authenticate Server instance using auth.login method to get sessionKey
4. Call kickstart.profile.software.setSoftwareList() API method with sessionKey from step 3, ksLabel from step 1, and any list of packages

Actual results:
Spacewalk server returns Internal Server Error message to client.
Spacewalk server throws org.hibernate.NonUniqueObjectException

Expected results:
Spacewalk server updates kickstart profile package list with packages listed in packageList parameter of setSoftwareList() function.

Additional info:
This issue seems closely related to this other bug: https://bugzilla.redhat.com/show_bug.cgi?id=1520664

Comment 1 Jiří Dostál 2017-12-12 07:33:00 UTC
I confirm that this is related to bz1520664

Comment 2 Jiří Dostál 2018-01-03 09:31:39 UTC
spacewalk 8f3473214cbe73997aa23e69663aff732f2a4940

Comment 3 jsanders 2018-01-03 23:56:29 UTC
Thank you!  I was able to apply the patch to 2.7 with slight modification.  I am now able to update a profile software list via XMLRPC.

Comment 4 Jiří Dostál 2018-03-26 12:17:01 UTC
Moving ON_QA

Comment 5 Jiří Dostál 2018-04-20 12:32:16 UTC
Spacewalk 2.8 has been released.
https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes28