Jan Høydahl created SOLR-18655:
----------------------------------
Summary: solr postlogs drops log records with an NPE and still
exits 0
Key: SOLR-18655
URL: https://issues.apache.org/jira/browse/SOLR-18655
Project: Solr
Issue Type: Bug
Components: cli
Reporter: Jan Høydahl
*Found by CATS*, the cross-platform CLI test framework proposed in SOLR-18642 —
see [PR #5323|https://github.com/apache/solr/pull/5323].
h3. Problem
{{solr postlogs}} silently drops log records it cannot parse, gives an NPE as
the reason, and still exits 0. Indexing Solr's own {{solr.log}}:
{code}
Error reading log record:43 from file:solr.log
Cannot invoke "String.split(String)" because "params" is null
{code}
A handful of records per file — 43-46 and 91 in one run — never reach the
index. Neither the exit status nor the closing summary says the index is
incomplete, so a partial index looks like a complete one.
h3. Cause
{{PostLogsTool.parseParams}} returns null for a query line that does not hold
exactly one {{ params=}} section, and {{parseQueryRecord}} hands that straight
to {{addParams}}, which splits it with no null check. The read loop catches
{{Throwable}}, prints the two lines above and continues to the next record.
So the message names the symptom rather than the line that could not be parsed,
and the failure is invisible to anything checking the status.
h3. Steps to reproduce
{code}solr postlogs --solr-url http://localhost:8983 --name logs
/path/to/solr.log{code}
against a log containing a query record with no {{params=}} section.
🤖 AI Assisted
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]