{"record":{"id":"d33feb0edde34e83","repo":"apache/seatunnel","slug":"request-failed-d33feb","errorCode":"REQUEST_FAILED","errorMessage":"Stripe PaymentIntents response is not valid JSON","messagePattern":"Stripe PaymentIntents response is not valid JSON","errorType":"error_code","errorClass":"HttpConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-stripe/src/main/java/org/apache/seatunnel/connectors/seatunnel/stripe/source/StripeSourceReader.java","lineNumber":107,"sourceCode":"            for (String paymentIntent : page.paymentIntents) {\n                output.collect(new SeaTunnelRow(new Object[] {paymentIntent}));\n            }\n            cursor = page.nextCursor;\n        } while (cursor != null);\n        context.signalNoMoreElement();\n    }\n\n    private StripePage fetchPage(Set<String> seenCursors) throws Exception {\n        HttpResponse response = executeWithRateLimitRetry();\n        if (response.getCode() < 200 || response.getCode() > 299) {\n            throw requestFailed(response);\n        }\n\n        JsonNode root;\n        try {\n            root = JsonUtils.stringToJsonNode(response.getContent());\n        } catch (RuntimeException e) {\n            throw new HttpConnectorException(\n                    HttpConnectorErrorCode.REQUEST_FAILED,\n                    \"Stripe PaymentIntents response is not valid JSON\",\n                    e);\n        }\n        JsonNode dataNode = root.get(\"data\");\n        JsonNode hasMoreNode = root.get(\"has_more\");\n        if (!(dataNode instanceof ArrayNode) || hasMoreNode == null || !hasMoreNode.isBoolean()) {\n            throw new HttpConnectorException(\n                    HttpConnectorErrorCode.REQUEST_FAILED,\n                    \"Stripe PaymentIntents response must contain array 'data' and boolean 'has_more'\");\n        }\n\n        ArrayNode data = (ArrayNode) dataNode;\n        List<String> paymentIntents = new ArrayList<>(data.size());\n        String lastId = null;\n        for (JsonNode paymentIntent : data) {\n            JsonNode idNode = paymentIntent.get(\"id\");\n            if (!paymentIntent.isObject()","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-stripe/src/main/java/org/apache/seatunnel/connectors/seatunnel/stripe/source/StripeSourceReader.java#L89-L125","documentation":"fetchPage parses the Stripe PaymentIntents HTTP response body with JsonUtils.stringToJsonNode and wraps any parse failure in HttpConnectorException(REQUEST_FAILED). This means the API returned something that is not valid JSON — typically an HTML error page, a proxy/gateway error, or an empty body.","triggerScenarios":"The HTTP response content cannot be parsed as JSON: HTML error pages from misconfigured api_base_url, gateway 502/503 pages, proxies injecting content, or empty responses.","commonSituations":"api_base_url pointing to a non-Stripe host or a captive corporate proxy; TLS-intercepting firewalls returning HTML; Stripe outage page; local mock server returning malformed JSON.","solutions":["Verify api_base_url points at the correct Stripe API host (https://api.stripe.com or valid test mock)","Check for corporate proxies/TLS interception returning HTML error pages and add the proxy's CA or bypass the proxy","Log/inspect the raw response body to confirm what was returned","Retry the job — transient gateway errors (502/503) can produce non-JSON bodies"],"exampleFix":"// before\napi_base_url = \"https://api.stipe.com\"  # typo -> HTML/404 page\n// after\napi_base_url = \"https://api.stripe.com\"","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* fetch */ } catch (HttpConnectorException e) {\n  if (e.getHttpConnectorErrorCode() == HttpConnectorErrorCode.REQUEST_FAILED && e.getMessage().contains(\"not valid JSON\")) {\n    log.error(\"Non-JSON body from api_base_url — check URL/proxy/TLS interception\");\n  }\n}","preventionTips":["Pin api_base_url to the official Stripe host","Bypass or correctly configure TLS-intercepting proxies","Add a health check that curls the base URL and asserts JSON content-type"],"tags":["json","stripe","http-response"],"backgroundTag":"invalid-json-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"}