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.

Error: unable to open database file

See original GitHub issue

I did the following:

git clone git@github.com:cookiecutter-flask/cookiecutter-flask.git
/cookiecutter-docker.sh
...
cd app
docker-compose up flask-dev

I opened up the site at localhost:5000 and filled out the registration form. Upon submitting it I got the following error:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: http://sqlalche.me/e/e3q8)

There was a dev.db/ folder in the app directory owned by root. This seemed strange …

I’m on Manjaro (Arch) Linux. Docker version: Docker version 19.03.4-ce, build 9013bf583a Docker-compose version: docker-compose version 1.24.1, build unknown

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

4reactions
yurivanmiddencommented, Dec 13, 2019

There was a dev.db/ folder in the app directory owned by root. This seemed strange …

True, docker-compose does that when you run docker-compose [ up | run ], as it tries to mount that directory in the container. Run $ touch dev.db before running the containers to create a dev.db file instead of a directory.

3reactions
jamescurtincommented, Mar 17, 2020

Hi, I ran into a similar problem, but touching dev.db didn’t solve the problem for me. Identical stack trace. shrugs

Late response, but one clarification: If a directory named dev.db already exists, touching it won’t have any effect. If you’ve already run into this issue, you need to delete the directory before running touch dev.db (which ensures it exists as a file, not a directory).

Read more comments on GitHub >

github_iconTop Results From Across the Web

sqlite3.OperationalError: unable to open database file
Make sure each folder of your database file's full path does not start with number, eg. /www/4myweb/db (observed on Windows 2000).
Read more >
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 >
How to Fix SQLite Unable to Open Database File Issue?
If SQLite is unable to open the database file, this means that the SQLite database you are trying to open is corrupted.
Read more >
unable to open database file - SQLite Forum
Hi: I am shakoor, I develop a vb.net desktop application using SQLite database file, on updation of any table, it generate error "unable...
Read more >
Why does leapp preupgrade fail with `sqlite3.OperationalError
Why does leapp preupgrade fail with `sqlite3.OperationalError: unable to open database file` traceback error ?
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