{"record":{"id":"ddd0fd6c98fbc484","repo":"apache/seatunnel","slug":"rest-service-failed","errorCode":"REST_SERVICE_FAILED","errorMessage":"Connect to {uri}failed, status code is {statusCode}.","messagePattern":"Connect to (.+?)failed, status code is (.+?)\\.","errorType":"error_code","errorClass":"DorisConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/RestService.java","lineNumber":149,"sourceCode":"                Map map = OBJECT_MAPPER.readValue(response, Map.class);\n                if (map.containsKey(\"code\") && map.containsKey(\"msg\")) {\n                    Object data = map.get(\"data\");\n                    return OBJECT_MAPPER.writeValueAsString(data);\n                } else {\n                    return response;\n                }\n            } catch (IOException e) {\n                ex = e;\n                logger.warn(ErrorMessages.CONNECT_FAILED_MESSAGE, request.getURI(), e);\n            }\n        }\n        String errMsg =\n                \"Connect to \"\n                        + request.getURI().toString()\n                        + \"failed, status code is \"\n                        + statusCode\n                        + \".\";\n        throw new DorisConnectorException(DorisConnectorErrorCode.REST_SERVICE_FAILED, errMsg, ex);\n    }\n\n    private static String getConnectionPost(\n            HttpRequestBase request, String user, String passwd, Logger logger) throws IOException {\n        URL url = new URL(request.getURI().toString());\n        HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n        conn.setInstanceFollowRedirects(false);\n        conn.setRequestMethod(request.getMethod());\n        String authEncoding =\n                Base64.getEncoder()\n                        .encodeToString(\n                                String.format(\"%s:%s\", user, passwd)\n                                        .getBytes(StandardCharsets.UTF_8));\n        conn.setRequestProperty(\"Authorization\", \"Basic \" + authEncoding);\n        InputStream content = ((HttpPost) request).getEntity().getContent();\n        String res = IOUtils.toString(content, StandardCharsets.UTF_8);\n        conn.setDoOutput(true);\n        conn.setDoInput(true);","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/RestService.java#L131-L167","documentation":"RestService.send throws DorisConnectorException with REST_SERVICE_FAILED when an HTTP request to the Doris FE REST endpoint (e.g. /api/{db}/{table}/_query_info used by findPartitions) returns a non-success status code. The message includes the URI and status, with the underlying exception as cause.","triggerScenarios":"Calling findPartitions (REST-based partition discovery) when the FE host/port is wrong, FE is down, a redirect to a dead node occurs, authentication fails (401/403), or the endpoint returns 404/5xx.","commonSituations":"Wrong http_port/REST port in config; Doris FE restarted or unreachable from the SeaTunnel worker; firewall or k8s service blocking the REST port; wrong user credentials for the REST API; BE redirect target unavailable.","solutions":["Open the URI from the message in a browser/curl to confirm the FE REST endpoint is reachable and the status code matches","Fix the FE host and http (REST) port in the Doris sink/source config","Check Doris FE process health and logs for the corresponding request error","Verify the configured user/password has API access; check network/firewall between SeaTunnel and FE, then retry"],"exampleFix":"// before\nurl = \"doris-fe-host:9020\"   // query port, not REST\n// after\nurl = \"doris-fe-host:8030\"   // FE http_port used by RestService","handlingStrategy":"retry","validationCode":"// preflight the REST endpoint before the job\nint code = new URL(\"http://\" + feHost + \":\" + feHttpPort + \"/api/_check_connectivity\").openConnection()\n        .connect() instanceof HttpURLConnection ? ((HttpURLConnection) c).getResponseCode() : -1;\nif (code != 200) throw new IllegalStateException(\"FE REST endpoint unreachable, status \" + code);","typeGuard":null,"tryCatchPattern":"try {\n    List<PartitionDefinition> parts = RestService.findPartitions(...);\n} catch (DorisConnectorException e) {\n    if (e.getErrorCode() == DorisConnectorErrorCode.REST_SERVICE_FAILED) {\n        LOG.error(\"FE REST call failed ({}); check FE host/http_port, credentials, and network, then retry\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Use the FE http_port (default 8030), not the query port 9030/9020, for REST config","Health-check the FE REST endpoint before job submission","Verify user/password work against the REST API, not only MySQL protocol","Allow FE/BE REST ports through firewalls and retry transient 5xx/redirect failures"],"tags":["network","http","doris","rest"],"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-14T05:17:10.506Z"}