question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sqlite3 happen 'unable to open database file' error sometimes

See original GitHub issue

error log

{ [SequelizeDatabaseError: SQLITE_CANTOPEN: unable to open database file]
  name: 'SequelizeDatabaseError',
  message: 'SQLITE_CANTOPEN: unable to open database file',
  parent: 
   { [Error: SQLITE_CANTOPEN: unable to open database file]
     errno: 14,
     code: 'SQLITE_CANTOPEN',
     sql: 'SELECT `id`, `name`, `owner`, `templateConfig`, `des`, `time`, `status`, `createdAt`, `updatedAt` FROM `Pages` AS `Page` ORDER BY time DESC LIMIT 20;' },
  original: 
   { [Error: SQLITE_CANTOPEN: unable to open database file]
     errno: 14,
     code: 'SQLITE_CANTOPEN',
     sql: 'SELECT `id`, `name`, `owner`, `templateConfig`, `des`, `time`, `status`, `createdAt`, `updatedAt` FROM `Pages` AS `Page` ORDER BY time DESC LIMIT 20;' },
  sql: 'SELECT `id`, `name`, `owner`, `templateConfig`, `des`, `time`, `status`, `createdAt`, `updatedAt` FROM `Pages` AS `Page` ORDER BY time DESC LIMIT 20;' }
SequelizeDatabaseError: SQLITE_CANTOPEN: unable to open database file
    at module.exports.Query.formatError (/root/fed/quick/trunk/node_modules/sequelize/lib/dialects/sqlite/query.js:245:16)
    at Statement.<anonymous> (/root/fed/quick/trunk/node_modules/sequelize/lib/dialects/sqlite/query.js:53:31)
    at Statement.replacement (/root/fed/quick/trunk/node_modules/sqlite3/lib/trace.js:20:31)
    at Statement.replacement (/root/fed/quick/trunk/node_modules/sqlite3/lib/trace.js:20:31)

this is happend sometimes,i can not find why?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dozieogbocommented, Nov 7, 2019

So. I realized this can happen when the parent folder doesn’t exist, in this case ./db. Create the folder and it works fine.

0reactions
SebastianGuerreroCardenascommented, Apr 24, 2017

Currently having an issue similar to this. I think it is something to do with permissions but I dont know how to fix it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get sqlite error, "unable to open database file"?
The solution is to make sure the directory containing the database file also has write access allowed to the process. In my case,...
Read more >
Error: stepping, unable to open database file (14) - SQLite Forum
I'm getting this error when doing SELECT on some views of a database that was working for years until a little after the...
Read more >
sqlite3.OperationalError: unable to open database file
PROBLEM You're using SQLite3, your DATABASE_NAME is set to the database file's full path, the database file is writeable by Apache, but you ......
Read more >
What should I do when SQLite is unable to open a database ...
Ownership and permissions on the database file. This should be obvious: If your server-side code runs as, say, user www , and that...
Read more >
Failed to open database file error - Audacity Forum
(14) SQLITE_CANTOPEN result code indicates that SQLite was unable to open a file. The error codes can sometimes refer to logic errors and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found