Jan Høydahl created SOLR-18653:
----------------------------------
Summary: solr post reports "1 files indexed." when every document
failed
Key: SOLR-18653
URL: https://issues.apache.org/jira/browse/SOLR-18653
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. Summary
{{solr post}} counts the files it attempted to send rather than the files the
server accepted, and prints that count as "N files indexed." A post in which
every document was rejected still reports success. The HTTP layer does know
better - a response of 400 or above is recognised as a failure - but that
result is discarded before it reaches the counter.
The exit status usually saves it, though not for the reason one would hope: the
count is printed first, and the non-zero status comes from the commit that
follows. Pass {{\-\-skip\-commit}} and the command exits 0 as well, so neither
the output nor the status reflects what happened.
h3. Steps to reproduce
Post a file to a collection that does not exist:
{code}solr post -t application/xml --solr-url http://localhost:8983 --name
nosuchcollection example/exampledocs/monitor.xml{code}
h3. Expected
A count of what was actually indexed - zero - and wording that does not claim
success.
h3. Actual
A {{WARNING}} naming the 404, immediately followed by {{1 files indexed.}}
🤖 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]