History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRA-4466
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Michael Tokar [Atlassian]
Reporter: Jeff Turner [Atlassian]
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JIRA

"time too late" errors while reindexing

Created: 05/Sep/04 08:23 PM   Updated: 13/Feb/08 01:26 AM
Component/s: Filtering & Indexing
Affects Version/s: 3.0 Pro Preview, 2.6.1 Pro
Fix Version/s: 3.13

Time Tracking:
Original Estimate: 2 hours
Original Estimate - 2 hours
Remaining Estimate: 0 minutes
Time Spent - 4 hours
Time Spent: 4 hours
Time Spent - 4 hours

Issue Links:
Part
 
Reference
 

Participants: Anton Mazkovoi [Atlassian], Baerrach bonDierne, Jeff Turner [Atlassian] and Michael Tokar [Atlassian]
Since last comment: 22 weeks, 4 days ago
Resolution Date: 12/Feb/08 07:42 PM
Labels:


 Description  « Hide
JIRA does not impose an upper limit on date fields. As a result, an invalid date can be entered that breaks lucene:

2004-09-04 11:46:30,969 WARN [jira.issue.index.DefaultIndexManager] There was an exception whilst reindexing issue
OPS-177java.lang.RuntimeException: time too late
java.lang.RuntimeException: time too late
at org.apache.lucene.document.DateField.timeToString(DateField.java:106)
at org.apache.lucene.document.DateField.dateToString(DateField.java:92)
at com.atlassian.jira.issue.index.AbstractDocument.indexDateField(AbstractDocument.java:96)
at com.atlassian.jira.issue.index.IssueDocument.getDocument(IssueDocument.java:64)
at com.atlassian.jira.issue.index.DefaultIndexManager.indexIssueAndComments(DefaultIndexManager.java:183)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexIssues(DefaultIndexManager.java:109)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexAll(DefaultIndexManager.java:71)
at com.atlassian.jira.web.action.admin.IndexAdminImpl.doReindex(IndexAdminImpl.java:208)
at com.atlassian.jira.web.action.admin.IndexAdminImpl.doActivate(IndexAdminImpl.java:159)
at com.atlassian.jira.web.action.admin.IndexAdminImpl.doReindex(IndexAdminImpl.java:202)

We can fix this by imposing the date length limit that Lucene imposes:

// make date strings long enough to last a millenium
private static int DATE_LEN = Long.toString(1000L*365*24*60*60*1000, Character.MAX_RADIX).length();
....
if (s.length() > DATE_LEN)
throw new RuntimeException("time too late");



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Baerrach bonDierne - 03/Jun/07 11:34 PM
For those that find this error via google and need a workaround, support suggested the following:

The workaround is to log into your database and use raw sql to locate the issues.

You can probably manipulate the values in sql too, but you can individually browse to the issue in Jira (once you know the issue id from the sql query above) and edit the value to a value that doesn't produce errors.

My setup is Jira runs under Tomcat 5.0 and uses mysql as the database. Your environment may differ but the basic steps are the same:

Logon to the box and read up on how to configure a database in Tomcat 5.0. This will tell you the username/password needed.

Logon to the mysql database:

Run
mysql> select id, pkey, duedate from jiraissue where duedate > '2050-01-01' order by pkey;

This will list anything due after 2050 and you can systematically work your way through any keys that are dodgy in rendering because of large date values.


Michael Tokar [Atlassian] - 12/Feb/08 07:42 PM
Removed PeriodParameter class from JIRA and changed all instances in the code to use RelativeDateRangeParameter instead.

Since the Lucene upgrade to v2.2, we only use the new DateTools class provided by Lucene to index dates in JIRA (and not DateField). This effectively prevents the described error from occurring.


Anton Mazkovoi [Atlassian] - 13/Feb/08 01:26 AM
This error should really not appear in JIRA 3.11 or above as Lucene was updated to 2.2.