Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-42747

Database table reindex_request includes a column that is not included in the ReindexRequest entity

    XMLWordPrintable

Details

    Description

      Summary

      The ReindexRequest entity introduced in JIRA 6.3.8 originally contained a query column that is no longer included, but no upgrade task has been defined to remove the column from the table in the database.

      Steps to Reproduce

      1. Install JIRA 6.3.8, using a database such as PostgreSQL.
      2. Upgrade it to 6.3.13 or higher.
      3. Start JIRA and watch the logs.

      The ReindexRequest entity was introduced in JIRA 6.3.8, and then modified in JIRA 6.3.13 to remove the query field. Therefore, this problem will only affect JIRA installations that were upgraded to one of JIRA 6.3.8 - 6.3.12, and then upgraded again to JIRA 6.3.13 or higher. In our case, we upgraded to JIRA 6.3.9 and then 6.3.15.

      Expected Results

      There are no warnings on startup, as the column no longer exists as it was removed in an upgrade task.

      Actual Results

      As a result, when we start our instance, we see the following warnings in our log:

      2015-04-01 10:34:13,819 localhost-startStop-1 WARN      [core.entity.jdbc.DatabaseUtil] Column "QUERY" of table "public.reindex_request" of entity "ReindexRequest" exists in the database but has no corresponding field
      2015-04-01 10:34:13,821 localhost-startStop-1 WARN      [core.entity.jdbc.DatabaseUtil] Entity "ReindexRequest" has 7 fields but table "public.reindex_request" has 8 columns.
      

      Workaround

      1. Create an XML backup of the instance.
      2. Restore that backup onto the instance.

      This will overwrite the existing database with the new one, and recreate the schema from scratch. Either that or drop the query column from the table (not recommended as it's not known what other problems this could cause).

      Notes

      Here are the relevant snippets from jira-project/jira-components/jira-core/src/main/ofbiz/entitydefs/entitymodel.xml to show the difference:

      entitymodel.xml - JIRA 6.3.8
          <entity entity-name="ReindexRequest" table-name="reindex_request" package-name="">
              <field name="id" type="numeric"/>
      
              <field name="type" type="short-varchar"/>
              <field name="query" type="very-long"/>
              <field name="requestTime" type="date-time"/>
              <field name="startTime" type="date-time"/>
              <field name="completionTime" type="date-time"/>
              <field name="status" type="short-varchar"/>
      
              <prim-key field="id" />
          </entity>
      
      entitymodel.xml - JIRA 6.3.13
          <entity entity-name="ReindexRequest" table-name="reindex_request" package-name="">
              <field name="id" type="numeric"/>
      
              <field name="type" type="short-varchar"/>
              <field name="requestTime" type="date-time"/>
              <field name="startTime" type="date-time"/>
              <field name="completionTime" type="date-time"/>
              <field name="status" type="short-varchar"/>
              <field name="executionNodeId" type="short-varchar" />
      
              <prim-key field="id" />
          </entity>
      

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              7ce5f856ba69 Kavian Moradhassel
              Votes:
              8 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: