db-sync server: CLI bulk upserts fail against E2EE graphs (tx-rejected invalid data)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
Direzione di ricerca
Start by tracing the logseq-cli upsert commands and the sync worker path that queues and sends transactions; the issue does not name source files or tests. Check how graph E2EE metadata and password handling are currently read, then reproduce the rejected transaction with an E2EE graph. Done means the CLI encrypts writes correctly or fails locally before queuing plaintext transactions when no password is available.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug: logseq-cli fails to encrypt payloads for E2EE graphs, resulting in silent local success and remote tx-rejected
Environment
- OS: macOS (darwin arm64) and NixOS
- Logseq Version: 2.0.2 Beta (Revision:
533ac4382a7b69baa98de3a973bff90305b212dc) - CLI Execution: Wrapped via
ELECTRON_RUN_AS_NODE=1 node dist/logseq.js
Description
When running logseq-cli commands (upsert page, upsert block) against an End-to-End Encrypted (E2EE) graph, the CLI successfully writes to the local transaction queue but fails to encrypt the payload. The sync worker pushes raw plaintext datoms to the sync server, which immediately rejects them with DB write failed with invalid data.
Because the CLI runs under a raw Node environment (ELECTRON_RUN_AS_NODE=1), it bypasses the Electron renderer and does not have access to the safeStorage native API to decrypt the Logseq E2EE macOS keychain blob (["~btn5rO..."]).
Steps to Reproduce
- Enable E2EE on a graph in Logseq Desktop (e.g.,
<my-graph>). - Start the CLI sync worker:
logseq sync start --graph <my-graph> --output json - Execute a write operation:
logseq upsert page --graph <my-graph> --page "New Page Test" --output json - The CLI returns success:
{"status":"ok","data":{"result":[32982]}} - Check sync status:
logseq sync status --graph <my-graph> --output json
Actual Behavior
The sync status reports a fatal tx-rejected error. The error-detail reveals the server rejected the transaction because the :tx-data contains raw plaintext datoms instead of the expected encrypted ciphertext blob.
{
"code": "tx-rejected",
"message": "tx-rejected",
"data": {
"type": "db-sync/tx-rejected",
"repo": "logseq_db_<my-graph>",
"message-type": "tx/reject",
"reason": "db transact failed",
"error-detail": "#error {:message \"tx entry apply failed\", :cause #error {:message \"DB write failed with invalid data\", :data {:tx-meta {:op :apply-client-tx, :client-revision \"533ac43\", :outliner-op :create-page}, :tx-data ([:db/add \"6af5d87a-eba3...\" :block/uuid #uuid \"6af5d87a-eba3...\"] ...) } }}"
}
}
Expected Behavior
- The CLI should recognize the graph is E2EE (
metadata.jsonorconfig.json). - It should either:
- Extract the master key and decrypt the E2EE password (currently impossible via
ELECTRON_RUN_AS_NODE). - Allow passing the raw unencrypted password securely via a CLI flag or environment variable (e.g.,
LOGSEQ_E2EE_PASSWORD) duringupsert. - Hard-fail the
upsertcommand immediately locally if the graph is E2EE and no password is provided, rather than returningstatus: okand corrupting the sync queue with rejected plaintext transactions.
- Extract the master key and decrypt the E2EE password (currently impossible via
Impact
CLI-driven bulk imports, programmatic upserts, and background agents are completely blocked from writing to E2EE graphs. The local DB worker gets wedged trying to push the invalid transaction, requiring manual local transaction rollback or worker restarts.
- Lingua principale
- Nessun dato sulla lingua
- Stelle
- 29
- Fork
- 2
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di logseq/db-test
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Potential Dataloss: Deleting an entry from the property page's node table has no confirmation dialogForse già presa @tiensonqin l’ha presa 59 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Disabling Flashcards in Settings does not disable Flashcard shortcuts or tagsForse già presa @tiensonqin l’ha presa 60 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Tutte le issue di logseq/db-test
Issue simili
-
area:core area:install area:sandbox area:state area:tui os:windows
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
diivi/aseprite-mcp#43 ·
-
ai-driven-qa bug Critical
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
area: agents
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
manaflow-ai/cmux#50925 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
georgestephanis/diff-leppard#46 ·
I maintainer di solito rispondono entro 1 giorno