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
- Verify the TxnId string (epoch, node, command id) is copied exactly and belongs to this cluster.
- 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.
- 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
- Copy TxnIds programmatically (from logs/tables), never by hand.
- Verify the node you target is a replica that owns the txn's range.
- Remember commands are evicted after truncate; very old txn ids may no longer exist anywhere.
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
- Cannot apply a transaction with saveStatus " +…
- No drop table operation is in progress for table with id
- Unknown keyspace: '" + keyspaceName + "'
- accord.cache_size option was set incorrectly to
- accord.journal_directory must be specified
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)