Skip to content

Troubleshooting

Run graft init in the app data directory first:

Terminal window
graft init
graft sql --db data.sqlite "SELECT 1;"

graft sql requires an explicit --db path and an existing .graft/ repository.

Make sure the database contains a committed transaction, then stage the physical path.

Terminal window
graft sql --db data.sqlite "INSERT INTO notes(body) VALUES ('hello');"
graft status

Any normal SQLite client can edit the file:

Terminal window
sqlite3 data.sqlite "INSERT INTO notes(body) VALUES ('from sqlite3');"
graft add data.sqlite

graft add reads a consistent SQLite backup and includes committed WAL frames, so a manual checkpoint is not required. An uncommitted transaction is not part of the staged state.

Checkout or switch reports that SQLite is busy

Section titled “Checkout or switch reports that SQLite is busy”

Close writers and long-lived read transactions for database paths that the operation needs to replace. Graft refuses to rename a new snapshot over a live writer and will not delete WAL or shared-memory sidecars that are still in use.

A file is stored externally when you expected inline

Section titled “A file is stored externally when you expected inline”

Binary files always use external payload storage. Text files use external storage when they exceed files.inline_text_threshold or match files.external_paths.

Terminal window
graft config get files.inline_text_threshold
graft config get files.external_paths

Check and hydrate external payloads:

Terminal window
graft payload status HEAD
graft payload fetch --remote origin HEAD

For a broader repair:

Terminal window
graft audit --repair origin

Inspect conflicts:

Terminal window
graft status
graft conflicts --json

Resolve each conflict:

Terminal window
graft resolve --ours data.sqlite
graft resolve --theirs attachments/report.pdf
graft merge --continue -m "resolve merge"

Abort if you want to return to the pre-merge state:

Terminal window
graft merge --abort

Credentials do not belong in the remote URI. Configure them in the environment or standard AWS config files:

Terminal window
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="auto"

For Cloudflare R2 and MinIO, include the endpoint in the URI:

Terminal window
graft remote add origin 's3_compatible://bucket/prefix?endpoint=https://account.r2.cloudflarestorage.com'

Set the token environment variable expected by the remote URL:

Terminal window
export GRAFT_REMOTE_TOKEN='grt_...'

If the URL uses token_env, set that variable instead:

Terminal window
export GRAFT_ARCHIVE_TOKEN='grt_...'

Then retry:

Terminal window
graft ls-remote origin

Row diff is only available for supported SQLite snapshots and surfaces. Added or deleted database files, missing snapshots, unsupported tables, or internal SQLite surfaces can limit row-level output.

Use the repository path diff as the source of truth and show row-level details when row_diff_available is true.