Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-3721

Date time template field breaks when reindex

    Details

    • Type: Bug
    • Status: Triage (View Workflow)
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 5.5.7.1-jira8, 6.3.0-p5
    • Fix Version/s: None
    • Component/s: Scripted Fields
    • Labels:
      None
    • Critical Points:
      3.6

      Description

      The script code here causes errors in the index if the Searcher is set to "Date Time Range Picker" for the custom field which is defined as a "Date Time".

      https://scriptrunner.adaptavist.com/latest/jira/recipes/scriptfields/dateOfFirstTransition.html

      When the database is reindexed the log is flooded with this error:

      cannot change DocValues type from SORTED to NUMERIC for field
      

      Attempts to add a new issue fail with "unexpected error" messages.

      Steps to reproduce it

      1. Create a new script field with a Template of "Date Time".
      2. By default, that script is going to have global scope and have a default Searcher of "Free Text Searcher".
      3. Run background reindex.
      4. Logs shows this:
        2019-08-13 09:52:15,027 JiraTaskExectionThread-2 WARN admin 592x7335x1 5w42m2 172.17.0.1 /secure/admin/jira/IndexReIndex!reindex.jspa [c.a.jira.index.AccumulatingResultBuilder] cannot change DocValues type from SORTED to NUMERIC for field "sort_customfield_10905"
        

      Workaround

      Background reindex doesn't seem to clean things up. It requires a locked reindex, which is disruptive in a large system.

        Attachments

          Structure

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jloong John Chin Loong
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Structure Helper Panel