risingwavelabs/risingwave · error · SinkError

ElasticSearch/OpenSearch error: {0}

Error message

ElasticSearch/OpenSearch error: {0}

What it means

A SinkError variant wrapping an anyhow::Error from the elasticsearch crate. Raised when requests to Elasticsearch or OpenSearch fail during sink indexing: connection errors, HTTP error responses, bulk indexing rejections, or mapping conflicts.

Source

Thrown at src/connector/src/sink/mod.rs:1174

        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error("Doris error: {0}")]
    Doris(String),
    #[error("DeltaLake error: {0}")]
    DeltaLake(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error("LanceDB error: {0}")]
    LanceDb(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error("ElasticSearch/OpenSearch error: {0}")]
    ElasticSearchOpenSearch(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error("Starrocks error: {0}")]
    Starrocks(String),
    #[error("File error: {0}")]
    File(String),
    #[error("Pulsar error: {0}")]
    Pulsar(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error(transparent)]
    Internal(
        #[from]

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Verify the Elasticsearch/OpenSearch URL, credentials, and TLS settings in the sink options.
  2. Check the wrapped message for HTTP status/bulk item errors; fix mapping conflicts (delete/recreate index or adjust schema).
  3. Ensure the ES cluster is healthy and not blocking writes (disk watermarks, read-only index).
  4. Confirm ES/OpenSearch version compatibility with the connector.
Defensive patterns

Strategy: try-catch

Validate before calling

curl -u user:pass https://es-host:9200/_cluster/health --max-time 5 # pre-check cluster and auth

Try / catch

match err { SinkError::ElasticSearchOpenSearch(e) => { log::error!("es sink: {e:#}"); /* inspect HTTP status / bulk item failures; retry 429s with backoff */ } _ => return Err(err) }

Prevention

When it happens

Trigger: Bulk index requests rejected (4xx/5xx), cluster unreachable, index mapping conflicts with document fields, authentication failures against ES/OpenSearch.

Common situations: Wrong ES URL/credentials, self-signed TLS cert issues, index mapping conflicts after schema change, disk watermark exceeded causing write blocks, OpenSearch/ES version incompatibility.

Understand the failure class

Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/f732ffc7e6e9c23a. Report an issue: GitHub.