{"record":{"id":"d97dcbe37a023f45","repo":"apache/seatunnel","slug":"firebase-http-request-failed-with-status-code-d","errorCode":null,"errorMessage":"Firebase HTTP request failed with status code %d. Response body: %s","messagePattern":"Firebase HTTP request failed with status code (.+?)\\. Response body: (.+?)","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-firebase/src/main/java/org/apache/seatunnel/connectors/seatunnel/firebase/client/FirebaseHttpClient.java","lineNumber":213,"sourceCode":"            }\n\n            int responseCode = connection.getResponseCode();\n            if (responseCode >= 200 && responseCode < 300) {\n                try (InputStream inputStream = connection.getInputStream();\n                        BufferedReader reader =\n                                new BufferedReader(\n                                        new InputStreamReader(\n                                                inputStream, StandardCharsets.UTF_8))) {\n                    StringBuilder responseBuilder = new StringBuilder();\n                    String line;\n                    while ((line = reader.readLine()) != null) {\n                        responseBuilder.append(line);\n                    }\n                    return responseBuilder.toString();\n                }\n            } else {\n                String rawErrorBody = readErrorStream(connection);\n                throw new SeaTunnelException(\n                        String.format(\n                                \"Firebase HTTP request failed with status code %d. Response body: %s\",\n                                responseCode, rawErrorBody.isEmpty() ? \"N/A\" : rawErrorBody));\n            }\n        } catch (IOException e) {\n            throw new SeaTunnelException(\"Failed to execute HTTP request to Firebase endpoint\", e);\n        } finally {\n            if (connection != null) {\n                connection.disconnect();\n            }\n        }\n    }\n\n    private String encodeUriComponent(String value) {\n        try {\n            return URLEncoder.encode(value, StandardCharsets.UTF_8.name())\n                    .replaceAll(\"\\\\+\", \"%20\"); // Handle space encoding for URIs\n        } catch (UnsupportedEncodingException e) {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-firebase/src/main/java/org/apache/seatunnel/connectors/seatunnel/firebase/client/FirebaseHttpClient.java#L195-L231","documentation":"executeGet throws this SeaTunnelException when the Firebase REST endpoint returns a non-success HTTP status code. The message includes the status code and the error response body (or 'N/A' if empty). It wraps HTTP-level failures such as 401/403 (auth), 404 (bad path), and 5xx (server errors).","triggerScenarios":"Firebase returns 401/403 due to missing or expired auth token; 404 because the path/node does not exist; 429 rate limiting; 5xx from Firebase or an intermediary proxy.","commonSituations":"Service account without Realtime Database permissions; wrong database URL region; deleted node; exceeding Firebase quota; corporate proxy rejecting the request.","solutions":["Read the status code and body in the message: fix auth for 401/403, path for 404, back off for 429, retry for 5xx.","Verify service account credentials have read access to the Realtime Database.","Confirm the URL/path points to an existing node in the correct database instance.","Add retry logic with backoff for transient 5xx/429 responses."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// preflight: verify access\nHttpURLConnection c = (HttpURLConnection) URI.create(url + \".json\").toURL().openConnection();\nint code = c.getResponseCode();\nif (code == 401 || code == 403) throw new IllegalStateException(\"check Firebase auth/permissions\");","typeGuard":null,"tryCatchPattern":"catch (SeaTunnelException e) { if (e.getMessage().contains(\"status code 5\") || e.getMessage().contains(\"status code 429\")) { backoffAndRetry(); } else { throw e; } }","preventionTips":["Verify service account has Realtime Database read permissions","Confirm the database URL and node path exist","Implement backoff for 429/5xx","Check quota usage if errors appear under load"],"tags":["firebase","http","api-error","network"],"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"}