apache/beam · error · IOException
Error writing to Solr after %d attempt(s). No more attempts
Error message
Error writing to Solr after %d attempt(s). No more attempts allowed
What it means
After the retry predicate accepts an exception, SolrIO pauses between attempts using the configured backoff. When the backoff is exhausted (BackOffUtils.next returns false), the writer gives up and throws this IOException reporting the number of attempts made, with the last exception as cause.
Source
Thrown at sdks/java/io/solr/src/main/java/org/apache/beam/sdk/io/solr/SolrIO.java:673
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 {
batch.clear();
}
}
@Teardown
public void closeClient() throws IOException {View on GitHub (pinned to 12126d8942)
Solutions
- Increase retryConfiguration attempts and backoff duration to cover the expected outage window
- Restore Solr service / resolve the root cause in the chained exception
- Check network connectivity between workers and Solr nodes
- Consider batching fewer documents per request to reduce load-related failures
Example fix
// before SolrIO.RetryConfiguration.create(3, Duration.standardSeconds(1)) // after SolrIO.RetryConfiguration.create(20, Duration.standardSeconds(5))
Defensive patterns
Strategy: retry
Validate before calling
// ensure budget covers expected outage RetryConfiguration rc = SolrIO.RetryConfiguration.create(20, Duration.standardSeconds(5));
Try / catch
try {
result.get();
} catch (Exception e) {
LOG.error("Solr writes exhausted all retries; check Solr availability", e.getCause());
} Prevention
- Size maxAttempts and backoff to exceed plausible outage durations
- Alert on Solr health so outages are fixed before retries exhaust
- Monitor worker-to-Solr network paths
- Reduce batch sizes to lower per-request failure probability
When it happens
Trigger: Persistent Solr failures across every retry attempt — e.g. Solr down for longer than the total backoff budget, repeated timeouts, or sustained overload — with a RetryConfiguration whose maxAttempts/backoff are exceeded.
Common situations: Solr cluster outage or maintenance window during pipeline run; maxAttempts set too low or backoff too short for realistic recovery; network partition between Beam workers and Solr.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Error writing to Solr (no attempt made to retry)
- Error writing to ES after %d attempt(s). No more attempts al
- cannot encode a null SolrDocument
- Invalid encoded SolrDocument length: ${len}
- Can not get unique key from solr
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/440488e87c19b659.
Report an issue: GitHub.