{"record":{"id":"862cc56dbf0cc230","repo":"apache/beam","slug":"dead-letter-queue-topic-name-is-not-specified","errorCode":null,"errorMessage":"Dead letter queue topic name is not specified","messagePattern":"Dead letter queue topic name is not specified","errorType":"validation","errorClass":"InvalidConfigurationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubSchemaIOProvider.java","lineNumber":172,"sourceCode":"  }\n\n  private void validateDataSchema(@Nullable Schema schema) {\n    if (schema == null) {\n      throw new InvalidSchemaException(\n          \"Unsupported schema specified for Pubsub source in CREATE TABLE.\"\n              + \"CREATE TABLE for Pubsub topic must not be null\");\n    }\n    if (!PubsubSchemaIO.fieldPresent(schema, TIMESTAMP_FIELD, FieldType.DATETIME)) {\n      throw new InvalidSchemaException(\n          \"Unsupported schema specified for Pubsub source in CREATE TABLE.\"\n              + \"CREATE TABLE for Pubsub topic must include at least 'event_timestamp' field of \"\n              + \"type 'TIMESTAMP'\");\n    }\n  }\n\n  private void validateDlq(@Nullable String deadLetterQueue) {\n    if (deadLetterQueue != null && deadLetterQueue.isEmpty()) {\n      throw new InvalidConfigurationException(\"Dead letter queue topic name is not specified\");\n    }\n  }\n\n  private void validateConfigurationSchema(Row configuration) {\n    if (!configuration.getSchema().equals(configurationSchema())) {\n      throw new InvalidConfigurationException(\n          \"Configuration schema provided does not match expected\");\n    }\n  }\n\n  /** An abstraction to create schema aware IOs. */\n  private static class PubsubSchemaIO implements SchemaIO, Serializable {\n    protected final Schema dataSchema;\n    protected final String location;\n    protected final boolean useFlatSchema;\n    protected final Config config;\n\n    private PubsubSchemaIO(String location, Row config, Schema dataSchema) {","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/PubsubSchemaIOProvider.java#L154-L190","documentation":"PubsubSchemaIOProvider.validateDlq() accepts a deadLetterQueue topic name that may be null (feature disabled) but rejects the empty string. An empty DLQ topic name is not a valid Pubsub topic, so an InvalidConfigurationException is thrown.","triggerScenarios":"Providing the 'deadLetterQueue' table property as an empty string (e.g. deadLetterQueue='' in WITH OPTIONS, or an unset template variable rendering as \"\"), so deadLetterQueue != null && deadLetterQueue.isEmpty() is true.","commonSituations":"Template/env variable for the DLQ topic resolving to an empty string; UIs or config generators emitting deadLetterQueue='' instead of omitting the key; copy-paste where the topic path was deleted but the key kept.","solutions":["Provide a full DLQ topic name (e.g. 'projects/my-project/topics/my-dlq') in the deadLetterQueue property.","Or remove the deadLetterQueue property entirely to disable the dead letter queue.","Fix the upstream template/env resolution so unset DLQ values become null/absent rather than \"\"."],"exampleFix":"-- before\n... WITH OPTIONS ('deadLetterQueue' = '')\n-- after\n... WITH OPTIONS ('deadLetterQueue' = 'projects/my-project/topics/my-dlq')","handlingStrategy":"validation","validationCode":"if (dlq != null && dlq.isEmpty()) { throw new IllegalArgumentException(\"deadLetterQueue must be a full topic name or omitted entirely\"); }","typeGuard":null,"tryCatchPattern":"try { ioProvider.from(tableConfig); } catch (InvalidConfigurationException e) { if (e.getMessage().contains(\"Dead letter queue\")) { /* set a real DLQ topic or drop the option */ } throw e; }","preventionTips":["Treat empty-string config values as unset: normalize them to null before passing options.","Always provide fully qualified DLQ topic paths (projects/.../topics/...) when the feature is enabled."],"tags":["java","apache-beam","pubsub","configuration"],"backgroundTag":"empty-required-field","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}