BlackLab icon indicating copy to clipboard operation
BlackLab copied to clipboard

Indexing error related to tags and TSV

Open jan-niestadt opened this issue 2 years ago • 0 comments

Certain (rare) inputs can cause this error. We're trying to set a payload for a non-existent position. How can this happen? Could this be an empty document containing only a tag?

Also improve how this is reported, so we know what line of the input file we're at.

An error occurred during indexing!
error: Index 0 out of bounds for length 0 (in /home/jan/Downloads/ImpFic_BlackLab/parts/part1.tsv)
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.set(ArrayList.java:473)
	at nl.inl.blacklab.index.annotated.AnnotationWriter.setPayloadAtIndex(AnnotationWriter.java:392)
	at nl.inl.blacklab.indexers.config.DocIndexerBase.inlineTag(DocIndexerBase.java:541)
	at nl.inl.blacklab.indexers.config.DocIndexerTabular.index(DocIndexerTabular.java:246)
	at nl.inl.blacklab.index.IndexerImpl$DocIndexerWrapper.impl(IndexerImpl.java:112)
	at nl.inl.blacklab.index.IndexerImpl$DocIndexerWrapper.file(IndexerImpl.java:82)
	at nl.inl.util.FileProcessor.lambda$processFile$7(FileProcessor.java:489)
	at nl.inl.util.FileProcessor.lambda$makeRunnable$9(FileProcessor.java:586)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)

jan-niestadt avatar Aug 19 '22 09:08 jan-niestadt