Take this following DATABASES configuration. Note that the `dev.sqlite3`
file does not exist.
{{{
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': '/home/user/app/dev.sqlite3',
}
}
}}}
When running `./manage.py migrate` the following exception is raised
{{{
SystemCheckError: System check identified some issues:
ERRORS:
rumble_common.RumbleEvent: (fields.E180) SQLite does not support
JSONFields.
}}}
We assert the JSON extension is present with the following code block, as
per [https://code.djangoproject.com/wiki/JSON1Extension]
{{{
>>> import sqlite3
>>> conn = sqlite3.connect(':memory:')
>>> cursor = conn.cursor()
>>> cursor.execute('SELECT JSON(\'{"a": "b"}\')')
}}}
The issue is resolved by changing
{{{
DATABASES['default']['NAME']
}}}
to point to the right path.
The issue is that the error is misleading, and leads developers down the
wrong rabbit hole
Hope thats descriptive enough, thanks all!
Extra:
Django 3.1.3
Debian Buster Docker environment
--
Ticket URL: <https://code.djangoproject.com/ticket/32224>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* severity: Normal => Release blocker
* cc: sage (added)
* component: Core (System checks) => Database layer (models, ORM)
* owner: nobody => Mariusz Felisiak
* stage: Unreviewed => Accepted
Comment:
Thanks for the report.
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd.
Reproduced at c70cd2a926ffab47f6613e83e0c8828eb6c2c064.
--
Ticket URL: <https://code.djangoproject.com/ticket/32224#comment:1>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/13714 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/32224#comment:2>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/32224#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"f5e5aac59ebbcea46b98d37834915de0f43d7cc8" f5e5aac5]:
{{{
#!CommitTicketReference repository=""
revision="f5e5aac59ebbcea46b98d37834915de0f43d7cc8"
Fixed #32224 -- Avoided suppressing connection errors in
supports_json_field on SQLite.`
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd.
Thanks Juan Garcia Alvite for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32224#comment:4>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"97bfe0cba55720802abc7a7190ccb1ac575da50d" 97bfe0c]:
{{{
#!CommitTicketReference repository=""
revision="97bfe0cba55720802abc7a7190ccb1ac575da50d"
[3.1.x] Fixed #32224 -- Avoided suppressing connection errors in
supports_json_field on SQLite.
Regression in 6789ded0a6ab797f0dcdfa6ad5d1cfa46e23abcd.
Thanks Juan Garcia Alvite for the report.
Backport of f5e5aac59ebbcea46b98d37834915de0f43d7cc8 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/32224#comment:5>