#unable to open database file

6 messages · Page 1 of 1 (latest)

ornate prawn
#

This happens when sqlite can't open the database file. Could be a permission problem (often linux), maybe there is a folder or a file already with the same name which isn't a sqlite database. Or lastly your database is corrupted

#

I would need to see what you changed. You only show the error but nothing code related

ornate prawn
#

I don't see any problems in the code. It probably was a bug with the database file which may have corrected itself.

Just saying though, most of your conditions using quick.db are wrong.

For example this condition

db.get(`owner_${client.user.id}_${message.author.id}`) === true

will also be false if you are using the 9.x.x version of quick.db.

Since get will return a promise. Promise is not strictly equal to true even if the resolve data of the promise is true. You should await it. There are other conditions in the code you shared that has the same problem

#

If you are talking of the SQLITE_CANTOPEN error. Unfortunately no, quick.db is using better-sqlite3 to use sqlite. So either it's a better-sqlite3 bug or a sqlite bug/problem itself. Which means there isn't much I can do/help with if the problems comes directly from these (that errror seems to come from sqlite directly). All I can do is tell you the reasons of how this error happens but that is basically all I can do

#

What causes the issue?

#

Ah, yes, the famous space in folders. That is unfortunately a sqlite/better-sqlite3 problem so I cannot do anything to fix it.
I must say though, spaces in folder or filenames should always be avoided since some programs/software got bugs like that. Thanks for letting me know that was one of the cause for this issue