apache/cassandra · error · InvalidRequestException

Can only unset '" + name + "'

Error message

Can only unset '" + name + "'

What it means

In the accord_debug tracing table update, the managed_by_pattern column can only be assigned false/NULL (i.e. unset). Setting it to true throws InvalidRequestException because 'managed by' ownership is derived, not user-assignable.

Source

Thrown at src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java:1172

            BucketMode newBucketMode = null;
            boolean unsetManagedByOwner = false;
            int newBucketSize = -1, newBucketSubSize = -1, newBucketSeen = -1;
            float newChance = Float.NaN;
            for (int i = 0 ; i < columns.length ; ++i)
            {
                String name = columns[i].name.toString();
                switch (name)
                {
                    default: throw new InvalidRequestException("Cannot update '" + name + '\'');
                    case "bucket_mode":
                        newBucketMode = checkBucketMode(values[i]);
                        break;
                    case "chance":
                        newChance = checkChance(values[i], name);
                        break;
                    case "managed_by_pattern":
                        if (values[i] != null && (Boolean)values[i])
                            throw new InvalidRequestException("Can only unset '" + name + '\'');
                        unsetManagedByOwner = true;
                        break;
                    case "bucket_size":
                        newBucketSize = checkNonNegative(values[i], name, 0);
                        break;
                    case "bucket_sub_size":
                        newBucketSubSize = checkNonNegative(values[i], name, 0);
                        break;
                    case "bucket_seen":
                        newBucketSeen = checkNonNegative(values[i], name, 0);
                        break;
                    case "trace_events":
                        newTrace = tryParseCoordinationKinds(values[i]);
                        break;
                }
            }

            if (newBucketSize == 0)

View on GitHub (pinned to 88fd0f6a0e)

Solutions

  1. Only SET managed_by_pattern = false (or NULL) to unset it; never assign true.
  2. To change bucketing management mode, set bucket_mode instead.
  3. Remove managed_by_pattern from generated UPDATE statements when the intent is enabling rather than unsetting.
  4. Inspect the table schema/docs to see which fields are settable.

Example fix

// before
session.execute("UPDATE system_views.accord_debug_tracing SET managed_by_pattern = true WHERE txn_id = '...'");
// after
session.execute("UPDATE system_views.accord_debug_tracing SET bucket_mode = '...' WHERE txn_id = '...'");
Defensive patterns

Strategy: validation

Validate before calling

if (isAssigningTrue("managed_by_pattern", update)) throw new IllegalArgumentException("managed_by_pattern can only be unset (false/null)");

Try / catch

try { session.execute(update); } catch (com.datastax.driver.core.exceptions.InvalidQueryException e) { if (e.getMessage().startsWith("Can only unset '")) { /* remove managed_by_pattern=true from SET clause */ } else throw e; }

Prevention

When it happens

Trigger: Executing 'UPDATE system_views.accord_debug_tracing SET managed_by_pattern = true WHERE txn_id = ...'; any write attempting to enable the managed_by flag on a trace.

Common situations: Assuming the debug table mirrors full internal tracing config and trying to toggle ownership on; scripted tuning that flips managed_by_pattern expecting it to enable management.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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