Uploaded image for project: 'RAML Module Builder'
  1. RAML Module Builder
  2. RMB-895

mod-srs: Upgrade (when liquibase exception) fails silently



    • Bug
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • None
    • Folijet Sprint 133, Folijet Sprint 134
    • 0
    • Folijet
    • Lotus R1 2022
    • Related dependency upgrade


      In recent upgrades we have observed that the module is successfully upgraded (for a tenant) but after further investigation have found errors in log and (in some cases) some issues with database schema.

      For example what is observed in the following

      I would have expected the migration to have failed (instead of exception being thrown and module upgrade succeeding)

      Noting this issue for mod-srs (but would be expected behavior for all modules)

      How to reproduce:

      1. Run mod-source-record-storage-5.0.6
      2. Install tenant diku.
      3. Stop mod-source-record-storage-5.0.6
      4. Start mod-source-record-storage-5.1.5
      5. Upgrade diku from mod-source-record-storage-5.0.6 to mod-source-record-storage-5.1.5
      6. Call the API that reports the async upgrade result, for example /_/tenant/458b6397-c4d2-46b2-a771-ace8a310bcea?wait=30000 (for details see https://s3.amazonaws.com/foliodocs/api/raml/r/tenant.html#tenant__operation_id__get and https://github.com/folio-org/okapi/blob/master/doc/guide.md#install-jobs-and-asynchronous-operations )

      Actual result:

      HTTP/1.1 200 OK
      transfer-encoding: chunked
      Content-Type: application/json{
        "id" : "458b6397-c4d2-46b2-a771-ace8a310bcea",
        "tenant" : "diku",
        "tenantAttributes" : {
          "module_from" : "mod-source-record-storage-5.0.6",
          "module_to" : "mod-source-record-storage-5.1.5",
          "parameters" : [ ]
        "complete" : true,
        "messages" : [ ]

      Note that there is a Liquibase exceptions in the log failing the upgrade but the response has not "error" property.

      Expected result:

      HTTP/1.1 200 OK
      transfer-encoding: chunked
      Content-Type: application/json
        "id" : "b9deddd3-37f4-4489-8b80-a0cb9f4367f8",
        "tenant" : "diku",
        "tenantAttributes" : {
          "module_from" : "mod-source-record-storage-5.0.6",
          "module_to" : "mod-source-record-storage-5.1.5",
          "parameters" : [ ]
        "complete" : true,
        "error" : "liquibase.exception.ValidationFailedException: Validation Failed:\n     1 change sets check sum\n          liquibase/tenant/scripts/v-0.0.2/2020-09-09--15-00-fill-instance-hrid.xml::2020-09-09--15-00-fill-instance-hrid::VolodymyrRohach was: 8:a5bc1be1ad51d41c77f1f810e19ce0ae but is now: 8:98f2d085c83ed39de0a08ba003026fb6\n",
        "messages" : [ ]


      Update folio-liquibase-util to a version with the fix provided by LIQUTIL-17 = https://github.com/folio-org/folio-liquibase-util/pull/14

      I've tried this and the result is as shown in the "Expected result" section. No change to RMB is needed.

      TestRail: Results


          Issue Links



                afedasiuk Aliaksandr Fedasiuk
                cgodfrey Carole Godfrey
                0 Vote for this issue
                6 Start watching this issue



                  TestRail: Runs

                    TestRail: Cases