alibaba/DataX · error · Exception
Response Status Code :
Error message
Response Status Code :
What it means
HttpClientUtil.executeAndGet throws this when an HTTP response's status code is not 200. It first prints the request URI, method, and status code to stderr, aborts the request, then raises a generic Exception carrying the non-OK status code. Callers in DataX use it for admin/dataxservice REST calls and similar single-shot GET/POST helpers.
Source
Thrown at core/src/main/java/com/alibaba/datax/core/util/HttpClientUtil.java:125
}
public static HttpDelete getDeleteRequest() {
return new HttpDelete();
}
public String executeAndGet(HttpRequestBase httpRequestBase) throws Exception {
HttpResponse response;
String entiStr = "";
try {
response = httpClient.execute(httpRequestBase);
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
System.err.println("请求地址:" + httpRequestBase.getURI() + ", 请求方法:" + httpRequestBase.getMethod()
+ ",STATUS CODE = " + response.getStatusLine().getStatusCode());
if (httpRequestBase != null) {
httpRequestBase.abort();
}
throw new Exception("Response Status Code : " + response.getStatusLine().getStatusCode());
} else {
HttpEntity entity = response.getEntity();
if (entity != null) {
entiStr = EntityUtils.toString(entity, Consts.UTF_8);
} else {
throw new Exception("Response Entity Is Null");
}
}
} catch (Exception e) {
throw e;
}
return entiStr;
}
public String executeAndGetWithRetry(final HttpRequestBase httpRequestBase, final int retryTimes, final long retryInterval) {
try {
return RetryUtil.asyncExecuteWithRetry(new Callable<String>() {View on GitHub (pinned to 80ec23d5c5)
Solutions
- Read the stderr line above the exception: it contains the exact request URL, method, and status code.
- Map the status: 401/403 fix credentials or headers; 404 fix the URL path; 500 check the remote service logs.
- curl the same URL from the DataX host to confirm network reachability and response body.
- If the endpoint legitimately redirects or returns another success code, switch to a call path that accepts it (executeAndGet hard-codes SC_OK).
Example fix
// before
String body = httpClientUtil.executeAndGet(new HttpGet("http://svc/api/job/42"));
// after: surface status explicitly and handle non-200
HttpResponse resp = httpClient.execute(get);
int code = resp.getStatusLine().getStatusCode();
if (code != 200) throw new IOException("GET " + get.getURI() + " -> " + code); Defensive patterns
Strategy: try-catch
Try / catch
try { String body = httpClientUtil.executeAndGet(req); } catch (Exception e) { if (e.getMessage().startsWith("Response Status Code")) { /* inspect stderr log line for URI+code; branch on 401/404/5xx */ } throw e; } Prevention
- curl the target URL from the DataX host before starting jobs that depend on it.
- Keep service URLs and tokens in config that is validated at deploy time; monitor for 401/403 drift.
When it happens
Trigger: Any executeAndGet call where the server returns 4xx/5xx or a redirect (3xx is also != SC_OK): wrong URL, expired credentials (401), missing resource (404), or server error (500). The preceding stderr line shows exactly which URI and status caused it.
Common situations: DataX service deploy with a misconfigured domain/port, an auth token expired, a proxy in front returning 403, or the target endpoint expecting a different path. Because 3xx fails too, a moved endpoint without redirect-following config also triggers it.
Related errors
- Response Entity Is Null
- load_url cannot be empty, or the host cannot connect.Please
- Failed to flush data to Doris, Error could not get the final
- failed to queue new element to server
- CONFIG_ERROR
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/adb8a101c311d972.
Report an issue: GitHub.