apache/cassandra · warning

Unable to parse property…

Error message

Unable to parse property serialization.empty_type_nonempty_writes behavior, falling back to FAIL

What it means

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.

Solutions

  1. Set the property to an exact valid enum value: FAIL, SILENT_DATA_LOSS, or LOG_DATA_LOSS
  2. Check cassandra-env.sh / JVM startup args for typos in -Dserialization.empty_type_nonempty_writes
  3. Remove the property entirely if the default (FAIL) is desired
  4. Verify with java -XshowSettings:properties or logs at startup that the value is applied

Example fix

// before
JVM_OPTS="$JVM_OPTS -Dserialization.empty_type_nonempty_writes=silent"
// after
JVM_OPTS="$JVM_OPTS -Dserialization.empty_type_nonempty_writes=SILENT_DATA_LOSS"
Defensive patterns

Strategy: validation

Validate before calling

// validate before launching the JVM
String v = System.getProperty("serialization.empty_type_nonempty_writes");
if (v != null && !Set.of("FAIL","SILENT_DATA_LOSS","LOG_DATA_LOSS").contains(v.trim().toUpperCase()))
    throw new IllegalArgumentException("Bad value: " + v);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.

Related errors


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/fcb20cea763fc3f7. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/db/marshal/EmptyType.java:67

{
    private enum NonEmptyWriteBehavior { FAIL, LOG_DATA_LOSS, SILENT_DATA_LOSS }

    private static final Logger logger = LoggerFactory.getLogger(EmptyType.class);
    private static final NoSpamLogger NON_EMPTY_WRITE_LOGGER = NoSpamLogger.getLogger(logger, 1, TimeUnit.MINUTES);
    private static final NonEmptyWriteBehavior NON_EMPTY_WRITE_BEHAVIOR = parseNonEmptyWriteBehavior();

    private static NonEmptyWriteBehavior parseNonEmptyWriteBehavior()
    {
        String value = SERIALIZATION_EMPTY_TYPE_NONEMPTY_BEHAVIOR.getString();
        if (value == null)
            return NonEmptyWriteBehavior.FAIL;
        try
        {
            return NonEmptyWriteBehavior.valueOf(toUpperCaseLocalized(value).trim());
        }
        catch (Exception e)
        {
            logger.warn("Unable to parse property " + SERIALIZATION_EMPTY_TYPE_NONEMPTY_BEHAVIOR.getKey() + ", falling back to FAIL", e);
            return NonEmptyWriteBehavior.FAIL;
        }
    }

    public static final EmptyType instance = new EmptyType();

    private EmptyType() {super(ComparisonType.CUSTOM, 0);} // singleton

    @Override
    public <V> ByteSource asComparableBytes(ValueAccessor<V> accessor, V data, ByteComparable.Version version)
    {
        return null;
    }

    @Override
    public <V> V fromComparableBytes(ValueAccessor<V> accessor, ByteSource.Peekable comparableBytes, ByteComparable.Version version)
    {
        return accessor.empty();

View on GitHub (pinned to 88fd0f6a0e)