db-sync server: CLI bulk upserts fail against E2EE graphs (tx-rejected invalid data)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 29
- Forks
- 2
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de logseq/db-test
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Potential Dataloss: Deleting an entry from the property page's node table has no confirmation dialogPosiblemente ocupada @tiensonqin la tomó hace 59 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Disabling Flashcards in Settings does not disable Flashcard shortcuts or tagsPosiblemente ocupada @tiensonqin la tomó hace 60 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Todos los issues de logseq/db-test
Issues similares
-
area:core area:install area:sandbox area:state area:tui os:windows
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
diivi/aseprite-mcp#43 ·
-
ai-driven-qa bug Critical
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
area: agents
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
manaflow-ai/cmux#50925 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
georgestephanis/diff-leppard#46 ·
Los mantenedores suelen responder en 1 día