apache/cassandra · error · java.lang.IllegalArgumentException

enable-active-update and disable-active-update cannot be…

Error message

enable-active-update and disable-active-update cannot be used together

What it means

Nodetool SetAuthCacheConfig computes the desired active-update state from the --enable-active-update and --disable-active-update flags. Supplying both is contradictory, so getActiveUpdate throws this IllegalArgumentException. It happens purely client-side before any cache configuration is applied.

Solutions

  1. Use only --enable-active-update to turn it on
  2. Use only --disable-active-update to turn it off
  3. Omit both flags to leave active-update unchanged
  4. Fix the calling script so only one flag is ever set

Example fix

// before
nodetool setauthcacheconfig roles-cache --enable-active-update --disable-active-update
// after
nodetool setauthcacheconfig roles-cache --enable-active-update
Defensive patterns

Strategy: validation

Validate before calling

[ -n "$ENABLE" ] && [ -n "$DISABLE" ] && { echo "pick one of --enable-active-update/--disable-active-update"; exit 2; }

Prevention

When it happens

Trigger: `nodetool setauthcacheconfig <cache> --enable-active-update --disable-active-update` — both flags set in one invocation.

Common situations: Scripted invocations where both booleans were set from variables defaulting to true; copy-paste merging of enable and disable examples.

Understand the failure class

Background: "mutually exclusive" flag errors: what "can't supply both nx and xx", "--raw is not compatible with -i" and "cannot be used with" mean, and how to fix them — this error's family across 29 libraries.

Related errors


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

Appendix: source

Thrown at src/java/org/apache/cassandra/tools/nodetool/SetAuthCacheConfig.java:104

        {
            authCacheMBean.setMaxEntries(maxEntries);
            probe.output().out.println("Changed Max Entries to " + maxEntries);
        }

        if (activeUpdate != null)
        {
            authCacheMBean.setActiveUpdate(activeUpdate);
            probe.output().out.println("Changed Active Update to " + activeUpdate);
        }
    }

    private Boolean getActiveUpdate(Boolean enableActiveUpdate, Boolean disableActiveUpdate)
    {
        if (enableActiveUpdate == null && disableActiveUpdate == null)
            return null;

        if (enableActiveUpdate != null && disableActiveUpdate != null)
            throw new IllegalArgumentException("enable-active-update and disable-active-update cannot be used together");

        return Boolean.TRUE.equals(enableActiveUpdate) ? Boolean.TRUE : Boolean.FALSE;
    }
}

View on GitHub (pinned to 88fd0f6a0e)