﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32224	SQLite3 bad filepath raising as JSON extension error.	Juan Garcia Alvite	Mariusz Felisiak	"Applying migrations on an installation using spatialite backend (probably sqlite too) where the path to the database file does not exist causes a confusing JSON field error.

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"	Bug	closed	Database layer (models, ORM)	3.1	Release blocker	fixed		Sage Abdullah	Ready for checkin	1	0	0	0	1	0
