How to debug and monitor synchronization operations in Aranya.
Sync issues are the most common in deployed Aranya systems. This guide covers:
Log these fields for successful syncs:
duration_mspeer_device_idpeer_addrcmd_count_receivedeffects_countbytes_transferredfirst_cmd_hashfirst_cmd_max_ctsnetwork_stats.rtt_ms, network_stats.bandwidth_mbps
local_head, peer_head
Log failures with:
errorpeer_device_idpeer_addrduration_mslast_successful_syncretry_countnetwork_stats
Log timeouts with:
peer_device_idpeer_addrtimeout_mslast_successful_syncretry_countnetwork_rtt_msTODO: Will need updated when mtls lands.
Log PSK mismatches during QUIC connection establishment with:
peer_device_idpeer_addrpsk_idlast_successful_syncA sync stall occurs when the same first command is repeatedly sent while new commands are expected but not delivered.
Not a stall: Repeating the first command when the graph is idle (no new commands).
Is a stall: Repeating the first command when the local graph has advanced or the peer advertised newer state.
Sync being stalled is from the local node perspective on the sync response, it is detecting that the peer is stalled when it just sends repeated first commands when the local node is expecting new data.
Log stalls with:
peer_device_idstall_countcmd_hashcmd_max_ctslocal_head_ctspeer_head_ctsThreshold: 3 consecutive identical first commands (configurable). Reset when the first command changes.
Note: These metrics are on a per-transport basis; some are not applicable to all transports.
Recommended fields:
network_stats.rtt_msnetwork_stats.bandwidth_mbpsnetwork_stats.packet_loss_percent (QUIC only)Use duration_ms for overall timing, and optionally add per-phase timings at DEBUG level.
Log phase timings with:
phase (network, add_commands, commit)duration_msLog per-command timings with:
command_idduration_msThe JSON format is configured via the tracing subscriber. See Logging Configuration for setup details.
Example log entry for successful sync:
{
"timestamp": "2026-02-03T16:35:25.128361Z",
"level": "INFO",
"target": "aranya_daemon::sync::manager",
"fields": {
"event_type": "sync_complete",
"message": "Sync completed successfully",
"peer_device_id": "127.0.0.1:51047",
"peer_graph_id": "3rK8CzrjzEyP3bL9kjkEj28bCCJ2opuCAidtzKu6bBM2",
"duration_ms": 0,
"cmd_count_received": 0,
"effects_count": 0
},
"span": {
"graph": "3rK8CzrjzEyP3bL9kjkEj28bCCJ2opuCAidtzKu6bBM2",
"peer": "127.0.0.1:51047",
"name": "sync"
},
"spans": [
{"component": "daemon", "name": "daemon"},
{"component": "sync_manager", "name": "syncer"},
{"graph": "3rK8CzrjzEyP3bL9kjkEj28bCCJ2opuCAidtzKu6bBM2", "peer": "127.0.0.1:51047", "name": "sync"}
]
}