Bug 1518670 - Internal server error changing kickstart script order
Summary: Internal server error changing kickstart script order
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: WebUI
Version: 2.7
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jiří Dostál
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: 1520664 space28
TreeView+ depends on / blocked
 
Reported: 2017-11-29 12:48 UTC by Brian Long
Modified: 2018-04-20 12:31 UTC (History)
1 user (show)

Fixed In Version: spacewalk-java-2.8.48-1
Clone Of:
: 1520664 (view as bug list)
Environment:
Last Closed: 2018-04-20 12:31:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Brian Long 2017-11-29 12:48:02 UTC
Description of problem:
Add a new kickstart script (specifying a snippet), try to change order, get an internal server error.  catalina.out shows the following:
2017-11-21 08:50:35,755 [TP-Processor12] WARN  org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 23505
2017-11-21 08:50:35,756 [TP-Processor12] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: duplicate key value violates unique constraint "rhn_ksscript_ksid_pos_uq"
2017-11-21 08:50:35,760 [TP-Processor12] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
org.hibernate.exception.ConstraintViolationException: could not update: [com.redhat.rhn.domain.kickstart.KickstartScript#50]

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

How reproducible:
Michael Mráka reproduced it and asked me to open this bug.

Steps to Reproduce:
See the following thread for more details:
https://www.redhat.com/archives/spacewalk-list/2017-November/msg00048.html

Actual results:
Internal Server Error

Expected results:
Script re-ordering should work like it did on Spacewalk 2.6 and prior releases.

Additional info:

Comment 1 Brian Long 2017-12-05 14:00:58 UTC
Any updates on someone taking this bug and providing a fix via nightly build so I can test?  Thanks.

Comment 2 Jiří Dostál 2017-12-07 10:46:01 UTC
Brian,
Please follow to bz1520664 in order to get more information. 

spacewalk 517e9fd1ab8cb6ec749c8876cb87d1c82bdbd620

Comment 3 Brian Long 2017-12-07 11:47:47 UTC
Can I upgrade just the spacewalk-java RPM on my Spacewalk 2.7 server to get the fix?  Or would I need to upgrade to spacewalk 2.8-nightly?

Comment 4 Jiří Dostál 2017-12-07 12:47:38 UTC
Well, if you upgraded only spacewalk-java you would definitely need spacewalk-schema as well (this option may not be the safest). Or you can fork 2.7 repo and cherry-pick my commit mention above and rebuild spacewalk-java rpm. 
You can always upgrade to nightly. Just remember to have a valid backup.

Comment 5 Brian Long 2017-12-07 12:54:30 UTC
To keep my production Spacewalk environment stable, would you consider backporting the fix to Spacewalk 2.7's spacewalk-java RPM and providing me a COPR build?  I could test and then the new build could be placed in 2.7's production repos.  I believe other users will benefit from this bugfix and could use it before Spacewalk 2.8 is released.  Thank you.

Comment 6 Brian Long 2017-12-07 13:39:05 UTC
Specifically, I need the updated package for RHEL 6 platform.  Thanks.

Comment 7 Brian Long 2017-12-11 11:39:09 UTC
Since you only backport Spacewalk security patches, how much of the development environment documented at the following URL do I need to setup in order to cherry-pick your Git commit and build a new spacewalk-java RPM for Spacewalk 2.7?
https://github.com/spacewalkproject/spacewalk/wiki/DevelopmentWorkstationSetup

Or are their alternative instructions I can use to rebuild this one RPM with the fix?  Thanks.

Comment 8 Jiří Dostál 2017-12-11 11:55:56 UTC
Please follow instructions on how to scratch build - https://github.com/spacewalkproject/spacewalk/wiki/HowToScratchBuild

Comment 9 Brian Long 2017-12-11 20:26:49 UTC
The cherry-picked fix works great on my spacewalk 2.7 server.  Thanks!

Comment 10 Jiří Dostál 2018-03-26 12:16:28 UTC
Moving ON_QA

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


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