JournalsEventHandler - Process Cube stucked

GParreiras
New Contributor III

Hi team!

I'm utilizing the "process cube" function within a JournalsEventHandler. However, whenever the event occurs after the journal is unposted, the process cube fails to execute; it gets stuck and never completes. if the event occurs after the journal is posted, it functions correctly.

Not sure what is causing it. here is the piece of code:

Else If (args.IsBeforeEvent = False) And _ 
     (args.OperationName.Equals(BREventOperationType.Journals.PostJournal) Or _
     args.OperationName.Equals(BREventOperationType.Journals.UnpostJournal))

  BRApi.DataQuality.Process.ExecuteProcessCube(si, _
      BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, _
         EntityWFName, WFScenario, WFTime), _
      StepClassificationTypes.ProcessCube, _
      False)

End If

Thanks.

 

1 ACCEPTED SOLUTION

GParreiras
New Contributor III

I Figure it out.

 

When you click "Post" or "Unpost" in the journals, this isn't exactly an aftereffect. What I understand is that if you need to process the cube after a "Post" or "Unpost," your if statement must check for BREventOperationType.Journals.FinalizePostJournal. At this step, you will be able to process the cube.

View solution in original post

4 REPLIES 4

JackLacava
Community Manager
Community Manager

If you can reproduce this in isolation (e.g. on the demo golfstream app, or the blueprint app, or a very simple app), you should reach out to Support to have it investigated.

One thing i would suggest is to:

  1. add a Return just before that the ProcessCube line, and run the rule.
  2. unpost the journal to trigger the rule
  3. try to Process Cube from OnePlace, and see if any error comes up.

Hi @JackLacava, thanks.

I tried what you suggested. I even attempted to run the ProcessCube from an ExtensibilityRule in a separate Business Rule, and in both cases, the cube gets processed with no issues. I'll try to reach out to support.

 

Here is the error log:


Summary: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Operation cancelled by user.
The statement has been terminated. (SQL Error Number -2146232060, -2, 0, 3621)
The wait operation timed out.


----------------------------------------
Description: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Operation cancelled by user.
The statement has been terminated.
Error Time: 3/22/2024 3:03:14 PM
Error Level: Error
Tier: AppServer
User: Guilherme Parreiras
Application: -
App Server: -
App Server Version: 8.0.0.15217
App Server OS Version: Microsoft Windows NT 10.0.20348.0
Session ID: 84ea3961-bf07-4ed3-9480-016032aea86e
Error Log ID: 900635ba-dab9-4293-9ff1-fab1e8f4d2c5

Total Memory: 68,719,005,696 (64.00 GB)
Memory In Use: 2,240,098,304 (2.09 GB)
Private Memory In Use: 2,421,551,104 (2.26 GB)
Peak Memory In Use: 2,601,185,280 (2.42 GB)
Maximum Data Records In RAM: 12,884,813
Maximum Data Units In RAM: 100,000
Number Of Threads: 75

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method ExecuteCalculateDefinitions

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method CalculateChartLogic

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method CalculateOneTimePeriod

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method InsertOrUpdateDataUnitTimeStartCalc_UseDbTransaction

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method ExecuteRetries

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method InternalExecuteRetries

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method <InsertOrUpdateDataUnitTimeStartCalc_UseDbTransaction>b__0

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method InsertOrUpdateDataUnitTimeStartCalc

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method SetTimeStartCalc

----------------------------------------
Exception Type: XFException
Thread Id: 131
Source code: line 0, method ExecuteStoredProcedureThatProducesACalcStatusRow

Stack Trace:
at OneStream.Finance.Database.CalcStatusStoredProcs.ExecuteStoredProcedureThatProducesACalcStatusRow(DbConnInfo dbConnApp, Int32 cubeId, Int32 entityId, Int32 parentId, Int32 consId, Int32 scenarioId, Int32 timeId, String storedProcName, List`1 dbParamInfos, Boolean processRowWasModifiedParameter, Boolean& rowWasModified)
at OneStream.Finance.Database.CalcStatusStoredProcs.SetTimeStartCalc(DbConnInfo dbConnApp, Int32 cubeId, Int32 entityId, Int32 parentId, Int32 consId, Int32 scenarioId, Int32 timeId, DateTime timeStartCalc, Guid guidStartCalc)
at OneStream.Finance.Engine.CalcStatusDbAccess.InsertOrUpdateDataUnitTimeStartCalc(DbConnInfo dbConnApp, Int32 cubeId, Int32 entityId, Int32 parentId, Int32 consId, Int32 scenarioId, Int32 timeId, Guid guidStartCalc, DateTime timeStartCalc, Boolean logErrors, ConcurrentDictionary`2 cubeScenTimeIdsForInvalidatingCalcStatusCacheLater, CalcStatusRow& modifiedRow)
at OneStream.Finance.Engine.CalcStatusDbAccess.<>c__DisplayClass8_0.<InsertOrUpdateDataUnitTimeStartCalc_UseDbTransaction>b__0()
at OneStream.Shared.Database.DbRetryManager.InternalExecuteRetries(DbConnInfo dbConnInfoToRepair, DbUseTransaction createTransactionAroundEachRetry, Boolean skipAllRetryLogging, DbRetryManagerStackItem stackItem, Action actionToRetry)
at OneStream.Shared.Database.DbRetryManager.ExecuteRetries(Action actionToRetry)
at OneStream.Finance.Engine.CalcStatusDbAccess.InsertOrUpdateDataUnitTimeStartCalc_UseDbTransaction(SessionInfo si, CalculationInfo calcInfo, Int32 cubeId, Int32 entityId, Int32 parentId, Int32 consId, Int32 scenarioId, Int32 timeId, Guid guidStartCalc, DateTime timeStartCalc, ConcurrentDictionary`2 cubeScenTimeIdsForInvalidatingCalcStatusCacheLater)
at OneStream.Finance.Engine.ChartLogic.CalculateOneTimePeriod(SessionInfo si, ExternalWcfClient externalWcfClient, Guid taskActivityID, TaskActivityStepWrapperItem parentTAStepItem, DataUnitDimInfo dudInfo, FinanceRulesArgs args, CalculationInfo calcInfo, BRGlobals brGlobals, Guid guidForCalc, Boolean force, TriStateBool executeHybridSourceDataCopy, Boolean& foundSourceDataUnitsProcessingACellUpdateLoop, Boolean& foundInconsistentInitialDataWhenSaving)
at OneStream.Finance.Engine.ChartLogic.CalculateChartLogic(SessionInfo si, ExternalWcfClient externalWcfClient, Guid taskActivityID, TaskActivityStepWrapperItem parentTAStepItem, DataUnitDimInfo dudInfo, CalculationInfo calcInfo, BRGlobals brGlobals, Guid guidForCalc, Boolean force, TriStateBool executeHybridSourceDataCopy)
at OneStream.Finance.Engine.EngineCalculate.CalculateChartLogic(DbConnInfo dbConnApp, ExternalWcfClient externalWcfClient, Guid taskActivityID, TaskActivityStepWrapperItem parentTAStepItem, CalcStatusCache calcStatusCache, DataUnitPk dataUnitPk, Boolean force, Boolean useDetailedLogging, TriStateBool executeHybridSourceDataCopy)
at OneStream.Finance.Engine.ProcessCube.ExecuteCalculateDefinitions(SessionInfo si, List`1 dataUnitInfos, WorkflowUnitPk workflowUnitPk, StepClassificationTypes stepClassification, Boolean updatePreceedingWorkflowUnits, Int32 startingSubTaskIndex, TaskActivityItem taskActivityItem, TaskActivityDBLimiter taskActivityDBLimiter, TaskActivityItem taskActivityItemBatch, TaskActivityDBLimiter taskActivityDBLimiterBatch)
at OneStream.Shared.Wcf.ProcessCubeWcf.ExecuteProcessCube(DbConnInfo dbConnFW, DbConnInfo dbConnApp, WorkflowUnitPk workflowUnitPk, Boolean updatePreceedingWorkflowUnits, StepClassificationTypes stepClassification, List`1 dataUnitInfos, TaskActivityItem taskActivityItem, TaskActivityDBLimiter taskActivityDBLimiter, TaskActivityItem taskActivityItemBatch, TaskActivityDBLimiter taskActivityDBLimiterBatch)
at OneStream.Shared.Wcf.DataQuality.ExecuteProcessCube(SessionInfo si, WorkflowUnitPk workflowUnitPk, StepClassificationTypes stepClassification, Boolean updatePreceedingWorkflowUnits)
at OneStream.Shared.Wcf.BRApiDataQualityProcess.ExecuteProcessCube(SessionInfo si, WorkflowUnitClusterPk wfClusterPk, StepClassificationTypes stepClassification, Boolean updatePreceedingWorkflowUnits)
at OneStream.BusinessRule.JournalsEventHandler.JournalsEventHandler.MainClass.Main(SessionInfo si, BRGlobals globals, Object api, JournalsEventHandlerArgs args)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at OneStream.Shared.Wcf.XFBusinessRuleCompilerDotNetFw.Execute(SessionInfo si, Boolean isSystemLevel, BRGlobals globals, Object api, Object args)
at OneStream.Finance.Engine.BusinessRuleAssembly.Execute(SessionInfo si, Boolean isSystemLevel, BRGlobals globals, Object api, Object args)
at OneStream.Shared.Engine.EventHandlerWrapper`1.ExecuteAfterEvent(DbConnInfo dbConnApp, BusinessRuleCacheItem brCacheItem, EventHandlerArgs args)
at OneStream.Shared.Engine.EventHandlerWrapper`1.Dispose()
at OneStream.Shared.Wcf.JournalsWcf.PostJournal(DbConnInfo dbConnFW, DbConnInfo dbConnApp, ExternalWcfClient externalWcfClient, Guid journalID)
at OneStream.Shared.Wcf.Journals.<>c__DisplayClass27_0.<PostJournal>b__0()
at OneStream.Shared.Database.DbRetryManager.InternalExecuteRetries(DbConnInfo dbConnInfoToRepair, DbUseTransaction createTransactionAroundEachRetry, Boolean skipAllRetryLogging, DbRetryManagerStackItem stackItem, Action actionToRetry)
at OneStream.Shared.Database.DbRetryManager.ExecuteRetries(Action actionToRetry)
at OneStream.Shared.Wcf.Journals.PostJournal(SessionInfo si, Guid journalID)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at CoreWCF.Dispatcher.InvokerUtil.CriticalHelper.<>c__DisplayClass3_0.<GenerateInvokeDelegate>b__0(Object target, Object[] inputs, Object[] outputs)
at CoreWCF.Dispatcher.SyncMethodInvoker.InvokeAsync(Object instance, Object[] inputs)
at OneStream.Shared.Engine.EngineWcfEventHandlerBusinessRule.ExecuteActionWithBeforeAndAfterWcfEventHandlers(SessionInfo si, WcfServiceType xfServiceType, String operationName, OperationDescription wcfOperationDescriptionOrNull, Object[] inputs, Type returnType, Func`1 primaryActionToExecute)
at OneStream.Shared.Wcf.XFWcfOperationInvoker.InvokeAsync(Object instance, Object[] inputs)

----------------------------------------
Exception Type: Unknown
Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Operation cancelled by user.
The statement has been terminated. (SQL Error Number -2146232060, -2, 0, 3621)

----------------------------------------
Exception Type: Unknown
Message: The wait operation timed out.

 

 

 

GParreiras
New Contributor III

I Figure it out.

 

When you click "Post" or "Unpost" in the journals, this isn't exactly an aftereffect. What I understand is that if you need to process the cube after a "Post" or "Unpost," your if statement must check for BREventOperationType.Journals.FinalizePostJournal. At this step, you will be able to process the cube.

sameburn
New Contributor III

I think your previous error was a generic timeout from task activity. Default setting for this is 120 minutes.  So if a task takes longer than this, by default it will timeout

Please sign in! GParreiras