wagtail: no such module: fts5

Issue Summary

site-packages\django\db\backends\sqlite3\base.py", line 421, in execute return Database.Cursor.execute(self, query) django.db.utils.OperationalError: no such module: fts5

Steps to Reproduce

  1. Start a new project with wagtail start myproject
  2. manage.py migrate

Technical details

Python 3.7.6 Django 3.2.10 wagtail 2.15.1

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (1 by maintainers)

Commits related to this issue

Most upvoted comments

At this point this is extremely difficult to replicate, since you need an environment that’s old enough to not have sqlite-with-fts5 baked in, but new enough to evade the >3.19 version check, and new enough to let you install Python>=3.6 at all. The best I could do was to spin up an Ubuntu 16.04 instance in Vagrant and fake the sqlite version…

vagrant init ubuntu/xenial64
vagrant up
vagrant ssh
sudo apt update
sudo apt install -y python3 git curl build-essential libbz2-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev tk-dev
curl https://pyenv.run | bash
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc
exec $SHELL
pyenv install 3.7.12
~/.pyenv/versions/3.7.12/bin/python -m venv ~/.venv/wagtail
source ~/.venv/wagtail/bin/activate
git clone https://github.com/wagtail/wagtail.git
cd wagtail
pip install -e .

# edit wagtail/search/backends/database/sqlite/utils.py and change (3, 19, 0) to (3, 1, 0)

cd ..
wagtail start myapp
cd myapp
./manage.py migrate

This does indeed fail with sqlite3.OperationalError: no such module: fts5, and updating the fts5_available function to catch sqlite3.OperationalError instead of django.db.OperationalError fixes it. PR incoming…