nautechsystems/nautilus_trader · error · anyhow::Error
Execution payload protection is not active
Error message
Execution payload protection is not active
What it means
reserve_execution_payload_seal consumes one seal nonce under the active payload key and requires the execution_payload_state row to exist with FOR SHARE locking. If the row is absent, payload protection was never activated (or was removed), so sealing cannot be accounted for and the call fails.
Source
Thrown at crates/adapters/blockchain/src/cache/database.rs:4743
/// Reserves one nonce use under the active payload key.
pub(crate) async fn reserve_execution_payload_seal(
&self,
keys: &PayloadKeySet,
) -> anyhow::Result<()> {
let mut transaction = self
.pool
.begin()
.await
.context("failed to start payload seal reservation")?;
let row = sqlx::query(
"SELECT deployment_id, protocol_version, operation, active_key_id \
FROM execution_payload_state WHERE component = 'signed_transactions' FOR SHARE",
)
.fetch_optional(&mut *transaction)
.await
.context("failed to lock execution payload state")?
.ok_or_else(|| anyhow::anyhow!("Execution payload protection is not active"))?;
let state = execution_payload_state_from_row(&row)?;
validate_execution_payload_state(&state, keys)?;
anyhow::ensure!(
state.operation == "ready",
"Execution payload storage is in {} maintenance",
state.operation
);
reserve_execution_payload_seal(&mut transaction, keys.active_key_id()).await?;
transaction
.commit()
.await
.context("failed to commit payload seal reservation")?;
Ok(())
}
async fn execution_payload_marker(&self) -> anyhow::Result<Option<i16>> {
sqlx::query_scalar::<_, i16>(
"SELECT version FROM execution_schema_version WHERE component = $1",View on GitHub (pinned to 18893faf8b)
Solutions
- Run the payload storage activation path (require_execution_payload_storage_ready / activate_execution_payload_storage) before any signing
- Verify protection is active: SELECT * FROM execution_payload_state WHERE component='signed_transactions' returns a row
- Ensure the deployment uses the same database it was activated against (check DATABASE_URL / connection config)
- Restore the state row from a consistent backup if it was lost
Example fix
// before let lease = db.require_execution_payload_storage(&keys, policy, batch).await?; // after: guarantee activation first db.require_execution_payload_storage_ready(&keys).await?;
Defensive patterns
Strategy: validation
Validate before calling
let active: Option<i16> = sqlx::query_scalar(
"SELECT version FROM execution_schema_version WHERE component = 'signed_transactions'",
).fetch_optional(&pool).await?;
if active.is_none() {
anyhow::bail!("payload protection not activated; run require_execution_payload_storage_ready first");
} Try / catch
if let Err(e) = db.reserve_execution_payload_seal(&keys).await {
if e.to_string().contains("protection is not active") {
db.require_execution_payload_storage_ready(&keys).await?; // activate then retry
} else { return Err(e); }
} Prevention
- Call require_execution_payload_storage_ready at startup before any signing
- Confirm DATABASE_URL points at the activated database in every environment
- Version-check the schema marker on boot
- Keep state-table rows backed up with the rest of the schema
When it happens
Trigger: Calling reserve_execution_payload_seal (part of the signing/sealing path) when execution_payload_state has no row for component 'signed_transactions' — i.e. protection never activated via the library's activation flow.
Common situations: Pointing a node at a fresh database without running payload activation; environment with Postgres execution enabled but protection bootstrap skipped; database restored without the state table contents.
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
- Could not calculate schema dir from current directory path o
- Error executing statement {sql_statement} with error: {e:?}
- Error dropping role {database}: {e:?}
- Failed to load order events: {e}
- Failed to start COPY operation: {e}
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/289f8d8fff0ba5c1.
Report an issue: GitHub.