{"record":{"id":"e309fb8d4a3c711e","repo":"apache/beam","slug":"unsupported-debugmode-value-supported-values-are-error-and","errorCode":null,"errorMessage":"Unsupported debugMode '\" + value + \"'. Supported values are ERROR and INFO.","messagePattern":"Unsupported debugMode '\" \\+ value \\+ \"'\\. Supported values are ERROR and INFO\\.","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeSchemaTransformUtils.java","lineNumber":129,"sourceCode":"      throw new IllegalArgumentException(\n          \"username is required for password and private key authentication.\");\n    }\n\n    if (isNotEmpty(privateKeyPassphrase) && !isNotEmpty(privateKey)) {\n      throw new IllegalArgumentException(\"privateKeyPassphrase requires privateKey.\");\n    }\n  }\n\n  @EnsuresNonNullIf(expression = \"#1\", result = true)\n  public static boolean isNotEmpty(@Nullable String value) {\n    return value != null && !value.isEmpty();\n  }\n\n  public static StreamingLogLevel parseStreamingLogLevel(String value) {\n    try {\n      return StreamingLogLevel.valueOf(value);\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(\n          \"Unsupported debugMode '\" + value + \"'. Supported values are ERROR and INFO.\", e);\n    }\n  }\n\n  public static CreateDisposition parseCreateDisposition(String value) {\n    try {\n      return CreateDisposition.valueOf(value);\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(\n          \"Unsupported createDisposition '\"\n              + value\n              + \"'. Supported values are CREATE_IF_NEEDED and CREATE_NEVER.\",\n          e);\n    }\n  }\n\n  public static WriteDisposition parseWriteDisposition(String value) {\n    try {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/snowflake/src/main/java/org/apache/beam/sdk/io/snowflake/SnowflakeSchemaTransformUtils.java#L111-L147","documentation":"parseStreamingLogLevel converts a user-supplied debugMode string into the StreamingLogLevel enum via valueOf. Any string not exactly matching an enum constant (ERROR or INFO) fails and is rethrown as an IllegalArgumentException naming the bad value and the allowed ones.","triggerScenarios":"Passing any string other than \"ERROR\" or \"INFO\" (case-sensitive, e.g. \"error\", \"debug\", \"WARN\") to parseStreamingLogLevel when configuring Snowflake streaming transforms.","commonSituations":"Using lowercase log level names; using levels from other logging frameworks (WARN, DEBUG); whitespace or trailing newline from env/config parsing.","solutions":["Pass exactly \"ERROR\" or \"INFO\".","Trim and uppercase the input before parsing: value.trim().toUpperCase(Locale.ROOT).","Wrap parsing in a try-catch if the value comes from user config."],"exampleFix":"// before\nparseStreamingLogLevel(\"debug\")\n// after\nparseStreamingLogLevel(\"INFO\")","handlingStrategy":"validation","validationCode":"Set<StreamingLogLevel> valid = EnumSet.allOf(StreamingLogLevel.class);\nif (!valid.contains(StreamingLogLevel.valueOf(value.trim().toUpperCase(Locale.ROOT)))) { /* reject */ }","typeGuard":null,"tryCatchPattern":"try { level = SnowflakeSchemaTransformUtils.parseStreamingLogLevel(cfg.debugMode()); }\ncatch (IllegalArgumentException e) { level = StreamingLogLevel.INFO; log.warn(e.getMessage()); }","preventionTips":["Use the enum constant instead of raw strings where the API allows.","Normalize config strings (trim + uppercase) before parsing.","List accepted values in your config schema/documentation."],"tags":["java","snowflake","enum","parsing"],"backgroundTag":"invalid-enum-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}