java.lang.NullPointerException while running JQL with fixVersion

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

  1. java.lang.NullPointerException appears when running a JQL query like : fixVersion >= "2.2.0_00"
  2. The following query returns one or more rows:

    select pv.id
    from projectversion pv
    left join project p
    on pv.project = p.id
    where p.id is null

The following appears in the atlassian-jira.log:

2011-08-05 17:38:10,941 http-8080-2 ERROR      [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
 at com.atlassian.jira.jql.util.JqlVersionPredicate$1.evaluate(JqlVersionPredicate.java:23)
 at com.atlassian.jira.jql.util.JqlVersionPredicate$1.evaluate(JqlVersionPredicate.java:20)
 at com.atlassian.jira.util.EvaluateAllPredicate.evaluate(EvaluateAllPredicate.java:27)2011-08-05 17:38:10,941 http-8080-2 ERROR      [500ErrorPage.jsp] Exception caught in 500 page null
java.lang.NullPointerException
	at com.atlassian.jira.jql.util.JqlVersionPredicate$1.evaluate(JqlVersionPredicate.java:23)
	at com.atlassian.jira.jql.util.JqlVersionPredicate$1.evaluate(JqlVersionPredicate.java:20)
	at com.atlassian.jira.util.EvaluateAllPredicate.evaluate(EvaluateAllPredicate.java:27)
	at com.atlassian.jira.util.collect.CollectionUtil$GCollectPredicate.apply(CollectionUtil.java:475)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:603)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:135)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:130)
	at com.atlassian.jira.jql.query.RelationalOperatorIdIndexValueQueryFactory.generateRangeQueryForPredicate(RelationalOperatorIdIndexValueQueryFactory.java:130)
 at com.atlassian.jira.util.collect.CollectionUtil$GCollectPredicate.apply(CollectionUtil.java:475)
 at com.google.common.collect.Iterators$7.computeNext(Iterators.java:603)
 at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:135)
 at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:130)
 at com.atlassian.jira.jql.query.RelationalOperatorIdIndexValueQueryFactory.generateRangeQueryForPredicate(RelationalOperatorIdIndexValueQueryFactory.java:130)

Cause

There is inconsistency in database with respect to fixVersion.  There are one or more versions that are not attached to any project. The reason for this could be the result of direct database operations done previously.

Resolution

  1. Run the following query in the database to remove the inconsistency :

    delete from projectversion pro
    where pro.id in
    (select pv.id from projectversion pv left join project p
    on pv.project = p.id
    where p.id is null);
    
  2. Restart JIRA.
  3. Re-index JIRA.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.