Skip to content

Fix the problems that come up most

Most problems show up in litebackup status with a code that says what to change, and this list explains each one.

Status codes and what to do

  • busy

    Another machine backs up that name. Route the database's writes to one machine, or give separate databases separate names or prefixes. Choosing a new name only to avoid the error leaves two copies that drift apart.

  • lock_unavailable when acquiring

    Another machine holds the database for a job. Retry later with backoff and the same name, and let your scheduler run one job at a time for each database.

  • not_found

    No version exists under that name. Check the exact name and prefix in litebackup status or the console, and for a new database leave an empty file at the path before you acquire it, which a lease does for you.

  • still_open on release

    A process still has the file open. Close every SQLite connection, including those in other processes, then release again.

  • file_exists on restore

    A restore never replaces a file. Choose a new file name in a directory that already exists.

  • rule_exists when starting a backup

    The path already has a backup rule with other settings, and the error carries that rule. Stop it with litebackup stop --rule ID, then start it again with the new settings.

  • not_configured

    Setup is not finished yet. Open the console, connect a bucket, save the recovery kit or set a passphrase, and choose retention. Waiting machines then continue on their own.

  • sdk_unsupported

    The client needs a newer SDK. Update your server first, then the litebackup command on each machine, and keep the npm package on the same version.

  • daemon_unsupported

    The SDK needs a newer litebackup client than the one running. Update the litebackup command, run litebackup drain once, and the next call starts the new client.

Fix replica, bucket, and setup problems

These problems come from a replica, archiving to a bucket, or how a machine was set up, and each answer says what to change.

  • SQLITE_BUSY when writing a replica

    Replicas are readonly, and the client holds their write lock on purpose. Open them readonly in your app and send writes to the machine that backs up the database.

  • A database shows conflicted

    A local copy diverged from your server, and Litebackup left it exactly as it is rather than discarding it. Restore the current database to another path to compare the two, then keep what your app needs. litebackup acquire --discard-local replaces the copy with the current database.

  • Waiting for the bucket times out

    Waits for the bucket include the archive delay, 15 minutes by default, so allow for it in deadlines. If waits still time out, check the bucket and free disk space in the console, and the last error that litebackup status shows for the database.

  • The client joined another server

    A client keeps the key it saved until LITEBACKUP_API_KEY holds a different credential, and a running client keeps it until it restarts. While the client holds write locks, a different credential is refused with drain_required, so run litebackup drain first and then change the key. To keep both servers, use a separate session with LITEBACKUP_SESSION.

  • No litebackup binary

    The npm package brings the binary through optional dependencies, so keep them enabled when you install. A Go app needs the litebackup command installed, or LITEBACKUP_PATH set to it.

Check the client and read its log

Run these as the user and session your app uses, because another user talks to a different client.

# Check the client's databases, backup rules, replicas, and logs.
# Runs on Linux and macOS.
# Run these as the same user, and in the same session, as your app.
litebackup status            # roles, states, versions, and each database's last error
litebackup rules             # what this machine backs up
litebackup replicate list    # replicas and prefix rules

if [[ "$(uname -s)" == Darwin ]]; then
    tail -f "${HOME}/.local/state/litebackup/default/daemon.log"
else
    journalctl --user --unit litebackup --follow
fi

# On a Linux server with a system service, use sudo journalctl --unit litebackup --follow.

Report a problem

When you report a problem, include the SDK and client versions, the operating system and architecture, whether the client runs as a service, the call or command, and the error code. Leave out join tokens, bucket credentials, recovery material, and the contents of your databases.