apache/cassandra · error · InvalidRequestException

txnId + " not known"

Error message

txnId + " not known"

What it means

runWithRoute looks up the command for the given TxnId via safeStore.unsafeGet and throws InvalidRequestException when the store has no such command (safeCommand.current() == null). It means the TxnId supplied to the debug operation does not exist on this node's command store.

Solutions

  1. Verify the TxnId string (epoch, node, command id) is copied exactly and belongs to this cluster.
  2. Confirm the txn's command store on THIS node holds the command (check node command-store debug tables) and use the node that owns the range.
  3. If the txn was truncated, the command no longer exists; use historical/truncated debug views instead of FETCH-style ops.

Example fix

// before
INSERT INTO system_views.accord_txn_ops (txn_id, op) VALUES ('a7f...typo...01', 'FETCH');
// after
-- confirm from the debug commands table that this node knows the txn
SELECT * FROM system_views.accord_commands WHERE txn_id = '<txnId>';
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the txn exists on this node before route-dependent ops
ResultSet rs = session.execute("SELECT * FROM system_views.accord_commands WHERE txn_id = ?", txnId);
if (rs.all().isEmpty()) throw new IllegalArgumentException("TxnId " + txnId + " not known on this node");

Try / catch

try {
    session.execute(fetchOpInsert);
} catch (InvalidRequestException e) {
    if (e.getMessage().endsWith("not known")) {
        // verify txnId, find the owning node, or accept the txn was truncated
    }
}

Prevention

When it happens

Trigger: INSERTing a route-dependent op (FETCH, etc.) into system_views.accord_txn_ops with a txnId that is unknown to the target command store: mistyped txnId, txn never routed to this node, or txn already fully truncated/evicted.

Common situations: Copy-pasting a TxnId from logs of a different node or cluster; querying after a topology change moved the txn to another replica; the command was garbage-collected after apply+truncate, so debug ops can no longer find it.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

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

                        recover(txnId, route, result);
                    });
                    break;
                case REQUEUE_PROGRESS_LOG:
                    run(txnId, commandStoreId, safeStore -> {
                        ((DefaultProgressLog)safeStore.progressLog()).requeue(safeStore, TxnStateKind.Waiting, txnId);
                        ((DefaultProgressLog)safeStore.progressLog()).requeue(safeStore, TxnStateKind.Home, txnId);
                        return AsyncChains.success(null);
                    });
            }
        }

        private void runWithRoute(TxnId txnId, int commandStoreId, Function<Command, BiConsumer<Route<?>, AsyncResult.Settable<Void>>> apply)
        {
            run(txnId, commandStoreId, safeStore -> {
                SafeCommand safeCommand = safeStore.unsafeGet(txnId);
                Command command = safeCommand.current();
                if (command == null)
                    throw new InvalidRequestException(txnId + " not known");
                Node node = AccordService.unsafeInstance().node();
                AsyncResult.Settable<Void> result = new AsyncResults.SettableResult<>();
                BiConsumer<Route<?>, AsyncResult.Settable<Void>> consumer = apply.apply(command);
                if (command.route() == null)
                {
                    FetchRoute.fetchRoute(node, txnId, command.maxParticipants(), LatentStoreSelector.standard(), (success, fail) -> {
                        if (fail != null) result.setFailure(fail);
                        else consumer.accept(success, result);
                    });
                }
                else
                {
                    consumer.accept(command.route(), result);
                }
                return result.chain();
            });
        }

View on GitHub (pinned to 88fd0f6a0e)