{"record":{"id":"64b813ad56b6b645","repo":"apache/iceberg","slug":"invalid-isolation-level-s","errorCode":null,"errorMessage":"Invalid isolation level: %s","messagePattern":"Invalid isolation level: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/IsolationLevel.java","lineNumber":48,"sourceCode":" * isolation is beneficial for environments with many concurrent writers.\n *\n * <p>The serializable isolation level guarantees that an ongoing UPDATE/DELETE/MERGE operation\n * fails if a concurrent transaction commits a new file that might contain rows matching the\n * condition used in UPDATE/DELETE/MERGE. For example, if there is an ongoing update on a subset of\n * rows and a concurrent transaction adds a new file with records that potentially match the update\n * condition, the update operation must fail under the serializable isolation but can still commit\n * under the snapshot isolation.\n */\npublic enum IsolationLevel {\n  SERIALIZABLE,\n  SNAPSHOT;\n\n  public static IsolationLevel fromName(String levelName) {\n    Preconditions.checkArgument(levelName != null, \"Invalid isolation level: null\");\n    try {\n      return IsolationLevel.valueOf(levelName.toUpperCase(Locale.ROOT));\n    } catch (IllegalArgumentException e) {\n      throw new IllegalArgumentException(\n          String.format(\"Invalid isolation level: %s\", levelName), e);\n    }\n  }\n}\n","sourceCodeStart":30,"sourceCodeEnd":53,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/IsolationLevel.java#L30-L53","documentation":"IsolationLevel.fromName parses a string into the IsolationLevel enum case-insensitively; a null input gets a dedicated message, and any name not matching SERIALIZABLE or SNAPSHOT rethrows IllegalArgumentException with the offending value and the underlying cause.","triggerScenarios":"Passing an isolation-level string (e.g., table property or config value) that is neither 'serializable' nor 'snapshot' (case-insensitive), or null.","commonSituations":"Typo in table properties like write.wap / retry config; value like 'SERIALIZABLE ' with trailing whitespace; users supplying 'strict' or 'read-committed' which Iceberg does not support.","solutions":["Set the value to exactly 'serializable' or 'snapshot' (any case)","Trim whitespace/newlines from the configured value","Handle null by defaulting to SERIALIZABLE explicitly in calling code"],"exampleFix":"// before\nconf.set(\"isolation-level\", \"read-committed\");\n// after\nconf.set(\"isolation-level\", \"snapshot\");","handlingStrategy":"validation","validationCode":"String v = raw == null ? null : raw.trim();\nboolean valid = \"serializable\".equalsIgnoreCase(v) || \"snapshot\".equalsIgnoreCase(v);\nif (!valid) throw new IllegalArgumentException(\"Bad isolation level: \" + raw);","typeGuard":null,"tryCatchPattern":"try {\n  IsolationLevel level = IsolationLevel.fromName(raw);\n} catch (IllegalArgumentException e) {\n  level = IsolationLevel.SERIALIZABLE; // documented default\n}","preventionTips":["Only configure 'serializable' or 'snapshot'","Trim config values before parsing","Add config validation at application startup"],"tags":["java","enum","configuration"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}