Uploaded image for project: 'mod-finance-storage'
  1. mod-finance-storage
  2. MODFISTO-237

Transaction table upgrade failure when purchase order record is missing

    XMLWordPrintable

    Details

    • Template:
      Standard Bug Write-Up Format
    • Sprint:
      ACQ Sprint 114
    • Story Points:
      1
    • Development Team:
      Thunderjet
    • Release:
      R1 2021 Hot Fix #1
    • Hot Fix Approved by Cap Planning?:
      Yes
    • Affected Institution:
      Cornell, Simmons, University of Chicago

      Description

      When upgrading from mod-finance-storage-6.0.1 to mod-finance-storage-7.0.2, I got the following error:

      Tenant operation failed for module mod-finance-storage-7.0.2: SQL error\n UPDATE sim_mod_finance_storage.transaction tr SET jsonb = jsonb_set(jsonb, '{encumbrance,orderStatus}',                       (SELECT jsonb -> 'workflowStatus'                        from sim_mod_orders_storage.purchase_order                        where jsonb ->> 'id' = tr.jsonb #>> '{encumbrance,sourcePurchaseOrderId}')) WHERE jsonb ? 'encumbrance';
      

      The module log showed:

      2021-05-12T04:39:18,211 INFO  [vert.x-eventloop-thread-1] PostgresClient trying to execute: {} UPDATE sim_mod_finance_storage.transaction tr SET jsonb = jsonb_set(jsonb, '{encumbrance,orderStatus}',                       (SELECT jsonb -> 'workflowStatus'                        from sim_mod_orders_storage.purchase_order                        where jsonb ->> 'id' = tr.jsonb #>> '{encumbrance,sourcePurchaseOrderId}')) WHERE jsonb ? 'encumbrance';
      2021-05-12T04:39:18,367 ERROR [vert.x-eventloop-thread-1] PostgresClient { "message": "null value in column \"jsonb\" violates not-null constraint", "severity": "ERROR", "code": "23502", "detail": "Failing row contains (d8dbfc2f-2a14-4335-8d4d-a048b2957cce, null, 2021-03-29 17:40:17.615, 833a0a2b-fda2-4800-b222-e6703107ce70, null, null, null, null, null).", "file": "execMain.c", "line": "2035", "routine": "ExecConstraints", "schema": "sim_mod_finance_storage", "table": "transaction", "column": "jsonb" }
      io.vertx.pgclient.PgException: { "message": "null value in column \"jsonb\" violates not-null constraint", "severity": "ERROR", "code": "23502", "detail": "Failing row contains (d8dbfc2f-2a14-4335-8d4d-a048b2957cce, null, 2021-03-29 17:40:17.615, 833a0a2b-fda2-4800-b222-e6703107ce70, null, null, null, null, null).", "file": "execMain.c", "line": "2035", "routine": "ExecConstraints", "schema": "sim_mod_finance_storage", "table": "transaction", "column": "jsonb" }
      	at io.vertx.pgclient.impl.codec.ErrorResponse.toException(ErrorResponse.java:31) ~[mod-finance-storage-fat.jar:?]
      

      Checking in the database, it appears that the purchase order referred to in the transaction table does not exist in the *_mod_orders_storage.purchase_order table, which apparently causes a null value for the jsonb column to be generated in the SQL statement above.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                yauheni_kuzmianok Yauheni Kuzmianok
                Reporter:
                wayne Wayne Schneider
                Tester Assignee:
                Wayne Schneider Wayne Schneider
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases