{"record":{"id":"cdbedb6eb5051382","repo":"apache/seatunnel","slug":"posthog-option-optionname-must-not-be-blank","errorCode":null,"errorMessage":"PostHog option '${optionName}' must not be blank","messagePattern":"PostHog option '(.+?)' 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":105,"sourceCode":"        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":87,"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#L87-L111","documentation":"PostHogSourceParameter.requireNonBlank() is the shared validation guard for mandatory string options. It throws IllegalArgumentException with the option name embedded in the message when a value is null or whitespace-only. It is called from projectId(), apiKey(), query(), and normalizeBaseUrl(), so this message names whichever PostHog option is missing.","triggerScenarios":"Building PostHogSourceParameter.buildWithConfig with any of project_id, api_key, query, or base_url absent, empty (''), or whitespace-only in the source config.","commonSituations":"Forgetting to fill required fields in the HOCON config, placeholder values replaced by empty strings, env-var interpolation failing so options resolve to blank, copy-pasting a template without editing values.","solutions":["Fill in the option named in the message ('project_id', 'api_key', 'query', or 'base_url') with a real non-blank value.","For api_key, generate a PostHog personal API key with read access to the target project.","For project_id, use the numeric project ID from PostHog project settings, not the project name.","Check env-var/placeholder resolution so interpolated values are not empty at runtime."],"exampleFix":"// before\nPostHog {\n  project_id = \"\"\n  api_key = \"${POSTHOG_KEY}\"\n  query = \"SELECT * FROM events\"\n}\n\n// after\nPostHog {\n  project_id = \"12345\"\n  api_key = \"phx_xxxxxxxxxxxx\"\n  query = \"SELECT * FROM events\"\n}","handlingStrategy":"validation","validationCode":"for (String key : new String[]{\"project_id\", \"api_key\", \"query\", \"base_url\"}) {\n    String v = config.getString(key);\n    if (v == null || v.trim().isEmpty()) {\n        throw new IllegalArgumentException(\"PostHog option '\" + key + \"' must not be blank\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    buildParameter(config);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"PostHog option\")) {\n        log.error(\"Missing PostHog config: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["List and check all required PostHog options (project_id, api_key, query, base_url) in CI before deployment.","Avoid empty-string placeholders in HOCON templates; fail fast on unset env vars.","Validate interpolated config values after env substitution."],"tags":["seatunnel","posthog","config","validation"],"backgroundTag":"missing-required-config-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"}