I recently discovered that my database.sqlite file was something like 24GB large and so I looked up information to find that I had to set the environment variable
DB_SQLITE_VACUUM_ON_STARTUP to true. So I did so and unfortunately I got this error:
n8n | n8n ready on 0.0.0.0, port 5678 n8n | Version: 0.112.0 n8n | (node:7) UnhandledPromiseRejectionWarning: QueryFailedError: SQLITE_FULL: database or disk is full n8n | at new QueryFailedError (/usr/local/lib/node_modules/n8n/node_modules/typeorm/error/QueryFailedError.js:11:28) n8n | at Statement.handler (/usr/local/lib/node_modules/n8n/node_modules/typeorm/driver/sqlite/SqliteQueryRunner.js:76:38) n8n | at Statement.replacement (/usr/local/lib/node_modules/n8n/node_modules/sqlite3/lib/trace.js:25:27) n8n | (Use `node --trace-warnings ...` to show where the warning was created) n8n | (node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) n8n | (node:7) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
So I resolved this by temporarily resizing the volume space allocated to the VPS I am using. The error disappeared, but the filesize didn’t change after a long start up period which I assume is due to VACUUM. If this is important, I am using docker and starting it up with docker-compose.
I’m wondering what exactly I’m doing wrong, and if there’s some manual way of removing the logs which have caused the database to balloon to this size. I’ve tried deleting workflows I no longer use and disabling successful executions being saved (some of them were cron jobs that ran every 1 or 5 minutes), but this appears to have no effect. I’m not exactly an expert on sqlite either but should be able to run a few basic commands given any hints for me to figure this out.