{"record":{"id":"fcb20cea763fc3f7","repo":"apache/cassandra","slug":"unable-to-parse-property-serialization-empty-type","errorCode":null,"errorMessage":"Unable to parse property serialization.empty_type_nonempty_writes behavior, falling back to FAIL","messagePattern":"Unable to parse property serialization\\.empty_type_nonempty_writes behavior, falling back to FAIL","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/db/marshal/EmptyType.java","lineNumber":67,"sourceCode":"{\n    private enum NonEmptyWriteBehavior { FAIL, LOG_DATA_LOSS, SILENT_DATA_LOSS }\n\n    private static final Logger logger = LoggerFactory.getLogger(EmptyType.class);\n    private static final NoSpamLogger NON_EMPTY_WRITE_LOGGER = NoSpamLogger.getLogger(logger, 1, TimeUnit.MINUTES);\n    private static final NonEmptyWriteBehavior NON_EMPTY_WRITE_BEHAVIOR = parseNonEmptyWriteBehavior();\n\n    private static NonEmptyWriteBehavior parseNonEmptyWriteBehavior()\n    {\n        String value = SERIALIZATION_EMPTY_TYPE_NONEMPTY_BEHAVIOR.getString();\n        if (value == null)\n            return NonEmptyWriteBehavior.FAIL;\n        try\n        {\n            return NonEmptyWriteBehavior.valueOf(toUpperCaseLocalized(value).trim());\n        }\n        catch (Exception e)\n        {\n            logger.warn(\"Unable to parse property \" + SERIALIZATION_EMPTY_TYPE_NONEMPTY_BEHAVIOR.getKey() + \", falling back to FAIL\", e);\n            return NonEmptyWriteBehavior.FAIL;\n        }\n    }\n\n    public static final EmptyType instance = new EmptyType();\n\n    private EmptyType() {super(ComparisonType.CUSTOM, 0);} // singleton\n\n    @Override\n    public <V> ByteSource asComparableBytes(ValueAccessor<V> accessor, V data, ByteComparable.Version version)\n    {\n        return null;\n    }\n\n    @Override\n    public <V> V fromComparableBytes(ValueAccessor<V> accessor, ByteSource.Peekable comparableBytes, ByteComparable.Version version)\n    {\n        return accessor.empty();","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/db/marshal/EmptyType.java#L49-L85","documentation":"EmptyType parses the system property serialization.empty_type_nonempty_writes to decide how to handle writes of non-empty values to an EmptyType column (see CASSANDRA-15790). If the property value is not one of the NonEmptyWriteBehavior enum names (FAIL, SILENT_DATA_LOSS, LOG_DATA_LOSS), the parser logs a warning and falls back to FAIL.","triggerScenarios":"Starting the JVM with -Dserialization.empty_type_nonempty_writes=<value> where <value> is misspelled, has unsupported casing beyond trim/uppercase normalization, or is not a valid enum constant.","commonSituations":"Typo in cassandra-env.sh JVM_OPTS; copying a config flag from documentation of a different version; whitespace or hidden characters in the property value.","solutions":["Set the property to an exact valid enum value: FAIL, SILENT_DATA_LOSS, or LOG_DATA_LOSS","Check cassandra-env.sh / JVM startup args for typos in -Dserialization.empty_type_nonempty_writes","Remove the property entirely if the default (FAIL) is desired","Verify with java -XshowSettings:properties or logs at startup that the value is applied"],"exampleFix":"// before\nJVM_OPTS=\"$JVM_OPTS -Dserialization.empty_type_nonempty_writes=silent\"\n// after\nJVM_OPTS=\"$JVM_OPTS -Dserialization.empty_type_nonempty_writes=SILENT_DATA_LOSS\"","handlingStrategy":"validation","validationCode":"// validate before launching the JVM\nString v = System.getProperty(\"serialization.empty_type_nonempty_writes\");\nif (v != null && !Set.of(\"FAIL\",\"SILENT_DATA_LOSS\",\"LOG_DATA_LOSS\").contains(v.trim().toUpperCase()))\n    throw new IllegalArgumentException(\"Bad value: \" + v);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use exact enum names in JVM properties","Centralize JVM_OPTS edits and review diffs","Grep startup logs for this warning after config changes"],"tags":["configuration","jvm-properties","enum"],"backgroundTag":"invalid-env-var-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}