{"record":{"id":"7881a8cb1ea1c904","repo":"apache/seatunnel","slug":"amazondocumentdb-option-must-not-be-blank","errorCode":null,"errorMessage":"AmazonDocumentDB option '' must not be blank","messagePattern":"AmazonDocumentDB option '' must not be blank","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-amazondocumentdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazondocumentdb/config/AmazonDocumentDBConfig.java","lineNumber":178,"sourceCode":"            String value = decodeUriParameter(parameter.substring(separator + 1));\n            if (\"retryWrites\".equalsIgnoreCase(key) && \"true\".equalsIgnoreCase(value)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    private static String decodeUriParameter(String value) {\n        try {\n            return URLDecoder.decode(value, StandardCharsets.UTF_8.name());\n        } catch (UnsupportedEncodingException e) {\n            throw new IllegalStateException(\"UTF-8 must be supported\", e);\n        }\n    }\n\n    private static String requireNonBlank(String value, String optionName) {\n        if (value == null || value.trim().isEmpty()) {\n            throw new IllegalArgumentException(\n                    \"AmazonDocumentDB option '\" + optionName + \"' must not be blank\");\n        }\n        return value.trim();\n    }\n\n    private static void validateTlsCaFile(String tlsCaFile) {\n        if (tlsCaFile == null) {\n            throw new IllegalArgumentException(\n                    \"AmazonDocumentDB option 'tls_ca_file' is required when TLS is enabled\");\n        }\n        Path path = Paths.get(tlsCaFile);\n        if (!Files.isRegularFile(path) || !Files.isReadable(path)) {\n            throw new IllegalArgumentException(\n                    \"AmazonDocumentDB TLS CA bundle is not a readable file: \" + tlsCaFile);\n        }\n    }\n\n    private static void validateBsonDocument(String value, String optionName) {","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-amazondocumentdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/amazondocumentdb/config/AmazonDocumentDBConfig.java#L160-L196","documentation":"AmazonDocumentDBConfig.requireNonBlank validates that a user-supplied connector option (uri, database, collection, etc.) is neither null nor whitespace-only. It throws IllegalArgumentException during config parsing when a required option resolves to blank. This fails fast at job startup rather than producing an obscure connection error later.","triggerScenarios":"Calling AmazonDocumentDBConfig with a required option (e.g. uri, database, collection) whose value is null, \"\", or only whitespace (\" \").","commonSituations":"HOCON/YAML config has an empty value like `database = \"\"`; an env-var placeholder like ${DB_NAME} resolved to empty; a typo in the option name so the default blank value is used.","solutions":["Set the option to a non-blank value in the SeaTunnel config file (e.g. database = \"mydb\").","Check the exact option key spelling against AmazonDocumentDB documented options.","If using env substitution, verify the environment variable is exported and non-empty."],"exampleFix":"// before\ndatabase = \"\"\n// after\ndatabase = \"orders\"","handlingStrategy":"validation","validationCode":"String uri = cfg.getOptionalString(URI).orElse(\"\");\nif (uri.trim().isEmpty()) {\n    throw new IllegalArgumentException(\"uri must not be blank before building AmazonDocumentDBConfig\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never leave required options with empty string defaults in config templates.","Assert env-var substitutions resolved (no raw ${VAR} or empty results) before submitting the job.","Lint connector configs in CI to catch blank required fields."],"tags":["configuration","validation","amazondocumentdb"],"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"}