Mirexa

Wiki Operations

Troubleshooting

Symptoms an operator or client sees from Mirexa — refusals, startup failures, slow stops, auth errors, dashboard statuses — with the cause behind each and what to do.

Most problems announce themselves in one of three places: an ERROR frame a client receives (a numeric code plus a message), a log line on the node, or the node refusing to start with a message naming the setting. This page is organised by what you see. Error codes are listed in full in error codes; this page covers what to do about them.

Errors a client receives

Code Typical message Cause What to do
Overloaded (0x0007) server overloaded: write buffer full, nothing stored, retry the whole batch The WAL write buffer (wal.max_buffer_bytes) stayed full for wal.buffer_wait_timeout, or a stream's hot cache had no room after ingestion.live_candle.admission_retries waits. Nothing was stored. Retry the whole batch after the hint in the frame; the SDKs do this. If it is persistent, ingest outruns the disk: check mirexa_ingestion_shed_batches_total{reason} (wal_buffer or hot_cache), mirexa_wal_buffered_bytes, and disk latency.
Overloaded (0x0007), on reads too (a shed while a partition moves or a new primary replays) A partition is being cut over to another node, or a node just made primary is replaying the log it kept as a copy. Raised before anything is dispatched. Retry; it clears by itself in moments. The SDKs retry reads and writes on this code.
Protocol (0x0001) batch not admissible: the batch spans more intervals than the stream's hot cache holds; split it A live batch is wider than the stream's hot cache. Per-stream cache sizes follow the timeframe: a 1h stream gets 2,048 slots by default, so 3,000 hourly bars in one live batch is refused. Split the batch, send it through the history route (-history, FlagHistory, mirexa-cli load), or raise the stream's size with mirexa-cli cache set. See the hot cache.
Protocol (0x0001) batch not admissible: a timestamp is not aligned to the stream's timeframe A bar's timestamp is not on the stream's interval grid (weekly bars must start on Monday). Fix the timestamps.
Protocol (0x0001) batch not admissible: a timestamp is older than the stream's hot cache holds; ... One batch mixes bars reaching back into the hot cache with bars past the newest. Send old and new bars in separate batches, or resend.
HistoryRequired (0x000B) batch not admissible: ... The bars are older than anything the stream stores, or fall in a span between chunks that only the history route installs. Resend the same bars with the history flag (mirexa-cli ingest -history); mirexa-cli load does this automatically. See corrections and history.
DerivedStream (0x000A) <stream> is derived from its source by the node; writing it needs OVERWRITE The stream is written by the node from its source (a lineage was declared). Write the source stream instead, or send with the overwrite flag deliberately. See derived streams.
Unauthorized (0x0003) session lacks the write_ticks permission (or similar) The session's grant lacks the permission. The grant is the token's permissions ∩ security.max_permissions. Issue a token with the permission; check the node's ceiling. With auth off, check the client actually asked for it.
Unauthorized (0x0003), at connect session token has expired; issue a fresh one Token expired, or the client's clock and the node's disagree. Issue a new token; use a TokenSource that re-reads a refreshed file. Check NTP on both ends.
Unauthorized (0x0003), at connect session token expires further out than 1h0m0s; ... Token validity over one hour (only possible with a tool other than mirexa-cli token), or clocks far apart. Reissue with -validity ≤ 1h; check clocks.
Unauthorized (0x0003), at connect session token signature is not from a trusted issuer; check security.auth.trusted_keys, or that a token was supplied at all Auth is on (the default) and the token is missing, signed by an untrusted key, or tampered with. Supply a token — on a single node with no trusted_keys, the one in <data_dir>/auth/admin.token or one minted from <data_dir>/auth/issuer.key; otherwise add the issuer's public key to every node's trusted_keys.
Unauthorized (0x0003), at connect session token is signed by a key this cluster has revoked; ... The issuer key was revoked through the control API. Issue under a trusted, unrevoked key.
SlowConsumer (0x0006) (subscription evicted) The client did not drain a subscription: network.subscription.drop_limit consecutive batches were dropped. Only that subscription ends. Consume faster or subscribe to fewer streams per connection; resubscribe from the last bar received. See subscriptions.
StalePlacement (0x0008) (with a retry hint) Cluster: this node's view of the partition directory is behind the epoch the client's write carried, or it has no entry yet. Retry after the hint; the SDK does. Persistent: the node is not catching up with the control plane — check its Raft metrics and connectivity.
PartitionUnavailable (0x0009) names the partition and node Cluster: the partition's primary is on a node the cluster has fenced, or this node is its primary but holds no current lease. No retry hint. Wait for failover (about two liveness timeouts after the node went silent, if an in-sync copy exists) or for the node to come back. Reads that allow stale answers can be served by a copy meanwhile. See failover.
PayloadTooLarge (0x0002) A frame exceeded network.max_frame_payload_bytes. Send smaller batches.
Internal (0x0004) ingest failed A server-side failure, logged on the node as ingest failed with the real error. Read the node log. Do not blindly resend a write that failed this way after a disconnect; read back first.
Unsupported (0x0005) A frame or flag this node does not implement (for example, asking for partial in-progress bars). Check client and server versions.
client error ErrAmbiguous The connection broke while a write was in flight: it may or may not have been applied. Read the range back, then resend only what is missing (a resent identical bar is a no-op). See durability.
client: connection closed after a quiet period The node closes a connection idle past network.read_timeout (30 s). Normal; SDKs reconnect on the next request.

A redirect (cluster) is not an error: the SDK's routing client follows it to the node that serves the partition.

The node does not start

The node prints mirexa: <reason> to stderr and exits 1. Configuration problems are reported all at once, each prefixed by its section.

Message (excerpt) Cause Fix
no data directory: set storage.data_dir in the config file or pass -data-dir No data directory anywhere. Set one.
storage: data_dir must not be empty (with -config and -data-dir) The file is validated before -data-dir applies. Put data_dir in the file or set MIREXA_STORAGE_DATA_DIR.
failed to load config file ...: the streams: section is no longer read ... An old file still has a streams: section. Set calendars through the control API (mirexa-cli calendar), then delete the section.
security: auth.enabled is true and cluster.enabled is true, but no trusted_keys are configured: every node must trust the same issuer A clustered node with auth on (the default) and no keys. A single node would generate its own issuer; a cluster cannot. Add the same public key from mirexa-cli token keygen to every node, or set security.auth.enabled: false.
security.auth.trusted_keys[0] ("ops"): public_key is not valid base64 / is 45 bytes, want 32 A path or the wrong string pasted. Paste the base64 line keygen printed, not the path to ops.pub.
security.max_permissions: ... Unknown permission name. Use names from permissions.
wal: max_buffer_bytes (...) must be at least batch_size (...) Bound below the flush trigger. Raise max_buffer_bytes or set it to 0.
cluster: liveness_timeout (...) must exceed election_timeout (...) Raise liveness_timeout.
cluster configuration: raft: leader_lease_timeout exceeds heartbeat_timeout Library rule checked at start. Keep leader_lease_timeout ≤ heartbeat_timeout.
control: the cluster API may only be served on a loopback address: ... Clustered, control.addr routable or a hostname, admin_auth off. Use a loopback IP, or enable control.admin_auth.
control admin auth: ... admin_auth on with no trusted keys. Configure security.auth.trusted_keys.
control.use_tls requires security.tls_enabled Turn on data-plane TLS or turn off use_tls.
replication_addr is set but replication_cert_file, ... No plaintext replication. Issue node certificates with mirexa-cli certs.
replication: <key> is mode 0644; a node key must be 0600 Loose key permissions. chmod 600.
load TLS certificate: ... Data-plane cert or key missing or mismatched. Check cert_file/key_file.
network: buffer_size N is below the handshake minimum 98 Raise network.buffer_size.
WAL directory "..." is already locked by another process Another process has this data directory open. Stop the other node; never run two on one directory.
a listen tcp ...: bind: address already in use on the data or control listener Port taken. Change the address or stop the other process.
ErrCorruptMidLog / corruption in the WAL before the last segment, or in the last segment with valid records after it Damaged WAL. See corruption policy; restore from backup.
a corrupt stream.idx Damaged index. Single node: restore from backup. Clustered with an in-sync copy elsewhere: the node sets the partition aside and starts.
join the control plane: ... after cluster.join_timeout A joining node could not be admitted: seeds unreachable, wrong addresses (must be control addresses), or admin auth without admin_token_file. Check seeds and connectivity; the orchestrator's restart is the retry.
resolve cluster settings: ... With strict_settings, the agreed settings did not arrive in settings_timeout; or this node's values are outside what the cluster can agree on. Check quorum and connectivity; fix the values named.
exit status 0 with this node has been decommissioned and has left the cluster; not starting The node was decommissioned. Intended. To reuse the id, deregister it through the control API.

The node starts but something is missing

Symptom Cause Fix
/metrics, /health, /ready refuse connections; log has {"level":"error","msg":"observability server","error":"... address already in use"} The observability address is taken — by default, control.addr (127.0.0.1:9090) collides with observability.addr (:9090) when the control listener is on. The node keeps running. Move one of the two.
/ready refuses connections for a long time after start Recovery is replaying a large WAL; the observability server starts after it. Wait; lengthen probe start delays; keep wal.checkpoint_interval set.
mirexa-cli calendar ... cannot connect control.enabled is false (the default). Enable the control listener.
A config edit had no effect Only logging.level is applied live; other changes need a restart, and some keys are not even reported as changed. Restart. See hot reload.
[config warning] MIREXA_...=...: invalid ... on stderr An environment variable did not parse and was ignored. Fix the value.
Every weekend appears as missing data The stream has no trading calendar. Set one with mirexa-cli calendar set. See gaps and trading calendars.

Stopping takes too long

Symptom Cause Fix
Stop takes about network.shutdown_timeout (30 s) or more, then logs shutdown timed out after ...; force-closed N active connection(s) Idle client connections never finish on their own; the listener waits the full timeout, then force-closes. Expected. Allow for it in the orchestrator's grace period, or lower network.shutdown_timeout.
Stop takes minutes on a node with many streams The final drain writes one chunk per stream, about 45 ms each (measured 2026-10-20, laptop NVMe). Allow streams × ~45 ms in the grace period. If killed, nothing acknowledged is lost; the next start replays the WAL.
stopping with copies not yet sent everything this node acknowledged; ... Clustered primary: copies did not catch up within the hand-off timeout. A failover now could promote a copy without the last writes. Check replication lag and the network between nodes.

Dashboard

Symptom Cause Fix
Every request answers 503; logins succeed but nothing loads The dashboard's own token (upstream_token_file) expired or its grant was withdrawn. Rewrite the token file; it recovers on the next reconnect (up to ~30 s), no restart.
403 on an action The user's role or the dashboard's grant lacks the permission; /api/v1/auth/capabilities shows which. Change the user's permissions, or reissue the dashboard's token with the permission (and check security.max_permissions).
401 The user's session expired. Sign in again.
429 on sign-in, for everyone Ten failed sign-ins in fifteen minutes from one address; behind a proxy all users share the proxy's address. Wait up to fifteen minutes.
A page reload signs users out The SPA and /api are on different origins, so the __Host- refresh cookie is not sent; or refresh_ttl: 0; or session_cookie_secure: true over plain HTTP. Serve both through one reverse proxy; set the cookie flag to match the scheme.
Startup: dashboard.session_secret_file is required / dashboard.users is empty Required settings missing. Generate a secret (head -c 32 /dev/urandom | base64) and a user (mirexa-dashboard -hash-password).
Startup refuses because the grant is narrower than upstream_permissions The node granted less than required. Reissue the dashboard's token, or narrow upstream_permissions.
The live chart updates in bursts The proxy is buffering Server-Sent Events. Disable buffering for /api/v1/streams/{id}/events (the shipped nginx configuration does).

Collecting evidence

  • The node's log at debug level: set logging.level: debug and the server applies it without a restart.
  • curl -s <observability.addr>/ready for the check results.
  • mirexa_errors_total{component,error_type} and mirexa_ingestion_shed_batches_total for refusal rates; mirexa_init_handshakes_total{result} for auth failures.
  • On a cluster, the control API's cluster status and partition health, and the mirexa_cluster_partitions_* gauges — see operating a cluster.

References

Source

Tests

Further reading