risingwavelabs/risingwave · error · SinkError

Can't find data

Error message

Can't find data

What it means

get_schema_from_doris parses the FE schema JSON response; when the response carries `code` and `msg` fields (an error-style envelope), it expects a `data` field containing the schema. If `data` is missing, this error is raised, meaning Doris returned an error response without the expected payload.

Source

Thrown at src/connector/src/sink/doris.rs:518

            .header(
                "Authorization",
                format!(
                    "Basic {}",
                    general_purpose::STANDARD.encode(format!("{}:{}", self.user, self.password))
                ),
            )
            .send()
            .await
            .map_err(|err| SinkError::DorisStarrocksConnect(err.into()))?;

        let json: Value = response
            .json()
            .await
            .map_err(|err| SinkError::DorisStarrocksConnect(err.into()))?;
        let json_data = if json.get("code").is_some() && json.get("msg").is_some() {
            json.get("data")
                .ok_or_else(|| {
                    SinkError::DorisStarrocksConnect(anyhow::anyhow!("Can't find data"))
                })?
                .clone()
        } else {
            json
        };
        let schema: DorisSchema = serde_json::from_value(json_data)
            .context("Can't get schema from json")
            .map_err(SinkError::DorisStarrocksConnect)?;
        Ok(schema)
    }
}
#[derive(Debug, Serialize, Deserialize)]
pub struct DorisSchema {
    status: i32,
    #[serde(rename = "keysType")]
    pub keys_type: String,
    pub properties: Vec<DorisField>,
}

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Verify the `database` and `table` options exist in Doris and are spelled correctly.
  2. Check Doris FE logs for the underlying error (code/msg in the response body).
  3. Confirm the sink user has SELECT privilege on the target table.
  4. Capture the full HTTP response (curl the FE endpoint) to inspect the envelope shape.
Defensive patterns

Strategy: validation

Validate before calling

// verify target exists before creating the sink
// curl -u user:pass http://fe-host:8030/api/show_meta_info?db=mydb&table=mytable

Type guard

fn has_data_field(v: &serde_json::Value) -> bool {
    v.get("code").is_some() && v.get("msg").is_some() && v.get("data").is_some()
}

Try / catch

match client.get_schema_from_doris().await {
    Err(SinkError::DorisStarrocksConnect(e)) if e.to_string().contains("Can't find data") => {
        eprintln!("check db/table names and Doris permissions: {e}");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Calling get_schema_from_doris against a Doris FE that returns a JSON envelope with code/msg but no `data` key, e.g. because the database/table does not exist or the FE rejects the request.

Common situations: Wrong `database` or `table` names in the sink config; insufficient Doris user permissions; Doris FE version returning a differently shaped error body; network proxy stripping the data field.

Related errors


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