Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: SQLITE_CANTOPEN: unable to open database file #45

Closed
martinbehrens opened this issue Jul 10, 2018 · 2 comments
Closed

Error: SQLITE_CANTOPEN: unable to open database file #45

martinbehrens opened this issue Jul 10, 2018 · 2 comments

Comments

@martinbehrens
Copy link

Running the following versions on a Centos 7.5.1804 box:

node v6.14.3
charged 0.4.0

Trying to start charged with either ...

charged -t NstxQtqsWHubkdbimZ -l /home/username/.lightning -d /home/username/.charged -w 90 -p 9112 -i xxx.xxx.xxx.xxx
charged -t NstxQtqsWHubkdbimZ -l /home/username/.lightning/ -d /home/username/.charged/ -w 90 -p 9112 -i xxx.xxx.xxx.xxx
charged -t 1127589647 -l /home/username/.lightning -d /home/username/.charged -w 90 -p 9112 -i xxx.xxx.xxx.xxx
charged -t 1127589647 -l /home/username/.lightning -d /home/username/.charged/ -w 90 -p 9112 -i xxx.xxx.xxx.xxx
charged -t 1127589647 -l /home/username/.lightning -d /home/username/.charged -w 90 -p 9112 -i 0.0.0.0

... results in the following error being thrown:

Error: SQLITE_CANTOPEN: unable to open database file
    at Error (native)
/usr/lib/node_modules/lightning-charge/dist/app.js:21
            throw err;
            ^

Error: SQLITE_CANTOPEN: unable to open database file
    at Error (native)

The sqlite.db file can be red and written by any user:

[username@host .charged]$ ls -al
total 20
drwxrwxr-x.  2 username username    23 Jul 10 21:28 .
drwx------. 12 username username  4096 Jul 10 21:33 ..
-rw-rw-rw-.  1 username username 16384 Jul 10 21:02 sqlite.db

@shesek
Copy link
Contributor

shesek commented Jul 11, 2018

The -d/--db-path expects to receive the path to the sqlite file itself, not to the directory containing it. -d /home/username/.charged/sqlite.db should work.

@shesek
Copy link
Contributor

shesek commented Jul 12, 2018

Closing, please report back if you're still having issues.

@shesek shesek closed this as completed Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants