cocoindex-io/cocoindex · error · DorisConnectionError

{operation_name} failed after {config.max_retries + 1} attem

Error message

{operation_name} failed after {config.max_retries + 1} attempts

What it means

Raised by the Doris connector's _with_retry wrapper when an operation (e.g. Stream Load) still fails after exhausting config.max_retries + 1 attempts. It wraps the last underlying error in a DorisConnectionError, indicating persistent connectivity/availability problems rather than a transient blip.

Source

Thrown at python/cocoindex/connectors/doris/_target.py:245

        except Exception as e:
            if not _is_retryable_error(e):
                raise
            last_error = e
            if attempt < config.max_retries:
                delay = min(
                    config.base_delay * (config.exponential_base**attempt),
                    config.max_delay,
                )
                _logger.warning(
                    "%s failed (attempt %d/%d), retrying in %.1fs: %s",
                    operation_name,
                    attempt + 1,
                    config.max_retries + 1,
                    delay,
                    e,
                )
                await asyncio.sleep(delay)
    raise DorisConnectionError(
        f"{operation_name} failed after {config.max_retries + 1} attempts",
        host="",
        port=0,
        cause=last_error,
    )


# ============================================================
# Type mapping: Python -> Doris SQL
# ============================================================


class _TypeMapping(NamedTuple):
    doris_type: str
    encoder: ValueEncoder | None = None


_LEAF_TYPE_MAPPINGS: dict[type, _TypeMapping] = {

View on GitHub (pinned to e84aa99b32)

Solutions

  1. Check Doris FE/BE health and connectivity (host, port, firewall, DNS) using curl against the stream-load endpoint.
  2. Inspect the chained `cause` (last_error) for the root failure — auth errors won't fix themselves with retries.
  3. Increase `config.max_retries` and/or backoff if the network is genuinely flaky; otherwise fix the underlying connectivity problem.
  4. Verify credentials and table/label settings so retries aren't doomed from attempt 1.

Example fix

// before
config = DorisConfig(host="fe.internal", max_retries=2)
// after
config = DorisConfig(host="fe.internal", port=8030, max_retries=5)  # + verify host/port/creds reach Doris
Defensive patterns

Strategy: retry

Validate before calling

import socket
socket.create_connection((config.host, config.port), timeout=5)  # pre-check reachability

Try / catch

try:
    app.update()
except DorisConnectionError as e:
    logger.error("Doris op failed permanently: %s", e.cause)
    # alert / back off / check cluster health before re-running

Prevention

When it happens

Trigger: Calling _stream_load against an unreachable, overloaded, or repeatedly-5xxing Doris FE/BE so every attempt fails and retries are exhausted.

Common situations: Wrong host/port or DNS failure; Doris cluster down or restarting; auth failures repeated on every attempt; network partitions in k8s environments; max_retries set too low for a flaky network.

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


AI-assisted analysis of cocoindex-io/cocoindex@e84aa99b32 (2026-09-08). Data as JSON: /api/errors/6edfeff1d41c9edf. Report an issue: GitHub.