Database Error on Launch or During Use¶
Portfolio Manager fails to start or displays an error message related to the database. Most database errors are caused by a locked file, a missing directory, or a failed schema migration.
One or more of the following symptoms occur:
- A dialog shows "Database error" on launch.
- The application starts but projects, sessions, or milestones do not display.
- The log file contains
sqlite3.OperationalErrorentries. - The application crashes when creating or saving data.
The database directory does not exist or is not writable.
-
Verify that
~/.portfolio_manager/exists and is writable:ls -la ~/.portfolio_manager/ -
If the directory does not exist, create it:
mkdir -p ~/.portfolio_manager -
Relaunch Portfolio Manager. It will recreate the database automatically.
A failed schema migration corrupted the database.
-
Check whether a backup exists:
ls ~/.portfolio_manager/*.bak -
If a backup file exists, restore it:
cp ~/.portfolio_manager/portfolio.db.bak ~/.portfolio_manager/portfolio.db -
Relaunch Portfolio Manager.
The migration runs again. If it fails a second time, check the log file for the specific error and report it to the project repository.
The database file is locked by another process.
-
Check whether another Portfolio Manager instance is already running and close it.
-
If no other instance is running, verify no orphan process holds the database lock:
lsof ~/.portfolio_manager/portfolio.db -
Terminate any process listed, then relaunch Portfolio Manager.