-
Type:
Build Failure
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: django
-
None
-
Python Drivers
-
Not Needed
-
-
None
-
None
-
None
-
None
-
None
-
None
Name of Failure:
Task run-tests on build variant tests-7-auth-ssl (Evergreen project django-mongodb-backend): all four subtests of model_fields.test_jsonfield.TestQuerying.test_in_json_whitespace error with NotSupportedError.
Link to task:
Context of when and why the failure occurred:
New regression from a change outside this repo. Revision b20bb6c passed on this variant on 2026-09-29 and 2026-10-03, then failed on 2026-10-10. CI clones mongodb-forks/django (mongodb-6.1.x) fresh each run, so the failure came from the fork: test_in_json_whitespace is a new upstream Django test that creates a model with a RawSQL field value. The backend rejects RawSQL on insert with NotSupportedError by design, failing the whole run-tests task. Duplicate search of INTPYTHON and PYTHON found no existing ticket.
Stack trace:
====================================================================== ERROR [0.000s]: test_in_json_whitespace (model_fields.test_jsonfield.TestQuerying.test_in_json_whitespace) (raw='{"a":1}') ---------------------------------------------------------------------- Traceback (most recent call last): File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/tests/model_fields/test_jsonfield.py", line 1074, in test_in_json_whitespace obj = NullableJSONModel.objects.create( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/query.py", line 752, in create obj.save(force_insert=True, using=self.db) File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/base.py", line 904, in save self.save_base( File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/base.py", line 996, in save_base updated = self._save_table( ^^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/base.py", line 1201, in _save_table results = self._do_insert( ^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/base.py", line 1253, in _do_insert return manager._insert( ^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/manager.py", line 87, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_repo/django/db/models/query.py", line 2166, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/data/mci/3c68626e50ab432d62abd99deeb9385d/src/django_mongodb_backend/compiler.py", line 1243, in execute_sql raise NotSupportedError( django.db.utils.NotSupportedError: MongoDB does not support creating models with expressions: got RawSQL(%s, ['{"a":1}']) for field value. ---------------------------------------------------------------------- Ran 570 tests in 34.605s FAILED (errors=4, skipped=108, expected failures=9)
The other three failing subtests are identical except for the raw value: '
{ "a" : 1 }', '[1,2]', '[ 1, 2 ]'.