{"record":{"id":"ce2995cc35ce670b","repo":"apache/seatunnel","slug":"failed-to-get-response-from-doris-http-code-is","errorCode":null,"errorMessage":"Failed to get response from Doris {}, http code is {}","messagePattern":"Failed to get response from Doris (.+?), http code is (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/RestService.java","lineNumber":197,"sourceCode":"        URL realUrl = new URL(request);\n        // open connection\n        HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection();\n        String authEncoding =\n                Base64.getEncoder()\n                        .encodeToString(\n                                String.format(\"%s:%s\", user, passwd)\n                                        .getBytes(StandardCharsets.UTF_8));\n        connection.setRequestProperty(\"Authorization\", \"Basic \" + authEncoding);\n\n        connection.connect();\n        return parseResponse(connection, logger);\n    }\n\n    private static String parseResponse(HttpURLConnection connection, Logger logger)\n            throws IOException {\n        int responseCode = connection.getResponseCode();\n        if (responseCode != HttpStatus.SC_OK) {\n            logger.warn(\n                    \"Failed to get response from Doris {}, http code is {}\",\n                    connection.getURL(),\n                    responseCode);\n            throw new IOException(\"Failed to get response from Doris\");\n        }\n\n        StringBuilder result = new StringBuilder();\n        try (BufferedReader in =\n                new BufferedReader(\n                        new InputStreamReader(\n                                connection.getInputStream(), StandardCharsets.UTF_8))) {\n            String line;\n            while ((line = in.readLine()) != null) {\n                result.append(line);\n            }\n        }\n\n        return result.toString();","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/rest/RestService.java#L179-L215","documentation":"parseResponse checks the HTTP status code of a response from a Doris FE REST call. If it is not 200 OK, it logs this warning with the URL and code and throws an IOException('Failed to get response from Doris'), which propagates to callers like getConnectionPost/getConnectionGet and aborts partition/schema discovery.","triggerScenarios":"getConnectionPost or getConnectionGet receives a non-200 response (401 wrong credentials, 403 no privileges, 404 wrong db/table, 500 FE internal error) from endpoints like _query_plan or _schema.","commonSituations":"Incorrect username/password in Doris config; user lacking SELECT privilege on the database; typo in database or table name used by the source; FE returning 500 during heavy load or while a table is being schema-changed; FE version endpoint incompatibility.","solutions":["Read the logged http code: 401/403 -> fix credentials/privileges; 404 -> fix database/table name; 5xx -> inspect fe.log","Verify username/password options and that the user has SELECT on the target database","Confirm the database/table names match Doris exactly (case-sensitive)","Retry if the FE was temporarily overloaded, or scale/restart the FE","Test the same REST endpoint manually with curl using the same credentials"],"exampleFix":"// before\nDorisSourceOptions.USERNAME.defaultValue() // anonymous default user without privileges\n// after\n\"username\" = \"doris_reader\",\n\"password\" = \"***\"  // user granted SELECT ON db.*","handlingStrategy":"try-catch","validationCode":"// precheck with curl using the job's credentials:\n// curl -u user:pass http://fe:8030/api/<db>/<table>/_schema -w '%{http_code}'","typeGuard":null,"tryCatchPattern":"try {\n    String schema = RestService.getConnectionGet(...);\n} catch (IOException e) {\n    // log includes http code: 401/403 -> credentials; 404 -> db/table name; 5xx -> fe.log\n}","preventionTips":["Grant the configured user SELECT privilege on the target database","Validate database/table names are exact and case-correct","Test FE REST endpoints manually before production runs"],"tags":["doris","http","rest","fe","authentication"],"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"}