Skip to content

Chronicle troubleshooting: diagnose processing failures

To troubleshoot Cratis Chronicle, start with the symptom you can observe: a missing read model, a failed handler, an append rejection, or a connection error. The checks below help you narrow down the cause and choose a recovery procedure. Before retrying or replaying events, check whether their side effects already happened.

If a term is unfamiliar, the Glossary explains it. Each symptom below links to the guide for the next step.

A projection builds a read model after events are appended. The read model is eventually consistent: a successful append does not mean the projection has already processed the event. Check these in order:

  1. Look for the expected events in the event sequence. If they were not appended, investigate the append before changing the projection.
  2. Wait for the projection to process them. In a test, wait for the expected read-model state before asserting it.
  3. Compare the appended event types with the projection’s mappings. If the projection only handles BookAdded, appending BookBorrowed will not update it.
  4. Check the property names. AutoMap matches by name: an event’s Title maps to the read model’s Title. A property with a different name needs an explicit mapping.

If the events and mappings are correct but processing has stopped, follow Recover a failed partition.

My read model’s child collection is null

Section titled “My read model’s child collection is null”

A child collection with no children is stored as an absent field rather than as []. This prevents a parallel replay from erasing a child that another event already added.

When the .NET client reads the model, it fills an absent non-nullable collection with an empty collection. A nullable declaration keeps null, so the application can distinguish absence from an empty collection. Reading the document directly with the MongoDB driver bypasses that handling.

Setting initial values will not change the stored shape: initial values for a children collection are dropped. Use Empty child collections to choose the declaration and read path that match your application.

My projection isn’t picking up a change I made

Section titled “My projection isn’t picking up a change I made”

If a read model still reflects the old projection logic, check how Chronicle handled the definition change before starting another rebuild. Some changes trigger historical processing automatically; the configured definition-evolution policy controls that behavior.

When a rebuild is needed, replay runs the projection over historical events to produce the read model again. Plan for the processing work and verify the rebuilt output; replay is not a guarantee that the new logic is correct. Follow Rebuild a read model to inspect the change and choose the rebuild.

To inspect or replay observers, see Recovering from failures, which links each action to its Cratis CLI page, including observers replay.

My reactor ran twice (or sent a duplicate notification)

Section titled “My reactor ran twice (or sent a duplicate notification)”

A reactor can receive the same event more than once during replay or recovery. Make its external work idempotent, meaning that repeating the delivery does not repeat the effect. Record that the effect completed and skip it on a later delivery with the same identity. Delivery identity explains which key to use; Reacting to events shows the wider pattern.

My reactor re-ran all its side effects after a rename

Section titled “My reactor re-ran all its side effects after a rename”

In the .NET client, the default reactor id is its full type name. A class rename or namespace move therefore creates a new observer, the processing identity that tracks the reactor’s position. That observer catches up from the beginning as ordinary observation. OnceOnly does not skip that catch-up.

Preserve the previous stored id explicitly to retain its processing position. Inspect any abandoned observer before removing it; removal does not transfer a position or undo duplicate side effects. See Reactor identity and renaming. The .NET discovery report exposes likely identity changes before registration, but a still-subscribed old instance during a rolling deployment can hide them.

My reactor throws and the stream seems stuck

Section titled “My reactor throws and the stream seems stuck”

When a reactor throws, Chronicle pauses processing for the failing event source partition, the group of events held back by that failure. It retries with exponential backoff and requests recovery when the observer subscribes again, for example after a redeployment. A partition that exhausts its retry attempts (10 by default) is quarantined: automatic retries stop. The limits are set in observer configuration.

Inspect the recorded error and fix its cause before requesting another attempt. If the fix requires a deployment, deploy it, then check whether processing resumed. Recover a failed partition explains how to choose retry or replay and verify the result. For terminal inspection and recovery, use the Cratis CLI runbook Fix a stuck observer.

After fixing the cause of a failure, an application can inspect a typed reactor’s failed partitions and retry one without supplying the observer or event-sequence identifiers:

using Cratis.Chronicle.Reactors;
var failedPartitions = await eventStore.Reactors.GetFailedPartitionsFor<InvitationMailReactor>();
var failedPartition = failedPartitions.FirstOrDefault();
if (failedPartition is not null)
{
var outcome = await eventStore.Reactors.RetryFailedPartitionFor<InvitationMailReactor>(failedPartition.Partition);
// Handle outcome before reporting recovery as successful.
}

In .NET, ReactorPartitionRetryOutcome.Accepted means the retry was accepted as a job and returns at once, even while the observer is busy; the job reports what became of it, so an observer or partition that is quarantined, or a failure that is already cleared, shows as the failure of that job and not as an outcome of the call. Started means a recovery job started or resumed, and PartitionNotFound means the failure was already cleared (or never existed), not that the call threw. ObserverQuarantined and PartitionQuarantined mean retry was refused until the corresponding quarantine is cleared. Unknown means the server returned an outcome this client version does not recognize; do not treat it as success.

View C# snippet source on GitHub

A retry request is not proof that recovery finished. Inspect the partition before reporting recovery as successful; retrying does not guarantee exactly-once execution of reactor side effects.

To find out about a stuck partition when it happens rather than when someone notices, see Get alerted when observers stop processing.

If the partition exhausted its retries before the fix was deployed, inspect it with failed-partitions show. An ordinary retry is refused while the partition is quarantined. Clear that partition’s quarantine to start a new retry budget while keeping its attempt history; the operation can also request an immediate retry.

Observer quarantine is separate from partition quarantine. If the observer is quarantined, use observers clear-quarantine first. Clearing a partition while its observer is quarantined reports that the retry was not started.

replay-partition is not a way out for a reactor handler marked [OnceOnly]: the client skips those handlers for replayed events, so a replay never runs the handler that failed. Remember that every retry runs the handler again, so a side effect the handler completed before it failed happens again unless you guard it; see Delivery identity.

Clear the quarantine of one reactor partition from a client

Section titled “Clear the quarantine of one reactor partition from a client”
using Cratis.Chronicle.Observation;
using Cratis.Chronicle.Reactors;
var failedPartitions = await eventStore.Reactors.GetFailedPartitionsFor<InvitationMailReactor>();
var quarantined = failedPartitions.FirstOrDefault(partition => partition.IsQuarantined == true);
if (quarantined is not null)
{
var result = await eventStore.Reactors.ClearFailedPartitionQuarantineFor<InvitationMailReactor>(
quarantined.Partition,
retryImmediately: true);
// Handle result.Outcome and result.RetryOutcome before reporting recovery as successful.
}

In .NET, ReactorPartitionQuarantineClearOutcome.Accepted means the clearing was accepted as a job and returns at once, even while the observer is busy; the job reports what became of it, and NotFound, NotQuarantined and a retry that did not start then show as the failure of that job. Cleared means the quarantine was cleared and the partition has a new retry budget; its attempt history is kept. NotFound means the partition is not among the failed partitions, and NotQuarantined means it is failed but was not quarantined; neither changed anything. Unknown means the server returned an outcome this client version does not recognize. RetryOutcome is only meaningful when retryImmediately is true and the quarantine was cleared: ObserverQuarantined there means the partition was cleared but the retry did not start because the observer itself is quarantined.

View C# snippet source on GitHub

Read the returned outcome before continuing: it distinguishes clearing the quarantine from starting a retry, and reports refusals separately. The same operation is available on the Observers service as ClearPartitionQuarantine.

Chronicle counts and logs a suspected skip when an observer’s position moves past a live event and no delivery path the observer saw covers it. It is a warning to investigate, not proof that the event was lost: a catch-up job may have delivered it without reporting it. The counters chronicle-observer-events-suspected-skipped and chronicle-appended-events-queue-suspected-undelivered-events (published as cratis.chronicle.observer.suspected_skipped_events and cratis.chronicle.appended_events_queue.suspected_undelivered_events when you opt in to Telemetry:MetricNames=Convention; see telemetry names) are described in Open Telemetry.

The observer writes this warning, inside the scope of the observer it concerns:

Observer may have skipped 1 event(s) of partition <partition>, first at sequence number <number> (<reason>); its position is <position>. This is a suspicion, not proof: investigate and consider replaying the partition

The reason says how the position moved past the event:

Reason What happened
HeldBackWhilePreparingCatchUp The event arrived while the observer was preparing a catch-up, was held back, and the position later moved past it.
HeldBackWhileReplaying The event arrived while its partition was replaying, was held back, and the position later moved past it.
HeldBackWhileCatchingUp The event arrived while its partition was catching up, was held back, and the position later moved past it.
PassedByPartitionJob The event arrived after another partition’s job had already moved the observer’s position beyond it, so the observer treated it as handled.

The appended-events queue writes a different warning when handing events to an observer fails: Dispatching <count> event(s) <first>-<last> of partition <partition> to observer <observer> failed; they may not have been delivered. The queue cannot tell whether the observer got to handle them.

Warnings are rate-limited to 10 per observer, or per queue, per minute. When more were suspected, a further warning says how many were not logged. The counters are never limited.

A warning can also describe an event that was already handled. If the appended-events queue lags behind an entire catch-up round, the live copy can reach the observer after the round delivered it. Check the resulting state before deciding to replay.

Investigate whether the partition’s read model or side effects reflect the event. If they do not, consider replaying the partition with cratis chronicle observers replay-partition. For a reactor, remember that a replay skips handlers marked [OnceOnly]. To retry a partition that failed, see My reactor throws and the stream seems stuck.

A constraint is rejecting an append I expected to succeed

Section titled “A constraint is rejecting an append I expected to succeed”

Constraints are checked during append. A uniqueness constraint rejects an event whose value would violate that constraint. Read the rejection to identify the constraint, then check the value within its scope. In a multi-tenant application, confirm the namespace too: each namespace isolates its data.

A projection stalls with “the schema does not declare it”

Section titled “A projection stalls with “the schema does not declare it””

Compare the property named in the error with the schema’s declared properties. A message using the compliance wording looks like this:

Could not apply compliance metadata for property 'address.postCode' of 'person-42'
because the schema does not declare it. The schema declares: 'street', 'city'.

Compliance handling uses the schema to decide how values marked as personal data with [PII] must be protected. A classification can require inspecting other properties in the document too. This error means a property in the payload has no matching declaration or additional-properties schema.

If an event type gained or renamed a property, check whether old events still match the current schema. Add the necessary event type migration before replaying the affected history.

If this error occurs during append, the append fails. If it occurs while the projection applies an event, the failing partition pauses and retries, leaving the read model stuck at that event.

Chronicle treats a geospatial Point, LineString or Polygon as a value. It does not inspect their GeoJSON members as separate properties during this walk.

For a polymorphic value or dictionary, check whether the schema describes the runtime members, including any additional-properties schema. Undeclared members can cause this error; using a value object with declared properties makes that shape explicit. See Geospatial values are not looked inside.

The .NET Chronicle client emits spans, the records of individual traced operations, on the activity source Cratis.Chronicle.Client. OpenTelemetry needs that source registered to collect them. Add AddCratisChronicleInstrumentation() to your tracer provider configuration, then check a new client operation. Trace Chronicle client operations with OpenTelemetry shows the configuration.

Check the kernel, client address, and storage separately:

  1. Check the local kernel’s health. curl --insecure https://localhost:35000/health prints Healthy when the health check passes. The --insecure option bypasses certificate verification for this local development check.
  2. Compare the client URL with the kernel’s address and port. The default is chronicle://localhost:35000; a kernel on another host or port needs a matching connection string.
  3. Check that the kernel can reach storage. The development image bundles MongoDB on port 27017. With separate storage, verify the address from the kernel’s environment.

If you still need a local development kernel, docker run -d --name chronicle -p 127.0.0.1:35000:35000 -p 127.0.0.1:27017:27017 cratis/chronicle:latest-development publishes its ports on this machine only. For Docker Compose, Aspire, or production, follow Choose an application host model.

Use Connection strings to correct the client address, or Get started to work through a local setup.

Kernel nodes can’t connect to each other

Section titled “Kernel nodes can’t connect to each other”

After an upgrade to 19.172.0 or later, nodes of a MongoDB or SQL cluster that use a TLS certificate file can fail to connect when the certificate lacks the client authentication usage. The logs contain Invalid client certificate for client authentication. See Nodes cannot connect to each other after upgrading.

When an event type’s shape changes over time, use event type migrations to evolve old events to the new shape rather than mutating history. Events are immutable — you migrate how they’re read, you don’t edit what was written.