{"record":{"id":"fc78dc9e2e049bea","repo":"apache/iceberg","slug":"invalid-file-content-value-s","errorCode":null,"errorMessage":"Invalid file content value: '%s'","messagePattern":"Invalid file content value: '(.+?)'","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/ContentFileParser.java","lineNumber":426,"sourceCode":"    }\n\n    return partitionData;\n  }\n\n  private static FileContent fileContentFromJson(String content) {\n    switch (content) {\n      case CONTENT_DATA:\n        return FileContent.DATA;\n      case CONTENT_POSITION_DELETES:\n        return FileContent.POSITION_DELETES;\n      case CONTENT_EQUALITY_DELETES:\n        return FileContent.EQUALITY_DELETES;\n      default:\n        // In 1.10 and before, file content is serialized as the FileContent enum value\n        try {\n          return FileContent.valueOf(content);\n        } catch (IllegalArgumentException e) {\n          throw new IllegalArgumentException(\n              String.format(\"Invalid file content value: '%s'\", content), e);\n        }\n    }\n  }\n}\n","sourceCodeStart":408,"sourceCodeEnd":432,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/ContentFileParser.java#L408-L432","documentation":"fileContentFromJson accepts file content as a numeric int (0=data, 1=positional deletes, 2=equality deletes) or, for backward compatibility with Iceberg <=1.10, the FileContent enum name. Any other string that is not an enum constant triggers this IllegalArgumentException, chaining the original cause.","triggerScenarios":"ContentFileParser.fromJson encountering a 'content' field with an unrecognized string value (e.g. \"delete\", \"DATA_FILE\", lowercase names) that is neither an int nor a valid FileContent enum name.","commonSituations":"JSON produced by older tooling or other frameworks using different content naming; hand-written JSON; case-sensitivity mistakes (enum names are uppercase).","solutions":["Change the content value to the integer form: 0, 1, or 2.","Or use the exact FileContent enum name: DATA, POSITION_DELETES, EQUALITY_DELETES.","Regenerate the JSON with the current Iceberg parser to guarantee compatibility."],"exampleFix":"// before\n{\"content\": \"POSITION_DELETE\"}\n// after\n{\"content\": 1}","handlingStrategy":"validation","validationCode":"Object c = json.get(\"content\");\nboolean ok = (c instanceof Number)\n    || (c instanceof String && Set.of(\"DATA\",\"POSITION_DELETES\",\"EQUALITY_DELETES\").contains(c));","typeGuard":null,"tryCatchPattern":"try { ContentFileParser.fromJson(node, spec); } catch (IllegalArgumentException e) {\n  throw new IllegalArgumentException(\"unsupported content value\", e);\n}","preventionTips":["Write content as int 0/1/2.","If using strings, match FileContent enum names exactly (uppercase).","Test with files written by older Iceberg versions (<1.10 enum form)."],"tags":["json","enum","parsing"],"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"}