Bug 1352985

Summary: Frequently logged : Could not load codec 'Lucene53'. Did you forget to add lucene-backward-codecs.jar?
Product: [Fedora] Fedora Reporter: Roland Grunberg <rgrunber>
Component: eclipse-mylynAssignee: Alexander Kurtakov <akurtako>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: 25CC: akurtako, andjrobins, eclipse-sig, extras-orphan, krzysztof.daniel, minoo.ziaei, overholt, rgrunber
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-16 19:22:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roland Grunberg 2016-07-05 16:46:57 UTC
This also triggers an error dialog, so it becomes quite annoying. I keep all my tasks in a separate location on my system and my workspaces point to it. If no one is seeing this when starting with an empty task list, there's a good chance this is related to task migration under newer versions of lucene.

java.lang.IllegalArgumentException: Could not load codec 'Lucene53'.  Did you forget to add lucene-backward-codecs.jar?
	at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:481)
	at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:361)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:910)
	at org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex.createIndexWriter(TaskListIndex.java:1274)
	at org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex.rebuildIndexCompletely(TaskListIndex.java:1217)
	at org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex.maintainIndex(TaskListIndex.java:1085)
	at org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex.access$0(TaskListIndex.java:1066)
	at org.eclipse.mylyn.internal.tasks.index.core.TaskListIndex$MaintainIndexJob.run(TaskListIndex.java:183)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.IllegalArgumentException: An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene53' does not exist.  You need to add the corresponding JAR file supporting this SPI to your classpath.  The current classpath supports the following names: [Lucene54]
	at org.apache.lucene.util.NamedSPILoader.lookup(NamedSPILoader.java:116)
	at org.apache.lucene.codecs.Codec.forName(Codec.java:113)
	at org.apache.lucene.index.SegmentInfos.readCodec(SegmentInfos.java:469)
	... 8 more

Comment 1 Roland Grunberg 2016-07-08 14:31:44 UTC
Easy workaround was to delete .taskListIndex/ folder from the mylyn task data storage location. For most users this will probably be in $WORKSAPCE/.metadata/.mylyn/.taskListIndex/ assuming they usd the default location. The index seems to have been re-built and the error no longer occurs.

I'm fine with having this be the workaround, given that lucene may from time to time offer backward compatibility into bundles we don't/can't ship.

Comment 2 Roland Grunberg 2016-07-14 14:40:08 UTC
It seems we do ship lucene-backward-codecs as a subpackage so I guess the question becomes whether we want to support backward compatibility of indices.

Comment 3 Alexander Kurtakov 2016-07-14 14:42:09 UTC
IIRC this is only for the previous release, aka v4 indexes could be read with these but not v3 (which upstream still uses and generates).
We should not support multiple versoins but mylyn code has to be patched to recreate a v5 index in this case instead of throwing an error. I think that Sopot's platform patch does this already.

Comment 4 Jan Kurik 2016-07-26 04:03:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 25 development cycle.
Changing version to '25'.

Comment 5 Alexander Kurtakov 2017-05-10 17:58:28 UTC
Roland, can we close this one?

Comment 6 Roland Grunberg 2017-05-16 19:22:38 UTC
I think we can close this for now as WORKSFORME. I haven't run into this error for a while.