Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-7665

OMR 2.0 upgrade fails to database migration

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • omr-v2.0.0
    • omr-v2.0.0
    • OMR
    • False
    • None
    • False
    • Critical

      Description

      OMR 2.0 upgrade fails to database migration

      Build

      registry-proxy.engineering.redhat.com/rh-osbs/openshift-mirror-registry-rhel8:v2.0.0-9

      Reproduced steps

      1.using OMR 1.3 setup quay without any custom flag

      ./mirror-registry install --quayHostname 10.0.0.0 --sslCert ssl.cert --sslKey ssl.key -v 

      2. upgrade quay by OMR 2.0

      ./mirror-registry upgrade --quayHostname 10.0.0.0 -v 

       

      Actual results

      Above issues logs:
       

      TASK [mirror_appliance : Create Sqlite storage named volume] *****************************************************************************************************************************************************************************************************************************************************************
      ok: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Create necessary directory for storing quay postgres db snapshot] ***********************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Verify sqlite3 cli binary is available as entrypoint command from the container] ********************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Fail if sqlite cli binary is not found] *************************************************************************************************************************************************************************************************************************************************************
      skipping: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Take a pg_dump of the data from running quay-postgres container] ************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Back up postgres data to host machine] **************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Stop Quay service] **********************************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Update DB_URI in config.yaml] ***********************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Ensure DB_URI was updated successfully] *************************************************************************************************************************************************************************************************************************************************************
      ok: [cloud-user@quay-omr-rhel-47] => {
          "changed": false,
          "msg": "DB_URI has been updated successfully"
      }
      TASK [mirror_appliance : Copy Quay systemd service file with migrate command] ************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Start Quay service] *********************************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Add wait to ensure quay runs alembic migration and is available] ************************************************************************************************************************************************************************************************************************************
      ok: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Create temporary data-only container to copy contents of sqlite_storage volume] *********************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Copy data from container to host] *******************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Run sqlite3 command inside container to take quay's sqlite database schema dump] ********************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Fail if sqlite3 command failed] *********************************************************************************************************************************************************************************************************************************************************************
      skipping: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Back up sqlite schema data to host machine] *********************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Remove the quay_sqlite.db file] *********************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Stop Quay migrate service] **************************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Cleanup quay-migrate systemd unit file] *************************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Copy postgres-to-sqlite bash script to host machine] ************************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Convert PostgreSQL data-only dump to SQLite-compatible SQL file] ************************************************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Concatenate sqlite schema .sql and transformed postgres data into single merged_sqlite.sql] *********************************************************************************************************************************************************************************************************
      changed: [cloud-user@quay-omr-rhel-47]
      TASK [mirror_appliance : Apply merged_sqlite.sql into a new quay_sqlite.db file] *********************************************************************************************************************************************************************************************************************************************
      fatal: [cloud-user@quay-omr-rhel-47]: FAILED! => {"changed": true, "cmd": "cat \"/home/cloud-user/quay-install/quay-postgres-backup/merged_sqlite.sql\" | podman run -i --rm --name sqlite-cli -v /home/cloud-user/quay-install/quay-postgres-backup:/backup:Z quay.io/projectquay/sqlite-cli:latest /backup/quay_sqlite.db", "delta": "0:00:00.526245", "end": "2024-08-15 23:31:43.419589", "msg": "non-zero return code", "rc": 1, "start": "2024-08-15 23:31:42.893344", "stderr": "Error: near line 1: no such table: accesstokenkind\nError: near line 2: no such table: accesstokenkind\nError: near line 3: no such table: repositorykind\nError: near line 4: no such table: repositorykind\nError: near line 5: no such table: user\nError: near line 6: no such table: visibility\nError: near line 7: no such table: visibility\nError: near line 8: no such table: role\nError: near line 9: no such table: role\nError: near line 10: no such table: role\nError: near line 11: no such table: alembic_version\nError: near line 12: no such table: mediatype\nError: near line 13: no such table: mediatype\nError: near line 14: no such table: mediatype\nError: near line 15: no such table: mediatype\nError: near line 16: no such table: mediatype\nError: near line 17: no such table: mediatype\nError: near line 18: no such table: mediatype\nError: near line 19: no such table: mediatype\nError: near line 20: no such table: mediatype\nError: near line 21: no such table: mediatype\nError: near line 22: no such table: mediatype\nError: near line 23: no such table: mediatype\nError: near line 24: no such table: mediatype\nError: near line 25: no such table: mediatype\nError: near line 26: no such table: mediatype\nError: near line 27: no such table: mediatype\nError: near line 28: no such table: mediatype\nError: near line 29: no such table: mediatype\nError: near line 30: no such table: apprblobplacementlocation\nError: near line 31: no such table: apprblobplacementlocation\nError: near line 32: no such table: apprtagkind\nError: near line 33: no such table: apprtagkind\nError: near line 34: no such table: apprtagkind\nError: near line 35: no such table: imagestoragelocation\nError: near line 36: no such table: imagestoragelocation\nError: near line 37: no such table: imagestoragelocation\nError: near line 38: no such table: imagestoragelocation\nError: near line 39: no such table: imagestoragelocation\nError: near line 40: no such table: imagestoragelocation\nError: near line 41: no such table: imagestoragelocation\nError: near line 42: no such table: imagestoragelocation\nError: near line 43: no such table: imagestoragelocation\nError: near line 44: no such table: buildtriggerservice\nError: near line 45: no such table: buildtriggerservice\nError: near line 46: no such table: buildtriggerservice\nError: near line 47: no such table: buildtriggerservice\nError: near line 48: no such table: imagestoragetransformation\nError: near line 49: no such table: imagestoragetransformation\nError: near line 50: no such table: disablereason\nError: near line 51: no such table: disablereason\nError: near line 52: no such table: disablereason\nError: near line 53: no such table: externalnotificationevent\nError: near line 54: no such table: externalnotificationevent\nError: near line 55: no such table: externalnotificationevent\nError: near line 56: no such table: externalnotificationevent\nError: near line 57: no such table: externalnotificationevent\nError: near line 58: no such table: externalnotificationevent\nError: near line 59: no such table: externalnotificationevent\nError: near line 60: no such table: externalnotificationevent\nError: near line 61: no such table: externalnotificationevent\nError: near line 62: no such table: externalnotificationevent\nError: near line 63: no such table: externalnotificationmethod\nError: near line 64: no such table: externalnotificationmethod\nError: near line 65: no such table: externalnotificationmethod\nError: near line 66: no such table: externalnotificationmethod\nError: near line 67: no such table: externalnotificationmethod\nError: near line 68: no such table: externalnotificationmethod\nError: near line 69: no such table: loginservice\nError: near line 70: no such table: loginservice\nError: near line 71: no such table: loginservice\nError: near line 72: no such table: loginservice\nError: near line 73: no such table: loginservice\nError: near line 74: no such table: loginservice\nError: near line 75: no such table: loginservice\nError: near line 76: no such table: imagestoragesignaturekind\nError: near line 77: no such table: labelsourcetype\nError: near line 78: no such table: labelsourcetype\nError: near line 79: no such table: labelsourcetype\nError: near line 80: no such table: logentrykind\nError: near line 81: no such table: logentrykind\nError: near line 82: no such table: logentrykind\nError: near line 83: no such table: logentrykind\nError: near line 84: no such table: logentrykind\nError: near line 85: no such table: logentrykind\nError: near line 86: no such table: logentrykind\nError: near line 87: no such table: logentrykind\nError: near line 88: no such table: logentrykind\nError: near line 89: no such table: logentrykind\nError: near line 90: no such table: logentrykind\nError: near line 91: no such table: logentrykind\nError: near line 92: no such table: logentrykind\nError: near line 93: no such table: logentrykind\nError: near line 94: no such table: logentrykind\nError: near line 95: no such table: logentrykind\nError: near line 96: no such table: logentrykind\nError: near line 97: no such table: logentrykind\nError: near line 98: no such table: logentrykind\nError: near line 99: no such table: logentrykind\nError: near line 100: no such table: logentrykind\nError: near line 101: no such table: logentrykind\nError: near line 102: no such table: logentrykind\nError: near line 103: no such table: logentrykind\nError: near line 104: no such table: logentrykind\nError: near line 105: no such table: logentrykind\nError: near line 106: no such table: logentrykind\nError: near line 107: no such table: logentrykind\nError: near line 108: no such table: logentrykind\nError: near line 109: no such table: logentrykind\nError: near line 110: no such table: logentrykind\nError: near line 111: no such table: logentrykind\nError: near line 112: no such table: logentrykind\nError: near line 113: no such table: logentrykind\nError: near line 114: no such table: logentrykind\nError: near line 115: no such table: logentrykind\nError: near line 116: no such table: logentrykind\nError: near line 117: no such table: logentrykind\nError: near line 118: no such table: logentrykind\nError: near line 119: no such table: logentrykind\nError: near line 120: no such table: logentrykind\nError: near line 121: no such table: logentrykind\nError: near line 122: no such table: logentrykind\nError: near line 123: no such table: logentrykind\nError: near line 124: no such table: logentrykind\nError: near line 125: no such table: logentrykind\nError: near line 126: no such table: logentrykind\nError: near line 127: no such table: logentrykind\nError: near line 128: no such table: logentrykind\nError: near line 129: no such table: logentrykind\nError: near line 130: no such table: logentrykind\nError: near line 131: no such table: logentrykind\nError: near line 132: no such table: logentrykind\nError: near line 133: no such table: logentrykind\nError: near line 134: no such table: logentrykind\nError: near line 135: no such table: logentrykind\nError: near line 136: no such table: logentrykind\nError: near line 137: no such table: logentrykind\nError: near line 138: no such table: logentrykind\nError: near line 139: no such table: logentrykind\nError: near line 140: no such table: logentrykind\nError: near line 141: no such table: logentrykind\nError: near line 142: no such table: logentrykind\nError: near line 143: no such table: logentrykind\nError: near line 144: no such table: logentrykind\nError: near line 145: no such table: logentrykind\nError: near line 146: no such table: logentrykind\nError: near line 147: no such table: logentrykind\nError: near line 148: no such table: logentrykind\nError: near line 149: no such table: logentrykind\nError: near line 150: no such table: logentrykind\nError: near line 151: no such table: logentrykind\nError: near line 152: no such table: logentrykind\nError: near line 153: no such table: logentrykind\nError: near line 154: no such table: logentrykind\nError: near line 155: no such table: logentrykind\nError: near line 156: no such table: logentrykind\nError: near line 157: no such table: logentrykind\nError: near line 158: no such table: logentrykind\nError: near line 159: no such table: notificationkind\nError: near line 160: no such table: notificationkind\nError: near line 161: no such table: notificationkind\nError: near line 162: no such table: notificationkind\nError: near line 163: no such table: notificationkind\nError: near line 164: no such table: notificationkind\nError: near line 165: no such table: notificationkind\nError: near line 166: no such table: notificationkind\nError: near line 167: no such table: notificationkind\nError: near line 168: no such table: notificationkind\nError: near line 169: no such table: notificationkind\nError: near line 170: no such table: notificationkind\nError: near line 171: no such table: notificationkind\nError: near line 172: no such table: notificationkind\nError: near line 173: no such table: notificationkind\nError: near line 174: no such table: notificationkind\nError: near line 175: no such table: notificationkind\nError: near line 176: no such table: notificationkind\nError: near line 177: no such table: oauthapplication\nError: near line 178: no such table: oauthaccesstoken\nError: near line 179: no such table: teamrole\nError: near line 180: no such table: teamrole\nError: near line 181: no such table: teamrole\nError: near line 182: no such table: quotatype\nError: near line 183: no such table: quotatype\nError: near line 184: no such table: servicekeyapproval\nError: near line 185: no such table: servicekeyapproval\nError: near line 186: no such table: servicekey\nError: near line 187: no such table: servicekey\nError: near line 188: no such table: tagkind\nError: near line 189: no such table: userpromptkind\nError: near line 190: no such table: userpromptkind\nError: near line 191: no such table: userpromptkind", "stderr_lines": ["Error: near line 1: no such table: accesstokenkind", "Error: near line 2: no such table: accesstokenkind", "Error: near line 3: no such table: repositorykind", "Error: near line 4: no such table: repositorykind", "Error: near line 5: no such table: user", "Error: near line 6: no such table: visibility", "Error: near line 7: no such table: visibility", "Error: near line 8: no such table: role", "Error: near line 9: no such table: role", "Error: near line 10: no such table: role", "Error: near line 11: no such table: alembic_version", "Error: near line 12: no such table: mediatype", "Error: near line 13: no such table: mediatype", "Error: near line 14: no such table: mediatype", "Error: near line 15: no such table: mediatype", "Error: near line 16: no such table: mediatype", "Error: near line 17: no such table: mediatype", "Error: near line 18: no such table: mediatype", "Error: near line 19: no such table: mediatype", "Error: near line 20: no such table: mediatype", "Error: near line 21: no such table: mediatype", "Error: near line 22: no such table: mediatype", "Error: near line 23: no such table: mediatype", "Error: near line 24: no such table: mediatype", "Error: near line 25: no such table: mediatype", "Error: near line 26: no such table: mediatype", "Error: near line 27: no such table: mediatype", "Error: near line 28: no such table: mediatype", "Error: near line 29: no such table: mediatype", "Error: near line 30: no such table: apprblobplacementlocation", "Error: near line 31: no such table: apprblobplacementlocation", "Error: near line 32: no such table: apprtagkind", "Error: near line 33: no such table: apprtagkind", "Error: near line 34: no such table: apprtagkind", "Error: near line 35: no such table: imagestoragelocation", "Error: near line 36: no such table: imagestoragelocation", "Error: near line 37: no such table: imagestoragelocation", "Error: near line 38: no such table: imagestoragelocation", "Error: near line 39: no such table: imagestoragelocation", "Error: near line 40: no such table: imagestoragelocation", "Error: near line 41: no such table: imagestoragelocation", "Error: near line 42: no such table: imagestoragelocation", "Error: near line 43: no such table: imagestoragelocation", "Error: near line 44: no such table: buildtriggerservice", "Error: near line 45: no such table: buildtriggerservice", "Error: near line 46: no such table: buildtriggerservice", "Error: near line 47: no such table: buildtriggerservice", "Error: near line 48: no such table: imagestoragetransformation", "Error: near line 49: no such table: imagestoragetransformation", "Error: near line 50: no such table: disablereason", "Error: near line 51: no such table: disablereason", "Error: near line 52: no such table: disablereason", "Error: near line 53: no such table: externalnotificationevent", "Error: near line 54: no such table: externalnotificationevent", "Error: near line 55: no such table: externalnotificationevent", "Error: near line 56: no such table: externalnotificationevent", "Error: near line 57: no such table: externalnotificationevent", "Error: near line 58: no such table: externalnotificationevent", "Error: near line 59: no such table: externalnotificationevent", "Error: near line 60: no such table: externalnotificationevent", "Error: near line 61: no such table: externalnotificationevent", "Error: near line 62: no such table: externalnotificationevent", "Error: near line 63: no such table: externalnotificationmethod", "Error: near line 64: no such table: externalnotificationmethod", "Error: near line 65: no such table: externalnotificationmethod", "Error: near line 66: no such table: externalnotificationmethod", "Error: near line 67: no such table: externalnotificationmethod", "Error: near line 68: no such table: externalnotificationmethod", "Error: near line 69: no such table: loginservice", "Error: near line 70: no such table: loginservice", "Error: near line 71: no such table: loginservice", "Error: near line 72: no such table: loginservice", "Error: near line 73: no such table: loginservice", "Error: near line 74: no such table: loginservice", "Error: near line 75: no such table: loginservice", "Error: near line 76: no such table: imagestoragesignaturekind", "Error: near line 77: no such table: labelsourcetype", "Error: near line 78: no such table: labelsourcetype", "Error: near line 79: no such table: labelsourcetype", "Error: near line 80: no such table: logentrykind", "Error: near line 81: no such table: logentrykind", "Error: near line 82: no such table: logentrykind", "Error: near line 83: no such table: logentrykind", "Error: near line 84: no such table: logentrykind", "Error: near line 85: no such table: logentrykind", "Error: near line 86: no such table: logentrykind", "Error: near line 87: no such table: logentrykind", "Error: near line 88: no such table: logentrykind", "Error: near line 89: no such table: logentrykind", "Error: near line 90: no such table: logentrykind", "Error: near line 91: no such table: logentrykind", "Error: near line 92: no such table: logentrykind", "Error: near line 93: no such table: logentrykind", "Error: near line 94: no such table: logentrykind", "Error: near line 95: no such table: logentrykind", "Error: near line 96: no such table: logentrykind", "Error: near line 97: no such table: logentrykind", "Error: near line 98: no such table: logentrykind", "Error: near line 99: no such table: logentrykind", "Error: near line 100: no such table: logentrykind", "Error: near line 101: no such table: logentrykind", "Error: near line 102: no such table: logentrykind", "Error: near line 103: no such table: logentrykind", "Error: near line 104: no such table: logentrykind", "Error: near line 105: no such table: logentrykind", "Error: near line 106: no such table: logentrykind", "Error: near line 107: no such table: logentrykind", "Error: near line 108: no such table: logentrykind", "Error: near line 109: no such table: logentrykind", "Error: near line 110: no such table: logentrykind", "Error: near line 111: no such table: logentrykind", "Error: near line 112: no such table: logentrykind", "Error: near line 113: no such table: logentrykind", "Error: near line 114: no such table: logentrykind", "Error: near line 115: no such table: logentrykind", "Error: near line 116: no such table: logentrykind", "Error: near line 117: no such table: logentrykind", "Error: near line 118: no such table: logentrykind", "Error: near line 119: no such table: logentrykind", "Error: near line 120: no such table: logentrykind", "Error: near line 121: no such table: logentrykind", "Error: near line 122: no such table: logentrykind", "Error: near line 123: no such table: logentrykind", "Error: near line 124: no such table: logentrykind", "Error: near line 125: no such table: logentrykind", "Error: near line 126: no such table: logentrykind", "Error: near line 127: no such table: logentrykind", "Error: near line 128: no such table: logentrykind", "Error: near line 129: no such table: logentrykind", "Error: near line 130: no such table: logentrykind", "Error: near line 131: no such table: logentrykind", "Error: near line 132: no such table: logentrykind", "Error: near line 133: no such table: logentrykind", "Error: near line 134: no such table: logentrykind", "Error: near line 135: no such table: logentrykind", "Error: near line 136: no such table: logentrykind", "Error: near line 137: no such table: logentrykind", "Error: near line 138: no such table: logentrykind", "Error: near line 139: no such table: logentrykind", "Error: near line 140: no such table: logentrykind", "Error: near line 141: no such table: logentrykind", "Error: near line 142: no such table: logentrykind", "Error: near line 143: no such table: logentrykind", "Error: near line 144: no such table: logentrykind", "Error: near line 145: no such table: logentrykind", "Error: near line 146: no such table: logentrykind", "Error: near line 147: no such table: logentrykind", "Error: near line 148: no such table: logentrykind", "Error: near line 149: no such table: logentrykind", "Error: near line 150: no such table: logentrykind", "Error: near line 151: no such table: logentrykind", "Error: near line 152: no such table: logentrykind", "Error: near line 153: no such table: logentrykind", "Error: near line 154: no such table: logentrykind", "Error: near line 155: no such table: logentrykind", "Error: near line 156: no such table: logentrykind", "Error: near line 157: no such table: logentrykind", "Error: near line 158: no such table: logentrykind", "Error: near line 159: no such table: notificationkind", "Error: near line 160: no such table: notificationkind", "Error: near line 161: no such table: notificationkind", "Error: near line 162: no such table: notificationkind", "Error: near line 163: no such table: notificationkind", "Error: near line 164: no such table: notificationkind", "Error: near line 165: no such table: notificationkind", "Error: near line 166: no such table: notificationkind", "Error: near line 167: no such table: notificationkind", "Error: near line 168: no such table: notificationkind", "Error: near line 169: no such table: notificationkind", "Error: near line 170: no such table: notificationkind", "Error: near line 171: no such table: notificationkind", "Error: near line 172: no such table: notificationkind", "Error: near line 173: no such table: notificationkind", "Error: near line 174: no such table: notificationkind", "Error: near line 175: no such table: notificationkind", "Error: near line 176: no such table: notificationkind", "Error: near line 177: no such table: oauthapplication", "Error: near line 178: no such table: oauthaccesstoken", "Error: near line 179: no such table: teamrole", "Error: near line 180: no such table: teamrole", "Error: near line 181: no such table: teamrole", "Error: near line 182: no such table: quotatype", "Error: near line 183: no such table: quotatype", "Error: near line 184: no such table: servicekeyapproval", "Error: near line 185: no such table: servicekeyapproval", "Error: near line 186: no such table: servicekey", "Error: near line 187: no such table: servicekey", "Error: near line 188: no such table: tagkind", "Error: near line 189: no such table: userpromptkind", "Error: near line 190: no such table: userpromptkind", "Error: near line 191: no such table: userpromptkind"], "stdout": "", "stdout_lines": []}
      PLAY RECAP *******************************************************************************************************************************************************************************************************************************************************************************************************************
      cloud-user@quay-omr-rhel-47 : ok=60   changed=31   unreachable=0    failed=1    skipped=16   rescued=0    ignored=0   
      ERRO[2024-08-15 23:31:43] An error occurred: exit status 2

       

       

              hgovinda Harish Govindarajulu
              rhn-support-dyan Dongbo Yan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: