Preview. Stack v4.0 has not been released, and what is documented here can still change before it does. The current release is v3.2, which does not have this page.Go to Ledger in v3.2
Ledger

Troubleshoot Ledger

Start from a user-visible symptom, collect safe evidence, and reach the owning runbook.

Start with the response status and structured error reason, then correlate it with Ledger membership, storage, and telemetry. Several different protections return 503; they do not all have the same retry or recovery action.

Preserve evidence first#

Before restarting, scaling, compacting, removing a member, or changing configuration, record:

  • the start time, affected operation, ledger, endpoint, and request or trace identifier;
  • the Stack, Operator, Ledger server, and client versions;
  • the HTTP status or gRPC code, the structured reason, and the Retry-After value when the response is a 503;
  • whether reads, writes, or both are affected;
  • the current leader, voters and learners, committed position, and applied positions;
  • recent rollout, maintenance, index, backup, restore, or event-sink activity;
  • member restarts, volume events, and time-synchronization state.

Run non-destructive checks first:

bash
ledgerctl cluster status
ledgerctl ledgers list --json
ledgerctl cluster disk-usage --json

cluster disk-usage inspects the member reached by the active profile. Repeat it against each member endpoint when the affected node is not known.

Do not use ledgerctl cluster remove-node --force, do not restart a node with the server's --unsafe-skip-config-validation, and do not hand-edit persistent data or delete a persistent volume as a diagnostic step. These actions change the evidence and can make recovery harder. The storage-schema-version check cannot be bypassed, not even with --unsafe-skip-config-validation, so that flag will not clear a schema failure.

Route the symptom#

SymptomConfirmLikely conditionNext action
HTTP 503 with NO_LEADER and Retry-After: 1ledgerctl cluster status shows no leaderElection in progress, missing voter majority, or broken peer connectivityClients may retry after the advertised delay for a brief election. Restore quorum or peer connectivity when it persists.
Pods are ready, but writes return 429 and WRITES_BLOCKED_DISK_FULLDisk usage on each member; WAL/data high-water settingsAt least one protected volume crossed its block markStop non-essential writes, expand the affected volume through the supported platform path, and wait until use falls below the resume mark.
Pods are ready, but writes return 503 and WRITES_BLOCKED_CLOCK_SKEWNode clock offset and time-service healthA peer exceeds the configured clock-skew threshold (--health-clock-skew-threshold, 500 ms by default)Restore time synchronization across members. Do not disable the gate before identifying the clock source.
Writes return 503 and MAINTENANCE_MODECluster status reports maintenance enabledA planned or failed maintenance window still owns the write boundaryContact the maintenance owner and follow Use Maintenance Mode. Do not retry until the boundary is intentionally removed.
A follower endpoint fails writes while direct leader requests workRequest path through every exposed endpoint; internal TLS and cluster trustThe follower cannot forward authorized requests to the leaderFollow Secure Cluster Traffic with TLS and verify certificates, names, trust, and cluster identity on every member.
401 from all endpointsToken signature, issuer, audience, expiry, and active profileAuthentication failedRefresh or correct the credential using Authenticate and Authorize Clients. An invalid token must not fall back to anonymous access.
403 for one operationCaller scopes and ledger targetThe authenticated caller lacks permissionCompare the required scope with the assigned role; do not broaden access until the denied action is understood.
TLS handshake or certificate-name failureCA chain, certificate validity, SAN, endpoint name, and client profileClient or inter-node trust does not match the endpointCorrect the trust or name through the TLS runbook; do not use insecure transport as the production fix.
Writes are slow and queue-full counters increaseApply, WAL, peer latency, Pebble stall, CPU and disk IOPSConsensus or storage cannot sustain the incoming rateReduce load, preserve quorum, then follow Plan Capacity and Tune Performance.
Member remains a learner or falls behindCluster status from leader and affected node; restart, disk, network, memoryCatch-up cannot complete or the member keeps restartingStop further lifecycle changes and follow Plan Topology and Manage Cluster Lifecycle.
Query reports INDEX_BUILDING or required index is not readyIndex status on every serving memberBackfill has not completedKeep dependent traffic disabled and follow Create and Manage Indexes.
Current read reports READ_INDEX_NOT_CAUGHT_UPRequested minimum sequence or checkpoint versus member stateThe local read index has not reached the requested positionRetry on an appropriate member after catch-up or choose the documented consistency path; see Choose Read Consistency and Use Checkpoints.
Filter returns an index error or unexpectedly empty resultTarget, field, typed schema, filter, index, cursor and checkpointQuery contract or view does not match the requestValidate the filter and index rather than falling back to an unbounded scan.
Transactions commit but downstream events stopSink cursor, last error, destination and consumer deduplicationAsynchronous delivery is retrying independently of Ledger commitsFollow Consume, Monitor, and Recover Events; do not replay without a deduplication plan.
Backup or restore stalls or fails validationJob status, manifest, segment chain, object access, target cleanlinessArtifact, credential, concurrency, compatibility, or target-state problemKeep the source cluster unchanged and follow the backup or restore runbook. Do not finalize an invalid restore.

Diagnose availability failures#

No leader#

A brief election can return 503, NO_LEADER, and Retry-After: 1. Any request can hit it, including a linearizable read. Retry after the advertised delay: a mutation must be reissued byte-identical under its original idempotency key, while a read carries no key and can simply be repeated. Reusing a key with different content is rejected, not silently accepted — see the IDEMPOTENCY_KEY_CONFLICT row in Retry and rollback rules. When the condition lasts beyond the normal election window:

  1. identify which voters are reachable;
  2. confirm that a majority of the configured voter set is running;
  3. compare peer connectivity and internal TLS from each voter;
  4. inspect disk, memory, and restart events on missing members;
  5. stop concurrent disruption or rollout;
  6. recover existing members before considering membership changes.

Do not bootstrap a replacement cluster or force-remove a member while the previous voter set can recover. Escalate a quorum-loss decision with the current membership and volume state.

Ready but not writable#

If a disk or clock-skew write gate is active, readiness still reports healthy. Read the structured reason to tell the gates apart:

  • WRITES_BLOCKED_DISK_FULL needs volume headroom below the low-water resume mark;
  • WRITES_BLOCKED_CLOCK_SKEW needs clocks brought within the configured threshold;
  • MAINTENANCE_MODE needs the maintenance owner to release the boundary.

Every 503 carries Retry-After: 1 — NO_LEADER, WRITES_BLOCKED_CLOCK_SKEW, MAINTENANCE_MODE, INDEX_BUILDING and READ_INDEX_NOT_CAUGHT_UP among them. That value is a fixed default applied to the whole class, not an estimate of how long the condition will last, so read the header as "this response is retryable in principle" and let the structured reason set the actual retry policy. NO_LEADER clears within an election and does suit a one-second retry; MAINTENANCE_MODE does not, and a client that honors the header literally will retry every second for the length of the window. The disk-full 429 carries no header at all, so a client must pace those retries itself.

Do not repeatedly restart ready members. The write gate is cluster state or a health decision, not a liveness failure.

Diagnose latency#

Correlate the same time window in this order:

  1. request latency and response reasons;
  2. proposal queue load and full events;
  3. Raft apply and WAL append duration;
  4. peer round-trip latency and leadership changes;
  5. Pebble flush, compaction, and write stalls;
  6. WAL/data bytes and volume IOPS;
  7. process memory, garbage collection, CPU throttling, and restarts;
  8. index builds, backups, and restore work;
  9. changes in request size, bulk concurrency, postings, or Numscript account fan-out.

Reduce incoming concurrency when the queue or storage cannot drain. Tune only after identifying the limiting resource and capturing a repeatable baseline.

Retry and rollback rules#

ConditionClient behaviorOperator behavior
Brief NO_LEADER with Retry-AfterRetry after the advertised delay. A mutation keeps its original idempotency key and payload; a read has neither and is simply repeated.Watch election and quorum; intervene if it persists.
Maintenance modeStop automatic retries or back off until the maintenance owner reopens writes.Keep the application drain in place and complete or roll back the maintenance task.
Disk-full gateDo not create a retry storm. Preserve the mutation and its idempotency key.Restore headroom and verify use below the resume mark.
Clock-skew gateBack off; changing request payload does not help.Restore node time synchronization.
409 with IDEMPOTENCY_KEY_CONFLICTThe key was reused with different request content. Reissue the original payload unchanged, or use a new key for a genuinely different request.Compare the retried request body against the recorded first attempt; a conflicting retry is rejected, never applied twice.
Auth or validation errorDo not retry unchanged credentials or payload.Correct the client, policy, or request contract.
Index building or read index behindRetry only after the required view advances, or use an explicitly acceptable consistency mode.Keep dependent traffic disabled and restore index progress.

If a deployment or configuration change caused the symptom, stop its rollout and follow that change's rollback procedure. Do not introduce an unrelated tuning change while evidence still points to the original change.

Prepare an escalation bundle#

Include:

  • exact UTC time range and user impact;
  • Stack, Operator, server, and client versions and image digests;
  • sanitized request shape, response status, structured reason, and retry header;
  • cluster status from the leader and affected member;
  • Operator conditions and Kubernetes events;
  • relevant logs and traces with credentials, tokens, signing keys, and database DSNs removed;
  • dashboard snapshots for request, leader, queue, WAL, apply, storage, memory, and network signals;
  • the last known good change and every action already attempted;
  • backup status and persistent-volume state when recovery may be required.

Preserve the original artifacts. An escalation should allow another operator to reconstruct the timeline without repeating a destructive action.