HalosGhost / pandabin

A self-hostable, simple and fast pastebin written in C
GNU General Public License v3.0
3 stars 0 forks source link

failed to open database #22

Closed buhman closed 5 years ago

buhman commented 6 years ago

Unlike a remote database, something that uses sqlite should JustWork™. Instead:

Aug 08 23:36:50 balin pandabin[20028]: Started
Aug 08 23:36:50 balin pandabin[20028]: Failed to open database: unable to open database file
Aug 08 23:36:50 balin pandabin[20028]: Ended

This error message could be more clear if the path to the database is also shown--this makes sense for this error because it is directly caused by the return value of sqlite3_open.

strace reveals the actual problem:

open("/home/halosghost/pandabin/db.sqlite", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
HalosGhost commented 6 years ago

Indeed, I managed to fail and put my own homedir in the code. That will be fixed tomorrow. Thank you for the report!