SleeplessOne1917 / lemmy-bot

A bot library for Lemmy, the fediverse link aggregator.
https://www.npmjs.com/package/lemmy-bot
GNU Affero General Public License v3.0
88 stars 10 forks source link

SQLITE_BUSY: database is locked #42

Open FireMasterK opened 12 months ago

FireMasterK commented 12 months ago

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
}
Pdzly commented 12 months ago

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); });

SleeplessOne1917 commented 12 months ago

Could you give some information on your setup? I have a couple of bots running in production and have never encountered this issue.

FireMasterK commented 12 months ago

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

SleeplessOne1917 commented 12 months ago

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.

SleeplessOne1917 commented 4 months ago

@FireMasterK This issue is from several versions ago. Are you still getting this issue?