Question
Senior Consultant
CH
Last activity: 29 Sep 2020 10:35 EDT
Campaign with Volume Constraint fails in Pega 8.4.1
Dear All,
Please let me know what could be the root cause and resolution for below Volume Constraint Issue.
Issue: Campaign will get failed Volume constraint is configured in the Campaign
Error Message in Program Run from the Campaign Dashboard:
Critical - Failure applying Constraint. Suspend and Update the campaign to resolve this issue. After updating, you can Restart or Skip this run.
Steps to Reproduce
1) Create a campaign at "Primary Context" or at "Secondary Context".
2) Configure Strategy, Audience and Engagement properly.
3) Configure the Volume Constraint in the campaign which has those offers which are resulted from Strategy.
4) Run the Campaign.
Environment Details
Pega Platform Version: Pega 8.4.1
FW Details (if any): PegaMarketing_FW 8
Database: Postgres SQL
Application Server: Tomcat
Analysis:
The issue is caused by "ApplyProgressiveOptimization" Function which is referenced from ApplyVolumeConstraint activity.
Log Message
Dear All,
Please let me know what could be the root cause and resolution for below Volume Constraint Issue.
Issue: Campaign will get failed Volume constraint is configured in the Campaign
Error Message in Program Run from the Campaign Dashboard:
Critical - Failure applying Constraint. Suspend and Update the campaign to resolve this issue. After updating, you can Restart or Skip this run.
Steps to Reproduce
1) Create a campaign at "Primary Context" or at "Secondary Context".
2) Configure Strategy, Audience and Engagement properly.
3) Configure the Volume Constraint in the campaign which has those offers which are resulted from Strategy.
4) Run the Campaign.
Environment Details
Pega Platform Version: Pega 8.4.1
FW Details (if any): PegaMarketing_FW 8
Database: Postgres SQL
Application Server: Tomcat
Analysis:
The issue is caused by "ApplyProgressiveOptimization" Function which is referenced from ApplyVolumeConstraint activity.
Log Message
2020-09-28 14:59:27,205 [ PegaRULES-Batch-5] [ STANDARD] [ ] [ AoM:01.01.01] (.ProgressiveOptimizationEngine) ERROR - ProgressiveOptimizationEngine.applyConstraintToPartition() - Exception processing Volume Constraint com.pega.pegarules.pub.PRRuntimeException: Cannot list the database at com.pega.decision.dsm.batch.RDBBatchReader.<init>(RDBBatchReader.java:82) ~[prpublic.jar:?] at com.pegarules.generated.createSQLBasedIterator_080101_373222742713466010.createSQLBasedIterator08_01_01(createSQLBasedIterator_080101_373222742713466010.java:130) ~[?:?] at com.pegarules.generated.createSQLBasedIterator_080101_373222742713466010.invoke(createSQLBasedIterator_080101_373222742713466010.java:106) ~[?:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:232) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:123) ~[prprivate-generation.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9642) ~[prprivate-session.jar:?] at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflection(LibrarySupport.java:260) ~[prpublic.jar:?] at com.pega.mkt.DataUtils.createSQLIterator(DataUtils.java:61) ~[pegamkt-08.04.01.jar:?] at com.pega.mkt.constraint.ProgressiveOptimizationEngine.applyConstraintToPartition(ProgressiveOptimizationEngine.java:122) ~[pegamkt-08.04.01.jar:?] at com.pega.mkt.constraint.ProgressiveOptimizationEngine.applyConstraint(ProgressiveOptimizationEngine.java:81) ~[pegamkt-08.04.01.jar:?] at com.pegarules.generated.ApplyProgressiveOptimization_080301__3951735868174170214.ApplyProgressiveOptimization08_03_01(ApplyProgressiveOptimization_080301__3951735868174170214.java:96) ~[?:?] at com.pegarules.generated.ApplyProgressiveOptimization_080301__3951735868174170214.invoke(ApplyProgressiveOptimization_080301__3951735868174170214.java:70) ~[?:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:232) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:123) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryFunctionUtilityImpl.resolveMethodCall(LibraryFunctionUtilityImpl.java:2932) ~[prprivate-generation.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.resolveMethodCall(Executable.java:11918) ~[prprivate-session.jar:?] at com.pegarules.generated.activity.ra_action_applyvolumeconstraint_74db442f4e442bf8ca766ed9e3813490.step8_circum0(ra_action_applyvolumeconstraint_74db442f4e442bf8ca766ed9e3813490.java:789) ~[?:?] at com.pegarules.generated.activity.ra_action_applyvolumeconstraint_74db442f4e442bf8ca766ed9e3813490.perform(ra_action_applyvolumeconstraint_74db442f4e442bf8ca766ed9e3813490.java:207) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.flow.ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.RunTaskActivity(ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.java:5218) ~[?:?] at com.pegarules.generated.flow.ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.Task_Utility1_circum0(ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.java:1156) ~[?:?] at com.pegarules.generated.flow.ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.perform(ra_action_managevolumeconstraint_30eaca2b8db05eaafcc402297581c812.java:633) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.flow.ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.LaunchFlow(ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.java:11456) ~[?:?] at com.pegarules.generated.flow.ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.LaunchFlow(ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.java:11094) ~[?:?] at com.pegarules.generated.flow.ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.Task_SubProcess2_circum0(ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.java:7422) ~[?:?] at com.pegarules.generated.flow.ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.perform(ra_action_executeprogramrun_83a4743b8f1f12010ab933314f2294f1.java:739) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.flow.ra_action_managedataflowresilence_8d653d55326620fe1440db7217175850.RestartIssuingFlow(ra_action_managedataflowresilence_8d653d55326620fe1440db7217175850.java:5610) ~[?:?] at com.pegarules.generated.flow.ra_action_managedataflowresilence_8d653d55326620fe1440db7217175850.perform(ra_action_managedataflowresilence_8d653d55326620fe1440db7217175850.java:804) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.StartFlow_080401__6867397908777742199.StartFlow08_04_01(StartFlow_080401__6867397908777742199.java:165) ~[?:?] at com.pegarules.generated.StartFlow_080401__6867397908777742199.invoke(StartFlow_080401__6867397908777742199.java:74) ~[?:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:232) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:123) ~[prprivate-generation.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9642) ~[prprivate-session.jar:?] at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflectionWithException(LibrarySupport.java:277) ~[prpublic.jar:?] at com.pegarules.generated.activity.ra_action_completeassignment_965414fb0790ab29aeb9f16139c0de89.step28_circum0(ra_action_completeassignment_965414fb0790ab29aeb9f16139c0de89.java:2823) ~[?:?] at com.pegarules.generated.activity.ra_action_completeassignment_965414fb0790ab29aeb9f16139c0de89.perform(ra_action_completeassignment_965414fb0790ab29aeb9f16139c0de89.java:592) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.callActivity_080101_2223927609556540475.callActivity08_01_01(callActivity_080101_2223927609556540475.java:134) ~[?:?] at com.pegarules.generated.callActivity_080101_2223927609556540475.invoke(callActivity_080101_2223927609556540475.java:81) ~[?:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:232) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:123) ~[prprivate-generation.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9642) ~[prprivate-session.jar:?] at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflectionWithException(LibrarySupport.java:277) ~[prpublic.jar:?] at com.pegarules.generated.activity.ra_action_performflowaction_43a84b19d5cca918e2e2987f917a5996.step18_circum0(ra_action_performflowaction_43a84b19d5cca918e2e2987f917a5996.java:1727) ~[?:?] at com.pegarules.generated.activity.ra_action_performflowaction_43a84b19d5cca918e2e2987f917a5996.perform(ra_action_performflowaction_43a84b19d5cca918e2e2987f917a5996.java:372) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:11359) ~[prprivate-session.jar:?] at com.pegarules.generated.activity.ra_action_resumeflow_4154b677be76e3554ae85ac7caada594.step3_circum0(ra_action_resumeflow_4154b677be76e3554ae85ac7caada594.java:439) ~[?:?] at com.pegarules.generated.activity.ra_action_resumeflow_4154b677be76e3554ae85ac7caada594.perform(ra_action_resumeflow_4154b677be76e3554ae85ac7caada594.java:110) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pegarules.generated.callActivity_080101_2223927609556540475.callActivity08_01_01(callActivity_080101_2223927609556540475.java:134) ~[?:?] at com.pegarules.generated.callActivity_080101_2223927609556540475.invoke(callActivity_080101_2223927609556540475.java:81) ~[?:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.resolveAndinvokeFunctionViaReflection(LibraryRuntime.java:232) ~[prprivate-generation.jar:?] at com.pega.pegarules.generation.internal.library.LibraryRuntime.invokeLibraryRuntime(LibraryRuntime.java:123) ~[prprivate-generation.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeLibraryRuntime(Executable.java:9642) ~[prprivate-session.jar:?] at com.pega.pegarules.priv.generator.LibrarySupport.resolveAndInvokeFunctionViaReflectionWithException(LibrarySupport.java:277) ~[prpublic.jar:?] at com.pegarules.generated.activity.ra_action_executesla_464350f6cf89e0b6dd36c2aed60a7659.step19_circum0(ra_action_executesla_464350f6cf89e0b6dd36c2aed60a7659.java:2133) ~[?:?] at com.pegarules.generated.activity.ra_action_executesla_464350f6cf89e0b6dd36c2aed60a7659.perform(ra_action_executesla_464350f6cf89e0b6dd36c2aed60a7659.java:441) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:11359) ~[prprivate-session.jar:?] at com.pegarules.generated.activity.ra_action_processevent_7629eb033a352f0c9e7ba1095b657e01.step7_circum0(ra_action_processevent_7629eb033a352f0c9e7ba1095b657e01.java:706) ~[?:?] at com.pegarules.generated.activity.ra_action_processevent_7629eb033a352f0c9e7ba1095b657e01.perform(ra_action_processevent_7629eb033a352f0c9e7ba1095b657e01.java:205) ~[?:?] at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2793) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:857) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.async.agent.QueueProcessor.execute(QueueProcessor.java:678) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:1158) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1397) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1140) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1021) ~[prprivate-session.jar:?] at com.pega.pegarules.session.internal.async.BatchRequestorTask.run(BatchRequestorTask.java:818) ~[prprivate-session.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_181] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_181] at java.lang.Thread.run(Unknown Source) [?:1.8.0_181] Caused by: com.pega.pegarules.pub.database.DatabaseException: There was a problem getting a list: code: 0 SQLState: 42601 Message: ERROR: DEFAULT is not allowed in this context Position: 7058 DatabaseException caused by prior exception: org.postgresql.util.PSQLException: ERROR: DEFAULT is not allowed in this context Position: 7058 | SQL Code: 0 | SQL State: 42601 at com.pega.pegarules.data.internal.access.ExceptionInformation.createAppropriateExceptionDueToDBFailure(ExceptionInformation.java:385) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.ExceptionInformation.createExceptionDueToDBFailure(ExceptionInformation.java:364) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.Lister.convertSqlExceptionToDatabaseException(Lister.java:607) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.Lister.listWithResultPackager(Lister.java:427) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.Lister.list(Lister.java:190) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.DatabaseImpl.list(DatabaseImpl.java:3009) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.DatabaseImpl.list(DatabaseImpl.java:3000) ~[prprivate-data.jar:?] at com.pega.decision.dsm.batch.RDBBatchReader.<init>(RDBBatchReader.java:74) ~[prpublic.jar:?] ... 75 more Caused by: org.postgresql.util.PSQLException: ERROR: DEFAULT is not allowed in this context Position: 7058 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2505) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2241) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:447) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:368) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:158) ~[postgresql-42.2.9.jar:42.2.9] at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:147) ~[postgresql-42.2.9.jar:42.2.9] at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-java7-2.4.12.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-java7-2.4.12.jar:?] at com.pega.pegarules.data.internal.store.DatabasePreparedStatementImpl.execute(DatabasePreparedStatementImpl.java:531) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.Lister.listWithResultPackager(Lister.java:410) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.Lister.list(Lister.java:190) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.DatabaseImpl.list(DatabaseImpl.java:3009) ~[prprivate-data.jar:?] at com.pega.pegarules.data.internal.access.DatabaseImpl.list(DatabaseImpl.java:3000) ~[prprivate-data.jar:?] at com.pega.decision.dsm.batch.RDBBatchReader.<init>(RDBBatchReader.java:74) ~[prpublic.jar:?] ... 75 more 2020-09-28 14:59:27,229 [ PegaRULES-Batch-5] [ STANDARD] [ ] [ AoM:01.01.01] (PegaMKT_Work_ProgramRun.Action) ERROR - Failure in ExecuteProgramRun: Failure applying Constraint.:PR-90040