{"record":{"id":"9509733a1dbe5766","repo":"apache/seatunnel","slug":"request-failed-with-code-err","errorCode":null,"errorMessage":"Request failed with code:{}, err:{}","messagePattern":"Request failed with code:(.+?), err:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/HttpHelper.java","lineNumber":191,"sourceCode":"                }\n            }\n            httpPut.setEntity(new ByteArrayEntity(data));\n            httpPut.setConfig(\n                    RequestConfig.custom()\n                            .setSocketTimeout(sinkConfig.getHttpSocketTimeout())\n                            .setRedirectsEnabled(true)\n                            .build());\n            try (CloseableHttpResponse resp = httpclient.execute(httpPut)) {\n                int code = resp.getStatusLine().getStatusCode();\n                if (HttpStatus.SC_OK != code) {\n                    String errorText;\n                    try {\n                        HttpEntity respEntity = resp.getEntity();\n                        errorText = EntityUtils.toString(respEntity);\n                    } catch (Exception err) {\n                        errorText = \"find errorText failed: \" + err.getMessage();\n                    }\n                    log.warn(\"Request failed with code:{}, err:{}\", code, errorText);\n                    Map<String, Object> errorMap = new HashMap<>();\n                    errorMap.put(\"Status\", \"Fail\");\n                    errorMap.put(\"Message\", errorText);\n                    return errorMap;\n                }\n                HttpEntity respEntity = resp.getEntity();\n                if (null == respEntity) {\n                    log.warn(\"Request failed with empty response.\");\n                    return null;\n                }\n                return JsonUtils.parseObject(EntityUtils.toString(respEntity), Map.class);\n            }\n        }\n    }\n\n    private CloseableHttpClient buildHttpClient() {\n        final HttpClientBuilder httpClientBuilder =\n                HttpClients.custom()","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/HttpHelper.java#L173-L209","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nMap<String,Object> resp = httpHelper.doHttpPut(url, body);\n// after\nMap<String,Object> resp = httpHelper.doHttpPut(url, body);\nif (\"Fail\".equals(resp.get(\"Status\"))) {\n    log.error(\"StarRocks request to {} failed: {}\", url, resp.get(\"Message\"));\n    // retry or abort transaction per label state\n}","handlingStrategy":"retry","validationCode":"// check FE health before load\ncurl -u user:pass http://fe-host:8030/api/show_proc?path=/current_cluster","typeGuard":null,"tryCatchPattern":"Map<String,Object> resp = doHttpPut(url, body);\nif (\"Fail\".equals(resp.get(\"Status\"))) { /* inspect Message, retry or abort label */ }","preventionTips":["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"],"tags":["http","starrocks","put","stream-load"],"backgroundTag":"http-error-response","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}