{"record":{"id":"7ffc6cdc830a6a26","repo":"apache/seatunnel","slug":"utf-8-encoding-is-not-available","errorCode":null,"errorMessage":"UTF-8 encoding is not available","messagePattern":"UTF-8 encoding is not available","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"info","filePath":"seatunnel-connectors-v2/connector-http/connector-http-posthog/src/main/java/org/apache/seatunnel/connectors/seatunnel/posthog/source/config/PostHogSourceParameter.java","lineNumber":94,"sourceCode":"        setSocketTimeoutMs(pluginConfig.get(HttpSourceOptions.SOCKET_TIMEOUT_MS));\n    }\n\n    private static String normalizeBaseUrl(String baseUrl) {\n        String normalized = requireNonBlank(baseUrl, \"base_url\");\n        while (normalized.endsWith(\"/\")) {\n            normalized = normalized.substring(0, normalized.length() - 1);\n        }\n        if (normalized.isEmpty()) {\n            throw new IllegalArgumentException(\"PostHog option 'base_url' must not be blank\");\n        }\n        return normalized;\n    }\n\n    private static String encodePathSegment(String value) {\n        try {\n            return URLEncoder.encode(value, \"UTF-8\").replace(\"+\", \"%20\");\n        } catch (UnsupportedEncodingException e) {\n            throw new IllegalStateException(\"UTF-8 encoding is not available\", e);\n        }\n    }\n\n    private static void setHeader(Map<String, String> headers, String name, String value) {\n        headers.keySet().removeIf(headerName -> headerName.equalsIgnoreCase(name));\n        headers.put(name, value);\n    }\n\n    private static String requireNonBlank(String value, String optionName) {\n        if (value == null || value.trim().isEmpty()) {\n            throw new IllegalArgumentException(\n                    \"PostHog option '\" + optionName + \"' must not be blank\");\n        }\n        return value.trim();\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-http/connector-http-posthog/src/main/java/org/apache/seatunnel/connectors/seatunnel/posthog/source/config/PostHogSourceParameter.java#L76-L111","documentation":"PostHogSourceParameter.encodePathSegment() URL-encodes path segments using URLEncoder.encode(value, \"UTF-8\"). UTF-8 is required by the JVM spec to exist, but the API declares UnsupportedEncodingException; if it were ever thrown (broken JVM charset setup), the connector rethrows it as IllegalStateException('UTF-8 encoding is not available').","triggerScenarios":"Running on a JVM where the default charset support is broken/nonstandard (e.g. unusual embedded or stripped-down JRE missing UTF-8 charset provider); practically never occurs on standard HotSpot/OpenJDK runtimes.","commonSituations":"Custom/minimal JVM builds, exotic platforms, or manipulated java.nio.charset settings in container images.","solutions":["Run SeaTunnel on a standard JDK/JRE (8+) where UTF-8 is guaranteed.","Verify the JVM's supported charsets (java.nio.charset.Charset.availableCharsets() contains UTF-8).","Rebuild the runtime image with a complete JDK if using a stripped JRE.","If it persists, report an upstream issue since this signals a JVM installation problem, not a config problem."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!java.nio.charset.Charset.availableCharsets().containsKey(\"UTF-8\")) {\n    throw new IllegalStateException(\"JVM does not support UTF-8; use a standard JDK\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    runSeaTunnelJob(config);\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"UTF-8 encoding is not available\")) {\n        log.error(\"Broken JVM charset setup; switch to a standard JDK 8+ runtime\");\n    }\n    throw e;\n}","preventionTips":["Run SeaTunnel on a full standard JDK, not stripped/custom JREs.","Verify charset availability when building custom container images.","Treat this error as an environment problem, not a config problem."],"tags":["seatunnel","posthog","jvm","encoding"],"backgroundTag":"unsupported-platform","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"}