Database Error
Sometimes, you may see the following error message:

This indicates that a database error has occurred, and it is recommended to handle it immediately.
What happened?
Section titled “What happened?”WonderPen’s library content is stored in a SQLite database. Generally speaking, SQLite is very reliable, but if multiple programs read and write to it, there is a certain probability of errors. For example, if you put a local library into a third-party cloud drive, and the third-party cloud drive has a conflict during synchronization, it may corrupt the database file.
Don’t panic when encountering this problem. WonderPen has built-in automatic data backup enabled by default. Database corruption will not affect existing backup files, and you can restore data from backups at any time.
How to handle it?
Section titled “How to handle it?”There are usually three ways to handle database errors.
1️⃣ Exit and restart WonderPen
Section titled “1️⃣ Exit and restart WonderPen”Sometimes, this error is temporary, and exiting and restarting WonderPen can restore normal operation.
If the error still appears after restarting, please continue with the methods below.
2️⃣ Restore from backup
Section titled “2️⃣ Restore from backup”In most cases, you can try to restore from backup, which may fix the database.

As shown in the figure above, open the backup and restore panel, and click the restore button on the right side of the latest backup to restore the data.
If no error message appears after restoring the data, it means the database has returned to normal.
If you still see error messages, please try the method below.
3️⃣ Delete the local database file, then restore from backup
Section titled “3️⃣ Delete the local database file, then restore from backup”If direct restoration cannot fix the database, you need to first delete the local database file (or, more safely: rename it or move it to another location), and then try to restore from backup.
The specific steps are as follows:
-
Exit WonderPen
To delete the current library database, you need to exit WonderPen first, otherwise the database file may still be in use and deletion may fail.
-
Open the library folder
Open the folder where the current library is located. Library folders generally end with
.wplibrary. -
Delete (or rename, move) the database file
In the library folder (
.wplibraryfolder), you should be able to see adata.dbfile. The directory structure is similar to the following:My Library.wplibrary/ ├── assets/ ├── backup/ ├── db/ ├── data.db <-- Focus on this file └── ...Note that there may be other files in your library directory, but you don’t need to pay attention to other files, just focus on that
data.dbfile.If your system hides file extensions, you may only see a file named
data.Next, you can delete this
data.dbfile. Of course, to be safe, you can also rename this file or move it to another location so that you can restore it if needed.If you see other files starting with
datain this directory, such asdata.db-shm,data.db-wal, you can delete (or rename, move) them together. -
Open WonderPen and restore from backup again
Then, please reopen WonderPen and open this library. At this time, the library should appear empty.
Finally, please restore from backup again, and the library should return to normal.
Still having problems?
Section titled “Still having problems?”If you still encounter problems, please contact us via Email or other methods.
More information
Section titled “More information”Some common error codes:
| code | Meaning | Common scenarios |
|---|---|---|
SQLITE_INTERNAL | Internal logic error | SQLite internal bug (very rare) |
SQLITE_PERM | Permission error | Unable to write to database file |
SQLITE_ABORT | Operation aborted | Transaction manually aborted |
SQLITE_BUSY | Database locked | Multiple processes writing to database simultaneously |
SQLITE_LOCKED | Database file lock conflict | Lock contention within the same connection |
SQLITE_NOMEM | Out of memory | Insufficient system resources |
SQLITE_READONLY | Read-only database | Database opened in read-only mode |
SQLITE_IOERR | I/O error | Disk read/write error |
SQLITE_CORRUPT | Database corrupted | File corruption, “database disk image is malformed” |
SQLITE_NOTFOUND | File not found | Database or index missing |
SQLITE_FULL | Disk full | Write failed |
SQLITE_CANTOPEN | Unable to open database | File path error or insufficient permissions |
SQLITE_EMPTY | Database empty | Reading empty file |
SQLITE_TOOBIG | Data too large | Inserting very long string or blob |
SQLITE_NOLFS | Large file not supported | Rare case |
SQLITE_FORMAT | File format error | SQLite version incompatibility |
SQLITE_NOTADB | Not a SQLite file | The opened file is not a database |