Bug 1226423

Summary: Schedule - Cancel errata deployment with large number of systems fails with internal error
Product: [Community] Spacewalk Reporter: Michael Hoffman <michaelchoffman>
Component: ServerAssignee: Tomas Lestach <tlestach>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.2CC: eherget
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-25 13:57:32 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: 1484117    

Description Michael Hoffman 2015-05-29 17:59:07 UTC
Description of problem:
Internal Server Error while cancelling errata deployment

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

How reproducible:
1. schedule errata to be applied with large number of systems.
In this case 1500
2. cancel the deployment via the schedule screen
3. confirm cancel
4. error is raised

Actual results:
internal server error is raised

Expected results:
cancel errata deployment

Additional info:
tomcat localhost.log
SEVERE: Servlet.service() for servlet action threw exception
java.sql.SQLSyntaxErrorException: ORA-01795: maximum number of expressions in a list is 1000

        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:765)
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:662)
        at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:546)
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:440)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
        at org.hibernate.loader.Loader.doQuery(Loader.java:674)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
        at org.hibernate.loader.Loader.doList(Loader.java:2220)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
        at org.hibernate.loader.Loader.list(Loader.java:2099)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
        at com.redhat.rhn.domain.kickstart.KickstartFactory.failKickstartSessions(KickstartFactory.java:1080)
        at com.redhat.rhn.manager.action.ActionManager.cancelAction(ActionManager.java:275)
        at com.redhat.rhn.manager.action.ActionManager.cancelActions(ActionManager.java:234)
        at com.redhat.rhn.frontend.action.schedule.PendingActionsDel

Comment 1 Michael Hoffman 2015-05-29 18:03:55 UTC
This is technically an oracle bug but recommend in the code to chunk up the data into multiple where lines to work around this limitation.

where
blah in ('one', 'two', 'three') or
blah in ('four', 'five', 'six') or ..

Comment 2 Eric Herget 2017-05-25 13:57:32 UTC

*** This bug has been marked as a duplicate of bug 1402522 ***

Comment 3 Eric Herget 2017-09-28 18:06:11 UTC
This BZ closed some time during 2.5, 2.6 or 2.7.  Adding to 2.7 tracking bug.