{"record":{"id":"9877b4a7d51c9713","repo":"apache/seatunnel","slug":"posthog-option-base-url-must-not-be-blank","errorCode":null,"errorMessage":"PostHog option 'base_url' must not be blank","messagePattern":"PostHog option 'base_url' must not be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-http/connector-http-posthog/src/main/java/org/apache/seatunnel/connectors/seatunnel/posthog/source/config/PostHogSourceParameter.java","lineNumber":85,"sourceCode":"        body.put(\"query\", queryRequest);\n        body.put(\"refresh\", \"blocking\");\n        setBody(JsonUtils.toJsonString(body));\n\n        setRetry(pluginConfig.getOptional(HttpCommonOptions.RETRY).orElse(0));\n        setRetryBackoffMultiplierMillis(\n                pluginConfig.get(HttpCommonOptions.RETRY_BACKOFF_MULTIPLIER_MS));\n        setRetryBackoffMaxMillis(pluginConfig.get(HttpCommonOptions.RETRY_BACKOFF_MAX_MS));\n        setConnectTimeoutMs(pluginConfig.get(HttpSourceOptions.CONNECT_TIMEOUT_MS));\n        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) {","sourceCodeStart":67,"sourceCodeEnd":103,"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#L67-L103","documentation":"PostHogSourceParameter.normalizeBaseUrl() first requires base_url to be non-blank via requireNonBlank, then strips trailing slashes. If stripping slashes leaves an empty string (input was only slashes, e.g. '///'), it throws IllegalArgumentException with this message, since an API host is mandatory to build the request URL.","triggerScenarios":"Configuring base_url as null, empty, whitespace-only, or composed entirely of '/' characters in the PostHog source config; the check runs when the parameter object is built via buildWithConfig -> baseUrl().","commonSituations":"Placeholder config value never replaced ('' or '${BASE_URL}' resolved to empty), env-var interpolation yielding blank, or a config typo like base_url = \"/\".","solutions":["Set base_url to a full PostHog API host, e.g. 'https://us.posthog.com' or 'https://eu.posthog.com'.","Check the env variable or placeholder feeding base_url is actually populated at runtime.","Ensure no trailing-slash-only value is passed; the connector only trims trailing slashes, it cannot infer a host."],"exampleFix":"// before\nbase_url = \"${POSTHOG_URL}\"  // env var unset -> blank\n\n// after\nbase_url = \"https://us.posthog.com\"","handlingStrategy":"validation","validationCode":"String baseUrl = config.getString(\"base_url\");\nif (baseUrl == null || baseUrl.trim().replaceAll(\"/+\", \"\").isEmpty()) {\n    throw new IllegalArgumentException(\"base_url must be a full PostHog API host, e.g. https://us.posthog.com\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set base_url to a complete host including scheme (https://...).","Check env-var interpolation resolves before job submission.","Never use '/' or empty placeholders as base_url values."],"tags":["seatunnel","posthog","config","validation"],"backgroundTag":"empty-required-field","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"}