Skip to content

Memory sync: UNIQUE constraint failure on memory_docs.document_id breaks GitHub sync on every tick #6147

Description

@Al629176

Summary

The GitHub Composio memory sync pipeline fails on every periodic tick with a SQLite UNIQUE constraint violation on memory_docs.document_id. The pipeline retries next tick but encounters the same error, so GitHub memory never syncs after the first successful ingest.

Log evidence

08:53:50:WRN [sync:orchestrator] sync failed toolkit="github" connection_id="ca_HLk7bTXBixH6" error=upsert memory_docs: UNIQUE constraint failed: memory_docs.document_id
08:53:50:WRN [memory_sync:dispatcher] pipeline tick failed pipeline_id="composio:github" error=upsert memory_docs: UNIQUE constraint failed: memory_docs.document_id
08:53:50:WRN [composio:periodic] sync failed (will retry next tick) toolkit=github connection_id=ca_HLk7bTXBixH6 error=upsert memory_docs: UNIQUE constraint failed: memory_docs.document_id

09:32:05:WRN (same pattern, connection_id="ca_BRvLIFLFLj4l")

Recurs every sync interval. Two different connection IDs both hit the same failure.

Root cause

The upsert path for memory_docs is not using INSERT OR REPLACE / ON CONFLICT DO UPDATE. When a document with the same document_id already exists (e.g. a GitHub issue that was previously ingested), the insert fails instead of updating.

Impact

  • GitHub memory sync is permanently broken after first ingest — new PRs, issues, and commits are never added to memory.
  • The error is non-fatal and silent to the user; no UI notification is shown.
  • Affects at minimum two separate GitHub connections.

Expected behaviour

Re-syncing an already-ingested document should update it in place (upsert), not fail with a constraint error.

Fix direction

Change the SQL in the memory_docs upsert to:

INSERT INTO memory_docs (...) VALUES (...)
ON CONFLICT(document_id) DO UPDATE SET ...

Environment

  • OpenHuman 0.63.17 (aarch64-apple-darwin)
  • Log date: 2026-09-09
  • Composio GitHub integration active

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugmemoryMemory store, memory tree, recall, summarization, and embeddings in src/openhuman/memory/.priority: p1Next. Wrong behaviour a user will hit, or a security weakness behind a condition.rust-coreCore Rust runtime in src/: CLI, core_server, shared infrastructure.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions