"sqlalchemy.exc.OperationalError: no such table" error for freshly migrated database #70
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mia/0x0#70
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Howdy! I'm setting up 0x0 for some testing with the following series of commands:
However, when executing most requests, I get the error
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: file
orsqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: url
. An example of this error, and it's full stack trace, is attached at the bottom of this issue.The database itself seems to have the mentioned tables (although url is
URL
rather thanurl
):Any advice you might have is greatly appreciated. Thank you!
Full stack trace:
Alright so the deal here seems to have been that
flask db upgrade
resolves relative file paths relative topwd
, whereasflask run
resolves relative to the instance directory. This resulted in two different databases, one at:database.db
and one at:instance/database.db
, where the first contained the correct tables, and the second was used by the webserver.I see two possibilities here:
Also, the quick and dirty workaround that just got my setup running was just
mv database.db instance/
from the project directory.Oh, that’s unfortunate. I suppose one way to solve this is to pass an absolute path in
config.py
like so: