Opened 6 years ago

Closed 6 years ago

#29624 closed Bug (wontfix)

Django 2.1 incompatible with sqlite 3.6.20

Reported by: zsblevins Owned by: nobody
Component: Database layer (models, ORM) Version: 2.1
Severity: Release blocker Keywords:
Cc: zsblevins@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Running tests using sqlite3 databases with Django 2.1 and sqlite 3.6.20 yields:

Traceback (most recent call last):
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
     self.connect()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 194, in connect
     self.connection = self.get_new_connection(conn_params)
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 159, in get_new_connection
     conn = Database.connect(**conn_params)
 sqlite3.NotSupportedError: URIs not supported
 
 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):
   File "yahoo/contrib/sandy_app/manage.py", line 13, in <module>
     execute_from_command_line(sys.argv)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
     utility.execute()
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/commands/test.py", line 26, in run_from_argv
     super().run_from_argv(argv)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/base.py", line 316, in run_from_argv
     self.execute(*args, **cmd_options)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
     output = self.handle(*args, **options)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/commands/test.py", line 56, in handle
     failures = test_runner.run_tests(test_labels)
   File "/tmp/py36/lib/python3.6/site-packages/django_nose/runner.py", line 308, in run_tests
     result = self.run_suite(nose_argv)
   File "/tmp/py36/lib/python3.6/site-packages/django_nose/runner.py", line 245, in run_suite
     addplugins=plugins_to_add)
   File "/tmp/py36/lib/python3.6/site-packages/nose/core.py", line 121, in __init__
     **extra_args)
   File "/opt/python/lib/python3.6/unittest/main.py", line 95, in __init__
     self.runTests()
   File "/tmp/py36/lib/python3.6/site-packages/nose/core.py", line 207, in runTests
     result = self.testRunner.run(self.test)
   File "/tmp/py36/lib/python3.6/site-packages/nose/core.py", line 50, in run
     wrapper = self.config.plugins.prepareTest(test)
   File "/tmp/py36/lib/python3.6/site-packages/nose/plugins/manager.py", line 99, in __call__
     return self.call(*arg, **kw)
   File "/tmp/py36/lib/python3.6/site-packages/nose/plugins/manager.py", line 167, in simple
     result = meth(*arg, **kw)
   File "/tmp/py36/lib/python3.6/site-packages/django_nose/plugin.py", line 82, in prepareTest
     self.old_names = self.runner.setup_databases()
   File "/tmp/py36/lib/python3.6/site-packages/django_nose/runner.py", line 495, in setup_databases
     return super(NoseTestSuiteRunner, self).setup_databases()
   File "/tmp/py36/lib/python3.6/site-packages/django/test/runner.py", line 551, in setup_databases
     self.parallel, **kwargs
   File "/tmp/py36/lib/python3.6/site-packages/django/test/utils.py", line 174, in setup_databases
     serialize=connection.settings_dict.get('TEST', {}).get('SERIALIZE', True),
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/creation.py", line 68, in create_test_db
     run_syncdb=True,
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/__init__.py", line 148, in call_command
     return command.execute(*args, **defaults)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/base.py", line 353, in execute
     output = self.handle(*args, **options)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/base.py", line 83, in wrapped
     res = handle_func(*args, **kwargs)
   File "/tmp/py36/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 82, in handle
     executor = MigrationExecutor(connection, self.migration_progress_callback)
   File "/tmp/py36/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__
     self.loader = MigrationLoader(self.connection)
   File "/tmp/py36/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__
     self.build_graph()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/migrations/loader.py", line 209, in build_graph
     self.applied_migrations = recorder.applied_migrations()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 61, in applied_migrations
     if self.has_table():
   File "/tmp/py36/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 44, in has_table
     return self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor())
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 255, in cursor
     return self._cursor()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 232, in _cursor
     self.ensure_connection()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
     self.connect()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
     raise dj_exc_value.with_traceback(traceback) from exc_value
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection
     self.connect()
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/base/base.py", line 194, in connect
     self.connection = self.get_new_connection(conn_params)
   File "/tmp/py36/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 159, in get_new_connection
     conn = Database.connect(**conn_params)
 django.db.utils.NotSupportedError: URIs not supported
 ERROR: InvocationError for command '/tmp/py36/bin/python yahoo/contrib/sandy_app/manage.py test --with-xunit --xunit-file=artifacts/test/nosetests_py36.xml --xunit-testsuite-name=py36 --with-coverage --cover-xml --cover-erase --traverse-namespace --cover-tests --exe --cover-package=yahoo.contrib --cover-xml-file=artifacts/coverage/cobertura.xml tests' (exited with code 1)

Downgrading Django to 2.0.7 resolves. sqlite 3.7.17 on RHEL7 does not have the same issue, but is not available on RHEL6 systems.

Change History (3)

comment:1 by Tim Graham, 6 years ago

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Support for SQLite < 3.7.15 was removed in #28584. I didn't expect it would affect anyone but I guess I don't understand how the SQLite version relates to the Python version. Apparently, they aren't always linked. Anyway, we'll either document what versions of SQLite are supported or restore compatibility.

in reply to:  1 comment:2 by zsblevins, 6 years ago

Replying to Tim Graham:

Support for SQLite < 3.7.15 was removed in #28584. I didn't expect it would affect anyone but I guess I don't understand how the SQLite version relates to the Python version. Apparently, they aren't always linked. Anyway, we'll either document what versions of SQLite are supported or restore compatibility.

FWIW we're using Python 3.6.4. In our RHEL7 containers, sqlite 3.7.17 is installed and the build succeeds. Our RHEL6 containers have the 3.6.20 version of sqlite3.

Last edited 6 years ago by zsblevins (previous) (diff)

comment:3 by Tim Graham, 6 years ago

Resolution: wontfix
Status: newclosed

I've created a PR to document SQLite 3.7.15 as the minimum required version. For comparison, SQLite 3.6.20 was released November 2009.

Note: See TracTickets for help on using tickets.
Back to Top