0

I have upgraded my Wagtail installation to 2.15.1 with Django 3.1.13

When I run manage.py migrate I get an error

django.db.utils.OperationalError: no such module: fts5

I have searched but cannot find any solutions to this problem

Can someone please help?

This is the code that running in django/db/backends/sqlite3/base.py when the error occurs

class SQLiteCursorWrapper(Database.Cursor):
    def execute(self, query, params=None):
        if params is None:
            return Database.Cursor.execute(self, query)

it fails on the line

            return Database.Cursor.execute(self, query)

the last 3 values of query are

 CREATE VIRTUAL TABLE wagtailsearch_indexentry_fts USING fts5(autocomplete, body, title)
 PRAGMA foreign_key_check
 PRAGMA foreign_keys = ON

The failure happens on the last of these

Psionman
  • 3,084
  • 1
  • 32
  • 65

2 Answers2

0

The problem was in wagtail

I deleted the migrations folder from the site wagtail package and ran makemigrations and migrate. It now works

Psionman
  • 3,084
  • 1
  • 32
  • 65
  • This is definitely not recommended. It will make it incredibly difficult to upgrade to future Wagtail versions, because the migrations you generated and applied won't match the ones shipped with the next release of Wagtail. – gasman Jan 07 '22 at 17:09
0

This was a compatibility issue with versions of sqlite that don't provide the fts5 extension, and has now been fixed in Wagtail 2.15.2.

(Old information, kept for reference:)

This is an open Wagtail issue, currently being worked on at https://github.com/wagtail/wagtail/issues/7798.

For now, you'll need to ensure that the version of sqlite installed on your system comes with the fts5 extension. For Mac and Windows, this is likely to be bundled with the Python installer, so this won't be an issue. For Linux, it depends on the distribution - Ubuntu 18.04 has it, 16.04 doesn't. See How can I use the FTS5 extension with the sqlite3 python module with Python 3.7 on Ubuntu 16.04? for details of how to upgrade.

gasman
  • 23,691
  • 1
  • 38
  • 56