affaan-m/ECC · error
Context graph entity not found: {entity_id}
Error message
Context graph entity not found: {entity_id} What it means
Returned by the `graph show` subcommand when `db.get_context_entity_detail(entity_id, limit)` yields `None`. The detail query joins entity metadata with its observations/edges; a `None` result means no context-graph entity matches the given `entity_id`. The CLI surfaces this as a hard error rather than printing an empty detail view.
Source
Thrown at ecc2/src/main.rs:2540
db.recall_context_entities(resolved_session_id.as_deref(), &query, limit)?;
if json {
println!("{}", serde_json::to_string_pretty(&entries)?);
} else {
println!(
"{}",
format_graph_recall_human(&entries, resolved_session_id.as_deref(), &query)
);
}
}
GraphCommands::Show {
entity_id,
limit,
json,
} => {
let detail = db
.get_context_entity_detail(entity_id, limit)?
.ok_or_else(|| {
anyhow::anyhow!("Context graph entity not found: {entity_id}")
})?;
if json {
println!("{}", serde_json::to_string_pretty(&detail)?);
} else {
println!("{}", format_graph_entity_detail_human(&detail));
}
}
GraphCommands::Sync {
session_id,
all,
limit,
json,
} => {
if all && session_id.is_some() {
return Err(anyhow::anyhow!(
"graph sync does not accept a session ID when --all is set"
));
}View on GitHub (pinned to 01e15490f0)
Solutions
- List/search entities first with `ecc graph entities` or `ecc graph recall <query>` to obtain a valid ID.
- Run `ecc graph sync` (and any relevant `graph connectors sync`) to populate the entity.
- Verify the entity ID format matches what `graph entities` emits (numeric vs. slug vs. hash).
Example fix
// before ecc graph show nonexistent-entity // after ecc graph entities | grep <term> ecc graph show <real-entity-id>
Defensive patterns
Strategy: validation
Validate before calling
// Verify entity exists before show
if db.get_context_entity_detail(entity_id, 1)?.is_none() {
eprintln!("entity {entity_id} not found; listing:");
print_entities(&db)?;
return Ok(());
} Try / catch
match db.get_context_entity_detail(entity_id, limit)? {
Some(detail) => print_detail(detail),
None => { eprintln!("entity not found: {entity_id}"); std::process::exit(1); }
} Prevention
- Source entity IDs only from current `graph entities` / `graph recall` output.
- Re-sync graph data after resets before referencing old IDs.
- Match the ID format exactly (numeric vs slug) as emitted by the listing command.
When it happens
Trigger: Running `ecc graph show <id>` for an ID that was never ingested or has been pruned. Supplying a string ID whose format does not match the stored entity identifier scheme. Querying an entity created by a connector that has not been synced yet.
Common situations: Fresh workspace with no graph data ingested. Pointing at a state DB from a different project. Entity IDs from `graph search`/`graph recall` that have since expired from the retention window.
Related errors
- Context graph observation #{observation_id} was not found
- Context graph entity type cannot be empty
- Context graph entity name cannot be empty
- Missing value for --db
- querying user %s: %w
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/1cedef65302a16c8.
Report an issue: GitHub.