Hide Forgot
+++ This bug was initially created as a clone of Bug #1221059 +++ Description of problem: When trying to rollback a package profile on the "Systems => Provisioning => Snapshots" page, I get a 500 internal server error. This only occurs when there are packages to rollback. A rollback of a group or channel change works. Version-Release number of selected component (if applicable): 2.3 How reproducible: Always Steps to Reproduce: 1. Update package on client registered with Spacewalk 2.3. 2. Try to rollback to an earlier snapshot with an older version of the installed package. 3. After clicking "Rollback to Snapshot" an internal server error is generated Actual results: Return internal server error Expected results: Schedule package rollback Additional info: Using Spacewalk 2.3 on CentOS 7 with Oracle DB Tomcat log shows: May 13, 2015 10:24:51 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [action] in context with path [/rhn] threw exception [java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer] with root cause java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at com.redhat.rhn.domain.server.ServerSnapshot.preparePackagesForSync(ServerSnapshot.java:462) at com.redhat.rhn.domain.server.ServerSnapshot.rollbackPackages(ServerSnapshot.java:369) at com.redhat.rhn.frontend.action.systems.sdc.SnapshotRollbackAction.rollback(SnapshotRollbackAction.java:108) at com.redhat.rhn.frontend.action.systems.sdc.SnapshotRollbackAction.execute(SnapshotRollbackAction.java:79)
looks like we need to pull in this commit: [shughes@dhcp145-192 spacewalk{master}]$ git show a729b9f4b32c0238b210924cadb70739576eed55 commit a729b9f4b32c0238b210924cadb70739576eed55 Author: Tomas Lestach <tlestach> Date: Wed May 20 16:17:59 2015 +0200 expect a Number instead of an Integer addressing issue when Spacewalk with ORA backend fails with: Caused by: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer at com.redhat.rhn.domain.server.ServerSnapshot.preparePackagesForSync(ServerSnapshot.java:462) at com.redhat.rhn.domain.server.ServerSnapshot.rollbackPackages(ServerSnapshot.java:369) at com.redhat.rhn.frontend.action.systems.sdc.SnapshotRollbackAction.rollback(SnapshotRollbackAction.java:108) at com.redhat.rhn.frontend.action.systems.sdc.SnapshotRollbackAction.execute(SnapshotRollbackAction.java:79) diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerSnapshot.java b/java/code/src/com/redhat/rhn/domain/server/ServerSnapshot.java index d4f8a6b..ac0cad7 100644 --- a/java/code/src/com/redhat/rhn/domain/server/ServerSnapshot.java +++ b/java/code/src/com/redhat/rhn/domain/server/ServerSnapshot.java @@ -459,7 +459,7 @@ public class ServerSnapshot extends BaseDomainHelper { PackageMetadata pm = new PackageMetadata(systemPkg, snapshotPkg); int comparison; - switch ((Integer) pkgDiff.get("comparison")) { + switch (((Number) pkgDiff.get("comparison")).intValue()) { case -2: comparison = PackageMetadata.KEY_OTHER_ONLY; break; case -1: comparison = PackageMetadata.KEY_OTHER_NEWER;
Shannon, thanks for the great investigation! Moving to MODIFIED, since according to Comment 1 the fix is available in upstream ... spacewalk.git: a729b9f4b32c0238b210924cadb70739576eed55
I assume the BZ was switched over to NEW by accident, so switching back to MODIFIED.
Reproducer is only with Oracle db. Verified with spacewalk-java-2.3.8-142.el6sat.noarch.rpm
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2016:1200