-
Notifications
You must be signed in to change notification settings - Fork 1k
SQLITE_CANTOPEN: unable to open database file #304
Comments
@colinmcparland how did you resolve the issue edit: fixed - my issue was that i used |
meet the same issue, any one can help? |
had this for months, any solution? |
I'm also having this same issue. Is there a reason why it's closed? Tried with and without path.resolve() (and path.normalize() etc.)... all get same same issue: I've set READONLY on the db, since I'm pretty sure it won't be writable since code isn't in /tmp and underlying Lambda isn't writable. Could very will be missing something, but tried a bunch. |
check your (resolved) path (ex. log it) |
I had this issue also and resolved it by creating directory "database" in my project directory. |
var db = new sqlite3.Database( path.resolve(__dirname, 'db.sqlite') ); |
Hi folks! I'm also facing the same issue. Some times it works fine with my current configuration. module.exports = { development: { This is my connection file: const knex = require('knex'); The only way I found to solve the this issue is to delete the src/database/db.sqlite and create the db.sqlite again in the same path |
Hi folks! Thankfully after a tone of research I found the issue. To solve we have to use the absolute path on the database path like the following script: development: { |
Thanks! was having the same problem. @sousadgaspar |
Cara muito obrigado @sousadgaspar |
filename: 'dir_name/db.sqlite', |
Maybe this means nothing, I don't know I'm a beginner at node. I ran a tutorial on http://localhost:3000/ which worked fine. Some while later tried to Reopening the tutorial worked. The page says Node is running in WSL on Windows 11; the machine has been rebooted a dozen times in the interim. I can now run both servers in different browser tabs, so it doen't really add up but I'll leave this here just in case it helps someone. |
Work for me |
how to resolve the error |
I had the same issue. In my case i just needed to clean my database file because i already had a "database.sqlite" named folder. This error is related to problems on the folder structure / path |
For anyone having this issue, my problem was that i had in .env a variable called DATABASE_URL="./pathtodbfile" Just changing double quotes for single quotes done the work. DATABASE_URL="./pathtodbfile" >>> DATABASE_URL='./pathtodbfile' |
i was encountering the same issue .i created separate directory daatabase and removed sqlite.READ WRITE command.Modified code |
Node v8.3.0
NPM v5.3.0
[email protected]
package.json:
Im using sqlite3 package for node, trying to access my db file:
I know the file is there as it can be reached by fs, here is the output from console.logs:
And the sqlite3 error:
Error: SQLITE_CANTOPEN: unable to open database file
The text was updated successfully, but these errors were encountered: