SQLITE_BUSY: database is locked
FireMasterK opened this issue · 5 comments
Some weird database issues..
Error: SQLITE_BUSY: database is locked
--> in Statement#run({ '$id': 42368, '$reprocessTime': null }, [Function (anonymous)])
at Database.<anonymous> (/app/node_modules/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/sqlite3.js:76:19)
at Database.<anonymous> (/app/node_modules/.pnpm/sqlite3@5.1.6/node_modules/sqlite3/lib/sqlite3.js:20:19)
at <anonymous> (/app/node_modules/.pnpm/github.com+SleeplessOne1917+lemmy-bot@6ed4abbf3e6c343e60ecffa94059b51eae8afbb5_i365mkdgu5davuyz74udnrlrka/node_modules/lemmy-bot/dist/db.js:57:8)
at new Promise (<anonymous>)
at upsert (/app/node_modules/.pnpm/github.com+SleeplessOne1917+lemmy-bot@6ed4abbf3e6c343e60ecffa94059b51eae8afbb5_i365mkdgu5davuyz74udnrlrka/node_modules/lemmy-bot/dist/db.js:56:58)
at <anonymous> (/app/node_modules/.pnpm/github.com+SleeplessOne1917+lemmy-bot@6ed4abbf3e6c343e60ecffa94059b51eae8afbb5_i365mkdgu5davuyz74udnrlrka/node_modules/lemmy-bot/dist/db.js:75:114)
at Generator.next (<anonymous>)
at <anonymous> (/app/node_modules/.pnpm/github.com+SleeplessOne1917+lemmy-bot@6ed4abbf3e6c343e60ecffa94059b51eae8afbb5_i365mkdgu5davuyz74udnrlrka/node_modules/lemmy-bot/dist/db.js:8:71) {
errno: 5,
code: 'SQLITE_BUSY',
__augmented: true
}
I would suggest that you just ignore it and either run it in pm2 or just catch it with
process.on("uncaughtException", (error) => {
console.log("uncaught error:");
console.log(error);
});
Could you give some information on your setup? I have a couple of bots running in production and have never encountered this issue.
I have been running it with docker:
https://github.com/TeamPiped/lemmy-piped-link-bot/blob/main/docker-compose.yml
https://github.com/TeamPiped/lemmy-piped-link-bot/blob/main/Dockerfile
I'll try running one of my bots in a docker container. I've used systemd processes for production, so that may be why I haven't experienced issues.
@FireMasterK This issue is from several versions ago. Are you still getting this issue?