Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-101053

When creating a question, topic suggestion failures is blocking user from creating question

XMLWordPrintable

      Issue Summary

      User cannot create question, using Confluence Question plugin, topic suggestion is loading but never finishes.

      Steps to Reproduce

      1. Set up OpenSearch service, and use OpenSearch as the search platform
      2. Install Confluence 9.2.6 with Confluence Questions plugin version 5.0.9. Use OpenSearch as the search platform
      3. Create a new question with text and a mandatory topic (e.g., "Jira 2"), save, flush the queue if needed, and verify it appears under Questions.
      4. Open the same question in two browser tabs (or simulate two users editing) and click editing topic so that topic field is in edit mode.
      5. In Tab 1, remove a topic and save.
      6. In Tab 2, remove another topic and save.
      7. Go to create new question page 

      Expected Results

      The question and topics are updated consistently without errors. In the create question page, topic field can suggest topics, and the user can continue creating or editing questions.

      Actual Results

      In the create question page, a 500 error is returned in the web console. Topics disappear from the Topics page, and creating new questions shows a loading spinner that never resolves.

      Exception can be found in logs like following

      "type": "search_phase_execution_exception",        
      "reason": "all shards failed",        
      "caused_by": {            "type": "illegal_argument_exception",            "reason": "field value function must not produce negative scores, but got: [-1.0] for field value: [-1.0]",            
          "caused_by": {                
              "type": "illegal_argument_exception",                
              "reason": "field value function must not produce negative scores, but got: [-1.0] for field value: [-1.0]"            
          }        
      },

      This can be verified by running this SQL query to the DB

       

      -- this should return 0 rows
      -- as we expecting all cq-topic-question-count to be non-negetive
      -- otherwise the 'cq-topic-question-count' data is broken in DB
      select * from contentproperties where propertyname = 'cq-topic-question-count' and longval < 0;

       

      Workaround

      Update the database to remove negative values in the `CQ_TOPIC_QUESTION_COUNT` field:

       

      update contentproperties set longval = 0 where propertyname = 'cq-topic-question-count' and longval < 0;

       

      Then run a full Confluence re-index.  
      After re-index, topics reappear and new questions can be created successfully.

              277a310a9aa8 Michael Yang
              277a310a9aa8 Michael Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: