{"record":{"id":"da48590341a98c25","repo":"apache/seatunnel","slug":"option-option-cannot-be-blank-da4859","errorCode":null,"errorMessage":"Option '${option}' cannot be blank","messagePattern":"Option '(.+?)' cannot be blank","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/GooglePubSubSourceConfig.java","lineNumber":85,"sourceCode":"        requirePositive(maxOutstandingBytes, GooglePubSubSourceOptions.MAX_OUTSTANDING_BYTES.key());\n        requirePositive(parallelPullCount, GooglePubSubSourceOptions.PARALLEL_PULL_COUNT.key());\n\n        return GooglePubSubSourceConfig.builder()\n                .projectId(projectId)\n                .subscription(subscription)\n                .credentialsPath(credentialsPath)\n                .emulatorHost(emulatorHost)\n                .format(format)\n                .fieldDelimiter(fieldDelimiter)\n                .maxOutstandingMessages(maxOutstandingMessages)\n                .maxOutstandingBytes(maxOutstandingBytes)\n                .parallelPullCount(parallelPullCount)\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\n    private static void requireNonBlankIfPresent(String value, String option) {\n        if (value != null) {\n            requireNonBlank(value, option);\n        }\n    }\n\n    private static void requirePositive(Number value, String option) {\n        if (value != null && value.longValue() <= 0) {\n            throw new IllegalArgumentException(\"Option '\" + option + \"' must be greater than 0\");\n        }\n    }\n}\n","sourceCodeStart":67,"sourceCodeEnd":101,"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/GooglePubSubSourceConfig.java#L67-L101","documentation":"Thrown by the private helper requireNonBlank in GooglePubSubSourceConfig, called from from() and requireNonBlankIfPresent(). It rejects any mandatory option whose value is null or whitespace-only (e.g. project id, topic, subscription). The exception message names the offending option key so the user can fix it directly.","triggerScenarios":"Building the source config via GooglePubSubSourceConfig.from with a required string option (such as project, topic, or subscription) that is null, \"\", or contains only spaces; also triggered when an optional option like credentials_path or emulator_host is present but blank.","commonSituations":"HOCON config omits the topic value, a YAML/props file has topic = with nothing after the equals sign, or an env-var placeholder like ${PUBSUB_TOPIC} expands to empty because the variable is unset.","solutions":["Set the named option (see the option name in the message) to a non-blank value in the source config.","Check that referenced environment variables (e.g. PUBSUB_PROJECT, PUBSUB_TOPIC) are actually exported in the runtime environment.","Remove the option entirely if it is optional (e.g. credentials_path when using Application Default Credentials) rather than leaving it empty."],"exampleFix":"// before\nGooglePubSubSourceOptions.TOPIC.key() -> \"\"\n// after\nsource {\n  GooglePubSub {\n    topic = \"projects/my-project/topics/my-topic\"\n  }\n}","handlingStrategy":"validation","validationCode":"for (String key : List.of(\"project\", \"topic\", \"subscription\")) {\n    String v = config.get(key);\n    if (v == null || v.trim().isEmpty()) {\n        throw new IllegalArgumentException(\"Option '\" + key + \"' cannot be blank\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify required env vars (PUBSUB_PROJECT, PUBSUB_TOPIC) are set in the deployment environment before job submit.","Avoid bare 'key =' entries in HOCON/YAML configs.","Prefer explicit values over unresolved placeholder interpolation."],"tags":["config-validation","google-pubsub","java"],"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-14T11:17:12.474Z"}