[Bug] CLI: File chunks not replicated to remote - files appear empty (size 0)
Author: lukemcguireCreated Mar 25, 2026Updated Sep 18, 2026
Labelsawaiting confirmation
Bug Description
When using the LiveSync CLI to push files to the local database and then sync to a remote CouchDB, the file metadata is replicated but the content chunks are not. This results in empty files (size 0) on the remote database.
Environment
- LiveSync version: 0.25.54 (CLI built from main branch)
- Node.js: v24.14.0
- OS: Linux (VPS)
- Remote: CouchDB on Synology NAS via nginx reverse proxy
Steps to Reproduce
- Build and run the CLI:
cd src/apps/cli
npm run build
node dist/index.cjs /path/to/local/db --settings /path/to/settings.json push /source/file.md "vault/path/file.md"- Verify file is in local database with content:
node dist/index.cjs /path/to/local/db --settings settings.json info "vault/path/file.md"Output shows: size: 13325, chunks: 12, children: [h:+odnnbu1n8yob, ...]
- Sync to remote:
node dist/index.cjs /path/to/local/db --settings settings.json sync- Check remote via curl:
curl -u user:pass https://couchdb/db/f:hash | jq '{_rev, size}'Output shows: size: 0 (empty file)
- Verify chunks are missing on remote:
curl -u user:pass https://couchdb/db/h:+odnnbu1n8yob
# Returns: {"_id": null, "_rev": null} (not found)Expected Behavior
Both file metadata AND content chunks should be replicated to the remote CouchDB during sync, making the file accessible to other devices.
Actual Behavior
- File document is created on remote with revision bumped (e.g.,
4-5c7a...) - File
sizefield is0on remote - Chunk documents (type
h:+...) are not present on remote - Other devices see the file entry but cannot retrieve content
Additional Context
- Settings used:
readChunksOnline: true,encrypt: true,liveSync: true - The local database correctly stores chunks (verified via
infocommand) - Sync reports
[Done] Command 'sync' completedwith no errors - Obsidian plugin sync works correctly between laptop/mobile and same CouchDB
- This appears to be CLI-specific; the plugin's sync logic properly handles chunks
Related
- Issue #815 - CLI feature request (the CLI exists now, but chunk replication appears broken)
Source: vrtmrz/obsidian-livesync