Uploaded image for project: 'CFA MX '
  1. CFA MX
  2. CFAMX-26018

Server errors related to DSB Calculation issues research

    Details

    • Type: Customer Defect
    • Status: In QA (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: CFA 2023R2
    • Fix Version/s: CFA 2023R4
    • Component/s: Inventory
    • Labels:
      None
    • VTask #:
      VTASK0515777
    • Root cause - Reason:
      Code defect
    • Root Cause:
      Some of the errors are data related and for the grand opening stores an if check placed

      Description

       

      The exception below occurring when the DSB runs against to first day of a grand opening store.  In the code somewhere we are looking for -1 day and since the start date id 1/1/1753 then the code is checking 12/30/1752 so it causing the errors. I will provide a fix for this.

       

      Skip DSB calculation if the process day is less than sql min date. This may happen to get previous day records for the grand opening stores

      ========================================================
      Title:
      Timestamp: 6/5/2023 4:01:13 PM
      Message: InventoryAdjust (EntityID:6127,ItemID:3116,AdjustDate:2023-05-04 23:59:54) - Exception processing Inventory Adjust Message: System.Data.SqlTypes.SqlTypeException: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
      at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(TimeSpan value)
      at System.Data.SqlTypes.SqlDateTime.FromDateTime(DateTime value)
      at System.Data.SqlClient.MetaType.FromDateTime(DateTime dateTime, Byte cb)
      at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj)
      at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc)
      at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
      at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
      at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
      at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
      at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
      at Mx.Inventory.Data.DailyStockBalanceRepository.SelectItemStock_Reader(Nullable`1 entityID, Nullable`1 itemID, Nullable`1 businessDay, IDbTransaction transaction)
      at Mx.Inventory.Data.DailyStockBalanceRepository.SelectItemStock(Int64 entityID, Int64 itemID, DateTime businessDay)
      at Mx.Inventory.Services.DailyStockBalanceService.GetOpeningStockBalance(Int64 entityID, Int64 itemID, MxDay processDay)
      at Mx.Inventory.Services.DailyStockBalanceService.ProcessDailyStockBalanceByItem(Int64 entityID, Int64 itemID, MxDay dayBeingProcessed, MxDay currentDay, MxDay inventoryMessageApplyDay, DateTime inventoryMessageApplyDateTime, Int32 historicalDaysToProcess)
      at Mx.Inventory.Services.DailyStockBalanceService.ApplyDailyStockBalanceByItem(Int64 entityID, Int64 itemID, DateTime inventoryMessageApplyDateTime, Int32 historicalDaysToProcess)
      at Mx.Inventory.Services.InventoryProcessService.ProcessInventoryDailyMessage(Int64 entityID, Int64 itemID, DateTime applyDate, InventoryAdjustType inventoryAdjustType)
      at Mx.Services.BaseSystem.Queues.InventoryEntityDailyAdjustMessage.PerformAction(Message message, ITaskController taskController)
      Activity Token: 4c5d8d9f-804e-4e33-bc24-d089594d04c5
      Category: InventoryAdjustment
      Priority: 30
      EventId: 6
      Severity: Error
      Application Domain: eStruxure Manager.exe

       

      I have added an if check if the process day is less than 1/1/1753 then log the error and let the message processed. This will be hard to test. The test may be done is doing a DSB calculation for a grand opening store against to the first day. 

      Expected Result: 

      the DSB calculation inventory adjust messages should not fail for a grand opening store. 

       

       

        Attachments

          Activity

            People

            • Assignee:
              wesam.el-gendy Wesam El-Gendy
              Reporter:
              wesam.el-gendy Wesam El-Gendy
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                PagerDuty

                Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.