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

JqlParseException thrown by foreach method of DatabaseIterable over all search filters

XMLWordPrintable

      The following code:

      searchRequestManager.getAll().foreach(new SharedEntityGroupUpdator<SearchRequest>(oldName, newName, filterPermissions));
      

      is throwing the following exception:

      com.atlassian.jira.exception.DataAccessException: com.atlassian.jira.jql.parser.JqlParseException:com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:415)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore.convertGVToRequest(OfBizSearchRequestStore.java:389)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore.access$000(OfBizSearchRequestStore.java:48)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:84)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore$1.get(OfBizSearchRequestStore.java:82)
      	at com.atlassian.jira.ofbiz.DatabaseIterator.pullNext(DatabaseIterator.java:69)
      	at com.atlassian.jira.ofbiz.DatabaseIterator.populateNextIfNull(DatabaseIterator.java:78)
      	at com.atlassian.jira.ofbiz.DatabaseIterator.hasNext(DatabaseIterator.java:41)
      	at com.atlassian.jira.util.collect.CollectionUtil.foreach(CollectionUtil.java:41)
      	at com.atlassian.jira.util.collect.CloseableIterator$Functions.foreach(CloseableIterator.java:58)
      	at com.atlassian.jira.ofbiz.DatabaseIterable.foreach(DatabaseIterable.java:45)
      	at com.atlassian.jira.util.collect.TransformingEnclosedIterable.foreach(TransformingEnclosedIterable.java:29)
      	at com.atlassian.studio.importer.DefaultStudioImportManager.updateGroupName(DefaultStudioImportManager.java:400)
      	at com.atlassian.studio.importer.DefaultStudioImportManager.postImportStudify(DefaultStudioImportManager.java:298)
      	at com.atlassian.jira.studio.importer.StudioImport.doImport(StudioImport.java:100)
      ...
      Caused by: com.atlassian.jira.jql.parser.JqlParseException: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)
      	at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:135)
      	at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseQuery(DefaultJqlQueryParser.java:37)
      	at sun.reflect.GeneratedMethodAccessor274.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:592)
      	at com.atlassian.jira.ProxyAdapter$ProxiedComponentInvocationHandler.invoke(ProxyAdapter.java:167)
      	at $Proxy141.parseQuery(Unknown Source)
      	at com.atlassian.jira.issue.search.OfBizSearchRequestStore.getSearchQueryFromGv(OfBizSearchRequestStore.java:410)
      	... 122 more
      Caused by: com.atlassian.jira.jql.parser.antlr.RuntimeRecognitionException: MismatchedSetException(46!=null)
      	at com.atlassian.jira.jql.parser.antlr.LexerErrorHelper.handleError(LexerErrorHelper.java:54)
      	at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:121)
      	at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:127)
      	at com.atlassian.jira.jql.parser.antlr.JqlLexer.mERROR_RESERVED(JqlLexer.java:1511)
      	at com.atlassian.jira.jql.parser.antlr.JqlLexer.mTokens(JqlLexer.java:2207)
      	at org.antlr.runtime.Lexer.nextToken(Lexer.java:84)
      	at org.antlr.runtime.CommonTokenStream.fillBuffer(CommonTokenStream.java:119)
      	at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:238)
      	at com.atlassian.jira.jql.parser.antlr.JqlParser.query(JqlParser.java:191)
      	at com.atlassian.jira.jql.parser.DefaultJqlQueryParser.parseClause(DefaultJqlQueryParser.java:124)
      	... 129 more
      Caused by: MismatchedSetException(46!=null)
      	at com.atlassian.jira.jql.parser.antlr.JqlLexer.recover(JqlLexer.java:126)
      	... 136 more
      
      

      It would appear that one of the filters being loaded has invalid JQL. I don't think this should stop them from being loaded from the database by the DatabaseIterable though. This error occurred after a fresh JIRA import (that's probably how the corrupt filter got in there), during the Studio import process.

      Cause
      An invalid character gets stored into searchrequest the database, for example the query is stored like this:

      fixVersion = 3.0
      
      • this causes problems as JIRA cannot properly parse the 3.0

      Instead, what should be stored is:

      fixVersion = "3.0"
      
      • It is not known how the JQL gets improperly stored into the db

              Unassigned Unassigned
              jroper James Roper [Atlassian]
              Votes:
              21 Vote for this issue
              Watchers:
              23 Start watching this issue

                Created:
                Updated: