- Test calibredb list before changing or deleting any library data.
- Fix executable paths, library targets, locks, permissions, and server authentication.
- Use a temporary local library to isolate the real cause safely.
- Confirm the Symptom With a Small Safe Test
- Point calibredb at the Correct Library
- Separate Local Library and Content Server Problems
- Check Database Locks, Permissions, and Cloud Sync
- Diagnose the Specific Add, Remove, or Update Failure
- Use Diagnostic Output Without Guessing
- Run a Clean Temporary Test Before Reinstalling
- Quick Fix Checklist
- Frequently Asked Questions
When the calibre calibredb command is not working, the failure usually falls into one of five categories: your terminal cannot find the executable, the command is opening the wrong library, the library database cannot be read or written, a Content server connection is misconfigured, or the command contains an invalid option or book ID. The safest way to troubleshoot the problem is to begin with a read-only list test, confirm the exact library target, and change only one variable at a time. This guide walks through that process on Windows, macOS, and Linux without risking your main e-book library.

Start with free Canva bundles
Browse the freebies page to claim ready-to-use Canva bundles, then get 25% off your first premium bundle after you sign up.
Free to claim. Canva-ready. Instant access.
1. Confirm the Symptom With a Small Safe Test
Do not begin by reinstalling calibre, restoring the database, or running the failed add or remove operation repeatedly. First determine whether the terminal can start calibredb and whether calibredb can read a library.
1.1 Test whether the command exists
Open Command Prompt, PowerShell, Terminal, or your preferred shell and run:
calibredb --version
If the command prints a version and returns to the prompt, the executable works. Move to the library test. If you receive a message such as “command not found,” “not recognized,” or “no such file,” the immediate problem is the executable path, not your library database.
You can search for the executable with the operating system's command lookup tool:
- Windows Command Prompt:
where.exe calibredb - Windows PowerShell:
Get-Command calibredb - macOS or Linux:
command -v calibredb
On macOS, calibre's command-line programs are normally inside the application bundle. If calibre is installed in the Applications folder, test the full path:
/Applications/calibre.app/Contents/MacOS/calibredb --version
If a full executable path works but the short command does not, you have found the cause. Continue using the full path or add the directory containing calibredb to your shell's PATH. Stop changing calibre library settings because they are not responsible for this symptom.
1.2 Run calibredb list before any modifying command
Once the executable starts, run the smallest useful read-only command:
calibredb list
A successful result displays book IDs, titles, and authors. An empty result can also be technically successful, but it may mean calibredb opened an empty or unintended library.
If list works against the intended library, the installation, executable, basic database access, and library selection are functioning. Stop changing global settings. Troubleshoot only the specific add, remove, set_metadata, or other subcommand that failed.
2. Point calibredb at the Correct Library
By default, calibredb can use the library path stored in calibre's settings. This becomes unreliable when you maintain multiple libraries, use a different operating-system account, run a scheduled task, or launch the command with a separate configuration directory.
2.1 Find the real calibre library folder
Open calibre and use the library menu to view or switch the current library. The correct library folder normally contains metadata.db at its top level, along with author and book folders.
Pass the library folder itself to --with-library or --library-path. Do not pass the path to metadata.db, an individual book folder, or a folder containing several separate libraries.
Windows example:
calibredb list --with-library "C:\Users\Name\Calibre Library"
macOS example:
/Applications/calibre.app/Contents/MacOS/calibredb list --with-library "/Users/name/Calibre Library"
Linux example:
calibredb list --with-library "/home/name/Calibre Library"
Quotation marks are essential when a path contains spaces. Success means the expected books appear with plausible IDs, titles, and authors. Once that happens, keep the same explicit library argument while testing the failed operation.
2.2 Confirm that you are not opening a stale or empty library
If the command succeeds but displays the wrong books, compare the path with the library shown in calibre's graphical interface. External drives can receive a different drive letter on Windows, removable volumes can mount under a different path on macOS or Linux, and scripts can inherit settings from another user account.
Search for metadata.db if you no longer know where the original library is located. Do not select the first copy automatically. Check its parent folder, modification time, expected author folders, and approximate size.
Stop troubleshooting as soon as an explicit calibredb list --with-library command returns the correct collection. At that point, the durable fix is to preserve the explicit path in your script or correct the library selected by the relevant calibre profile.
2.3 Check the order and spelling of options
calibredb uses subcommands such as list, add, remove, search, and set_metadata. Options accepted by one subcommand may not be valid for another.
Display help for the exact operation rather than copying an option from an unrelated calibre tool:
calibredb add --help
calibredb remove --help
calibredb set_metadata --help
If the help command works, compare the failed command character by character. Watch for typographic quotation marks copied from formatted text, missing quotes around paths, incorrect underscores, and book titles used where a numeric book ID is required.
3. Separate Local Library and Content Server Problems
calibredb can work directly with a local library folder or connect to a running calibre Content server. These are different operating modes. A local filesystem path does not require server credentials, while a server URL may require authentication and permission to make changes.
3.1 Test a local library directly
When the library is on the same computer, eliminate the network layer first:
calibredb list --with-library "/absolute/path/to/Calibre Library"
If this works but a server-based command fails, the library database is probably usable. Focus on the server address, library ID, authentication, firewall, or write configuration.
3.2 Use the correct Content server URL
A server target uses a URL with a library ID after the hash character. Quote the entire URL, especially in shells where # begins a comment.
To request the available library IDs from a local server, test:
calibredb list --with-library "http://localhost:8080/#-"
Then use the relevant ID:
calibredb list --with-library "http://localhost:8080/#mylibrary"
Replace the host, port, and library ID with your actual values. Do not assume the display name in the graphical interface is identical to the server's library ID.
Success means the server returns the expected collection. If the server cannot be reached at all, confirm that it is running and that the same address opens from the client computer. A timeout points toward an address, network, firewall, or server availability problem rather than damaged book metadata.
3.3 Distinguish read access from write access
A server connection may allow list while rejecting add, remove, or metadata changes. This is an important diagnostic result: the executable, URL, network, and library selection work, but write authorization does not.
For authenticated servers, supply the configured username and password using the supported command options. Avoid placing a reusable password directly in shell history when a safer input or password-file method is available.
For a Content server running on the same computer, local write access must be deliberately enabled if you are not using authenticated access. Configure this in calibre's Content server settings rather than weakening operating-system protections or exposing an unauthenticated server to the internet.
After changing authentication or local-write settings, rerun list, followed by a harmless test in a temporary library. Stop changing network settings once both reading and the intended write action succeed.

4. Check Database Locks, Permissions, and Cloud Sync
If calibredb list identifies the correct library but reports a locked database, permission denial, read-only filesystem, or input/output error, investigate access to the library folder and its metadata.db file.
4.1 Close competing calibre processes
Close the calibre interface, E-book viewer, editor, Content server, scheduled calibre jobs, and other terminal sessions that may be modifying the same library. Then confirm through Task Manager, Activity Monitor, or your system process viewer that a background calibre process is not still running.
Do not terminate a process while it is actively adding, converting, or writing metadata unless it is clearly frozen and you have allowed reasonable time for completion. An interrupted write can create a more serious problem than the original lock.
Run the explicit list command again after all competing processes have closed. If it succeeds, reopen only the program you need. Avoid running multiple writers against the same library.
4.2 Verify folder and file permissions
The account running calibredb needs access to the library folder. Commands that change the library also need permission to create, rename, update, and delete files inside it.
- On Windows, check the folder's Security properties and whether ransomware protection or antivirus software blocked the executable.
- On macOS, check Privacy and Security permissions if the library is in a protected folder or removable volume.
- On Linux, inspect the library's owner and permissions. Avoid solving the problem by running calibre permanently as root because that can leave files inaccessible to your normal account.
A practical test is to create and delete a plain text file in the library folder while signed in as the same account that runs the command. Do not alter metadata.db manually.
Success means calibredb list works and a temporary-library write test completes without access errors. Stop changing permissions once the specific account has the minimum required access.
4.3 Pause cloud synchronization during diagnosis
OneDrive, Dropbox, iCloud Drive, Syncthing, backup software, and similar tools can scan or synchronize metadata.db while calibre is writing it. They can also create conflicts when two computers open synchronized copies of the same live library.
Pause synchronization, wait for current file activity to finish, close calibre on every other computer, and retry the command. If the problem disappears, move the active library to a normal local folder and use a controlled backup or synchronization workflow when calibre is closed.
Never resolve a conflict by deleting whichever metadata.db copy appears older without first backing up the entire library. The database and book folders must remain a consistent set.
4.4 Avoid active libraries on NAS and unreliable network filesystems
A mapped network drive may look like a local disk while handling locks, renames, or temporary files differently. This can produce intermittent failures that disappear when the same command is run locally.
Copy the entire library to a temporary folder on an internal local disk, ensure no other calibre instance uses it, and run calibredb list against the copy. If the local copy works consistently, the storage layer is the likely cause. Keep the active database local and use the Content server for network access instead of opening one library directly from several computers.
5. Diagnose the Specific Add, Remove, or Update Failure
5.1 If calibredb add fails
Confirm the source file exists, is readable, and is not merely an online placeholder. Use an absolute source path and quote it:
calibredb add --with-library "/path/to/Test Library" "/path/to/book.epub"
Test with one ordinary, known-good EPUB or PDF rather than a large folder. If one file succeeds, the original batch may contain an inaccessible path, unsupported item, duplicate, damaged file, or filename interpreted incorrectly by the shell.
Adding a book does not require you to bypass DRM or retailer restrictions. If a protected file cannot be processed normally, obtain a compatible copy through the retailer or publisher's supported method.
5.2 If calibredb remove fails
remove expects calibre book IDs, not titles, filenames, ISBNs, or positions in the graphical book list. Find the correct ID first:
calibredb list --with-library "/path/to/library" --search "title:Example"
Before deleting anything, verify a candidate record:
calibredb show_metadata --with-library "/path/to/library" 123
Only after confirming the title, author, and formats should you run the removal command with that ID. Success means a subsequent list or search no longer returns the record. Stop immediately if the ID resolves to a different book.
5.3 If metadata updates fail
First verify that the book ID exists with show_metadata. Then display help for the update command and confirm that the field name and value format are valid.
Remember that updating calibre's database metadata and embedding metadata inside an e-book file are separate operations. A successful database update can appear in calibre even if a particular file format cannot store every metadata field internally.
Test one field on one record in a temporary library. If that succeeds, compare the working syntax with the original command before applying a batch update.
6. Use Diagnostic Output Without Guessing
The terminal's complete error message is the first and most relevant log for a calibredb problem. Preserve the command, output, operating system, library target, and whether the target is local or server-based.
6.1 Inspect paths and the active environment
Run:
calibre-debug --paths
This can help identify the calibre installation and configuration environment being used. It is especially useful when the graphical interface and terminal appear to remember different libraries or when more than one calibre installation exists.
Also rerun the failed command from an interactive terminal instead of hiding its output in a scheduled task. If the interactive command works, inspect the task's user account, PATH, working directory, environment variables, and access to mounted drives.
6.2 Check library structure
After making a full backup, you can ask calibredb to report discrepancies between the database and library filesystem:
calibredb check_library --with-library "/path/to/library"
This can report missing formats, extra files, missing covers, malformed paths, and related inconsistencies. A report is not permission to delete every listed file automatically. Review the findings and preserve a backup before making corrections.
6.3 Use a temporary configuration profile when settings appear inconsistent
The CALIBRE_CONFIG_DIRECTORY environment variable can direct calibre tools to a separate configuration folder. This is useful for identifying a damaged or unexpected profile, but it should be treated as a diagnostic test rather than the first fix.
Create an empty temporary configuration directory, set the variable only in the current terminal session, and use an explicit temporary library path. If the command works there, your normal executable is probably sound. Compare profiles and environment variables instead of deleting your established settings.
Device detection, conversion output, viewer behavior, plugins, and editor logs are usually unrelated to a basic calibredb list failure. Investigate them only when the failing workflow explicitly invokes those components. For example, use device detection diagnostics for a device connection problem, not for a local database path error.
7. Run a Clean Temporary Test Before Reinstalling
A temporary local library separates program problems from problems in your main database, storage location, or automation script.
- Create an empty folder on a local internal drive, such as
CalibreTestLibrary. - Choose one small, unprotected EPUB or PDF that opens normally.
- Run
calibredb listwith the temporary folder as the explicit library target. - Add the test book using its absolute path.
- Run
listagain and confirm that the new record appears. - Use
show_metadatato verify its ID and metadata. - Remove the test record only after confirming the ID.
If all steps work, reinstalling calibre is unlikely to fix the main problem. The cause is probably the original library path, permissions, storage system, database state, server configuration, or script syntax.
If the temporary test fails even with full executable paths and a local writable folder, record the complete error. At that point, reinstalling the official calibre build may be reasonable, especially if executable files are missing or multiple installations are conflicting. Reinstallation should not require deleting your library. Back up the complete library before any major change.
Do not run database restoration simply because one command failed. Restoration regenerates the database and can discard certain database-only information. Reserve it for confirmed database corruption after backing up the entire library and reviewing safer tests.
8. Quick Fix Checklist
- Run
calibredb --versionto confirm that the executable starts. - Use
where.exe,Get-Command, orcommand -vto locate the command. - On macOS, test the executable inside
/Applications/calibre.app/Contents/MacOS/. - Run
calibredb listbefore attempting a write operation. - Pass an explicit, quoted library folder with
--with-library. - Confirm that the target folder contains the intended
metadata.db. - Close other calibre processes before investigating a database lock.
- Pause cloud synchronization and test from a local internal drive.
- For server mode, quote the complete URL and verify the library ID.
- If listing works but writing fails, check authentication and server write permission.
- Use numeric book IDs for remove and metadata commands.
- Test one known-good file before retrying a large add operation.
- Run a clean temporary-library test before reinstalling or restoring the database.
9. Frequently Asked Questions
9.1 Why does calibre work in the graphical interface but calibredb is not found?
The graphical application can start from its installed location even when that directory is absent from your terminal's PATH. Find calibredb with the operating system's lookup command or run it using its full path. If the full path works, the database does not need repair.
9.2 Why does calibredb list show no books?
The command may be opening a different or newly created library. Pass the intended library folder explicitly and verify that it contains the correct metadata.db. An empty result without an error is often a library-selection problem rather than a broken command.
9.3 Can I run calibredb while the calibre interface is open?
Read operations may work, but concurrent write operations can cause locking or consistency problems, particularly when synchronization software or network storage is involved. For troubleshooting, close the interface and other calibre processes, then test the command alone.
9.4 Why can calibredb list a server library but not add or remove books?
Reading and writing require different permissions. A successful list confirms the server address, network route, and library ID. Check server authentication and write authorization rather than reinstalling calibre or changing the local library path.
9.5 Should I delete metadata.db when calibredb reports an error?
No. Deleting metadata.db can turn a limited command problem into a full database recovery task. Back up the complete library, test the path and permissions, close competing programs, and run a temporary-library test first.
9.6 When should I stop troubleshooting?
Stop changing settings as soon as calibredb list shows the intended books and the original operation succeeds in a controlled test. Preserve the working executable path, library argument, credentials method, and command syntax. Additional changes after success can introduce a new calibre issue unrelated to the original failure.