{"record":{"id":"95cdbc07969dfaed","repo":"apache/seatunnel","slug":"option-field-delimiter-cannot-be-empty-95cdbc","errorCode":null,"errorMessage":"Option 'field_delimiter' cannot be empty","messagePattern":"Option 'field_delimiter' cannot be empty","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/config/GooglePubSubSinkConfig.java","lineNumber":55,"sourceCode":"\n    public static GooglePubSubSinkConfig from(ReadonlyConfig config) {\n        String projectId = config.get(GooglePubSubSinkOptions.PROJECT_ID);\n        String topic = config.get(GooglePubSubSinkOptions.TOPIC);\n        String credentialsPath = config.get(GooglePubSubSinkOptions.CREDENTIALS_PATH);\n        String emulatorHost = config.get(GooglePubSubSinkOptions.EMULATOR_HOST);\n        MessageFormat format = config.get(GooglePubSubSinkOptions.FORMAT);\n        String fieldDelimiter = config.get(GooglePubSubSinkOptions.FIELD_DELIMITER);\n\n        requireNonBlank(projectId, GooglePubSubSinkOptions.PROJECT_ID.key());\n        requireNonBlank(topic, GooglePubSubSinkOptions.TOPIC.key());\n        requireNonBlankIfPresent(credentialsPath, GooglePubSubSinkOptions.CREDENTIALS_PATH.key());\n        requireNonBlankIfPresent(emulatorHost, GooglePubSubSinkOptions.EMULATOR_HOST.key());\n        if (credentialsPath != null && emulatorHost != null) {\n            throw new IllegalArgumentException(\n                    \"Options 'credentials_path' and 'emulator_host' cannot be configured together\");\n        }\n        if (format == MessageFormat.TEXT && fieldDelimiter.isEmpty()) {\n            throw new IllegalArgumentException(\"Option 'field_delimiter' cannot be empty\");\n        }\n\n        return GooglePubSubSinkConfig.builder()\n                .projectId(projectId)\n                .topic(topic)\n                .credentialsPath(credentialsPath)\n                .emulatorHost(emulatorHost)\n                .format(format)\n                .fieldDelimiter(fieldDelimiter)\n                .build();\n    }\n\n    private static void requireNonBlank(String value, String option) {\n        if (value == null || value.trim().isEmpty()) {\n            throw new IllegalArgumentException(\"Option '\" + option + \"' cannot be blank\");\n        }\n    }\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-google-pubsub/src/main/java/org/apache/seatunnel/connectors/seatunnel/google/pubsub/config/GooglePubSubSinkConfig.java#L37-L73","documentation":"GooglePubSubSinkConfig.from() requires field_delimiter to be non-empty when message format is TEXT, because TEXT messages are split into attributes using this delimiter; an empty delimiter would make parsing impossible. The check throws IllegalArgumentException during sink configuration.","triggerScenarios":"Configuring format = TEXT (or leaving the default that resolves to TEXT) with field_delimiter = \"\" — e.g. field_delimiter = \"${empty}\" or an unset variable resolving to empty string.","commonSituations":"Hocon variable interpolation resolving to empty; copy-pasting a config that blanked the delimiter; thinking the delimiter is optional for TEXT format.","solutions":["Set a non-empty field_delimiter (e.g. \",\") in the sink config.","Or switch format to JSON, which does not require a delimiter.","Check that any variable used for field_delimiter resolves to a non-empty value."],"exampleFix":"// before\nformat = TEXT\nfield_delimiter = \"\"\n// after\nformat = TEXT\nfield_delimiter = \",\"","handlingStrategy":"validation","validationCode":"// before building the sink config\nif (format == MessageFormat.TEXT && (fieldDelimiter == null || fieldDelimiter.isEmpty())) {\n  throw new IllegalArgumentException(\"TEXT format requires a non-empty field_delimiter\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  GooglePubSubSinkConfig.from(config);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().contains(\"field_delimiter\")) {\n    log.error(\"Set field_delimiter (e.g. ',') or switch format to JSON\");\n  } else throw e;\n}","preventionTips":["Always pair format = TEXT with an explicit field_delimiter.","Prefer JSON format when you do not need delimited TEXT messages.","Verify interpolated variables for field_delimiter resolve to non-empty values."],"tags":["pubsub","sink","config","validation"],"backgroundTag":"invalid-config-value","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"}