IBM Support

IBM i2 EIA Errors with "java.lang.IllegalArgumentException: expected one element but was" when SOLR is indexing

Troubleshooting


Problem

While indexing from the database, an error is thrown and the index cannot continue.
The error appears as the following:
WARN InfoStoreRecordGroupIndexer - Encountered an exception while preparing batches for indexing.
Will retry from last successful batch. com.i2group.utils.exception.
WrappedCheckedException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: expected one element but was: <CSVRecord [comment=null, mapping=null, recordNumber=#, values=[XXXXXXXXX]], CSVRecord [comment=null, mapping=null, recordNumber=#, values=[XXXXXXXXX]]>

Symptom

Error message in indexer log. 
setup -t indexSyncCheck shows not in sync between the Information Store and Solr Index.
You may see similar messages if the index is not in sync.
> INFO [IndexSyncTool] - The number of records in the Information Store database and the Solr index 'main_index' for item type <ET44> are not the same: > INFO [IndexSyncTool] - Information Store: 100,000 > INFO [IndexSyncTool] - Solr index: 50,000

Cause

One or more records are formatted incorrectly. If a specific record appears as part of the error message, query your source for this record and compare it to other records that were successfully indexed.
If the record is in an SQL database, you can export the row as a CSV file and open it in Notepad++. After exporting to Notepad++, enable to Show Symbols in order to view all the data in the file.
show
show symbol
If your data should be contained on one row with spaces between words, but is shown on multiple rows with CR LF between words, this could be causing issues during indexing. CRLF is "Carriage Return, Line Feed", causing a line break in the text. If Solr is configured to treat line breaks as record delimiters, the CRLF character between words in the same record would cause Solr to treat the record as two separate elements. These two separate elements would not be indexed properly because they are missing mandatory fields.
The record could potentially have other troublesome characters such as tabs, commas, semi-colons.

Environment

EIA
Solr

Diagnosing The Problem

View the troublesome record(s) in the source data and in the database before being pulled in for indexing. 
Export the record out and inspect it for nonconformities.

Resolving The Problem

If a record has characters that other records do not, you may need to adjust your data transformation to account for these. To get the indexing resumed, you want to delete the problematic record from the Information Store and ensure it no longer enters the database with incorrect characters.
Run the indexSyncCheck command to verify that indexing is now in sync.
1)  Locate the Command Prompt console for the deployment on your server.
 
2)  Type in setup -t indexSyncCheck -s opal-server and press Enter
   

Additional Information

If the Information Store and Solr index are in sync, there is no confirmation message displayed, just this Info message.
 
> INFO [IndexSyncTool] - If there are ingestion or deletion operations in progress, it might be reported that the index and database are out of sync. If an out of sync state is still reported when there are no operations in progress, you can clear the Solr index and restart Liberty to reindex the data in the database
 
Finished in 12 seconds
 

You only get a "not in sync" message when they are out of sync. 

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB24","label":"Security Software"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSXVXZ","label":"IBM i2 Enterprise Insight Analysis"},"ARM Category":[{"code":"a8m0z000000cwiuAAA","label":"i2 Enterprise Insight Analysis->Ingestion"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
20 October 2021

UID

ibm16507107