apache/beam · error · IOException
Error writing to Solr (no attempt made to retry)
Error message
Error writing to Solr (no attempt made to retry)
What it means
SolrIO's write path retries failed add/commit requests according to the configured RetryConfiguration. When an exception occurs that the retry predicate does not accept (or no RetryConfiguration is set), the writer fails immediately with this IOException instead of retrying, preserving the original exception as the cause.
Source
Thrown at sdks/java/io/solr/src/main/java/org/apache/beam/sdk/io/solr/SolrIO.java:667
}
try {
UpdateRequest updateRequest = new UpdateRequest();
updateRequest.add(batch);
Sleeper sleeper = Sleeper.DEFAULT;
BackOff backoff = retryBackoff.backoff();
int attempt = 0;
while (true) {
attempt++;
try {
solrClient.process(spec.getCollection(), updateRequest);
break;
} catch (Exception exception) {
// fail immediately if no retry configuration doesn't handle this
if (spec.getRetryConfiguration() == null
|| !spec.getRetryConfiguration().getRetryPredicate().test(exception)) {
throw new IOException(
"Error writing to Solr (no attempt made to retry)", exception);
}
// see if we can pause and try again
if (!BackOffUtils.next(sleeper, backoff)) {
throw new IOException(
String.format(
"Error writing to Solr after %d attempt(s). No more attempts allowed",
attempt),
exception);
} else {
// Note: this used in test cases to verify behavior
LOG.warn(String.format(RETRY_ATTEMPT_LOG, attempt), exception);
}
}
}
} finally {View on GitHub (pinned to 12126d8942)
Solutions
- Configure a RetryConfiguration with a predicate covering the transient errors you expect: .withRetryConfiguration(SolrIO.RetryConfiguration.create(...))
- Fix the underlying non-retryable cause (check the chained exception: auth, schema, collection)
- Validate documents against the Solr schema before writing (required fields, field types)
- Ensure Solr credentials/URLs in ConnectionConfiguration are correct
Example fix
// before
SolrIO.write(solrIO); // no retry config -> immediate failure on any exception
// after
SolrIO.write(solrIO)
.withRetryConfiguration(SolrIO.RetryConfiguration.create(10, org.joda.time.Duration.standardSeconds(1))); Defensive patterns
Strategy: retry
Validate before calling
if (solrIOWrite.getRetryConfiguration() == null) {
throw new IllegalArgumentException("Configure a RetryConfiguration for SolrIO.write");
} Try / catch
try {
result.get();
} catch (Exception e) {
Throwable cause = e.getCause();
LOG.error("Non-retryable Solr write error: " + cause.getMessage(), cause);
} Prevention
- Always call withRetryConfiguration on SolrIO.write
- Classify retryable vs non-retryable exceptions in the retry predicate
- Validate document schema conformance before writing
- Verify Solr credentials and connection settings
When it happens
Trigger: Solr add/commit throws an exception that either no RetryConfiguration is configured for (spec.getRetryConfiguration() == null) or whose retry predicate returns false for — e.g. authentication failures, malformed documents, or non-retryable HTTP errors.
Common situations: Missing withRetryConfiguration() on the write; Solr returning 401/403 or schema errors that the default predicate deems non-retryable; documents violating Solr schema (missing unique key, bad field types).
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- Error writing to Solr after %d attempt(s). No more attempts
- Error writing to ES after %d attempt(s). No more attempts al
- Writing of ARRAY type is not supported by the default UserDa
- Writing of ITERABLE type is not supported by the default Use
- Writing of MAP type is not supported by the default UserData
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/5084873e6fed9fe7.
Report an issue: GitHub.