apache/seatunnel · warning
Request failed with code:{}, err:{}
Error message
Request failed with code:{}, err:{} What it means
HttpHelper.doHttpPut logs this warning when an HTTP PUT to StarRocks (stream-load / transaction label APIs) returns a non-success status code. It reads the response entity as error text (falling back to a synthetic message if reading fails) and returns a Map with Status=Fail and Message=errorText so callers can decide on retry/abort semantics.
Source
Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/HttpHelper.java:191
}
}
httpPut.setEntity(new ByteArrayEntity(data));
httpPut.setConfig(
RequestConfig.custom()
.setSocketTimeout(sinkConfig.getHttpSocketTimeout())
.setRedirectsEnabled(true)
.build());
try (CloseableHttpResponse resp = httpclient.execute(httpPut)) {
int code = resp.getStatusLine().getStatusCode();
if (HttpStatus.SC_OK != code) {
String errorText;
try {
HttpEntity respEntity = resp.getEntity();
errorText = EntityUtils.toString(respEntity);
} catch (Exception err) {
errorText = "find errorText failed: " + err.getMessage();
}
log.warn("Request failed with code:{}, err:{}", code, errorText);
Map<String, Object> errorMap = new HashMap<>();
errorMap.put("Status", "Fail");
errorMap.put("Message", errorText);
return errorMap;
}
HttpEntity respEntity = resp.getEntity();
if (null == respEntity) {
log.warn("Request failed with empty response.");
return null;
}
return JsonUtils.parseObject(EntityUtils.toString(respEntity), Map.class);
}
}
}
private CloseableHttpClient buildHttpClient() {
final HttpClientBuilder httpClientBuilder =
HttpClients.custom()View on GitHub (pinned to cf67b549a7)
Solutions
- Inspect the logged err text (response body) — StarRocks returns a JSON error describing label state or rejection reason.
- Check StarRocks FE/BE health and the configured load-url endpoints; retry against a healthy FE node.
- For label-related failures (e.g. 'Label already exists' or publish timeout), rely on the transaction label retry/abort logic the sink already implements.
- Verify auth credentials (basic auth user/password) and cluster capacity; reduce batch/load frequency if being throttled.
Example fix
// before
Map<String,Object> resp = httpHelper.doHttpPut(url, body);
// after
Map<String,Object> resp = httpHelper.doHttpPut(url, body);
if ("Fail".equals(resp.get("Status"))) {
log.error("StarRocks request to {} failed: {}", url, resp.get("Message"));
// retry or abort transaction per label state
} Defensive patterns
Strategy: retry
Validate before calling
// check FE health before load curl -u user:pass http://fe-host:8030/api/show_proc?path=/current_cluster
Try / catch
Map<String,Object> resp = doHttpPut(url, body);
if ("Fail".equals(resp.get("Status"))) { /* inspect Message, retry or abort label */ } Prevention
- Monitor FE/BE health and use multiple load-url entries
- Verify basic-auth credentials for stream load
- Handle label-conflict responses with the connector's retry/abort semantics
When it happens
Trigger: doHttpPut receives an HTTP response whose status code is not the success code: server returns 4xx/5xx for stream load publish, label transaction put, or commit calls; also when the connection target returns proxy/gateway errors.
Common situations: StarRocks FE node overloaded or restarting (502/503); label conflicts or publish timeouts returning error JSON; wrong FE/BE address or port in the sink config; authentication failure on stream load.
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 apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/9509733a1dbe5766.
Report an issue: GitHub.