Opened 6 years ago
Last modified 5 years ago
#30329 closed Bug
ImproperlyConfigured exceptions should be raised immediately. — at Version 4
Reported by: | Alasdair Nicol | Owned by: | |
---|---|---|---|
Component: | Error reporting | Version: | 2.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When an older version of sqlite is installed, the final line of the traceback in runserver is unrelated.
raise LookupError(message) LookupError: No installed app with label 'admin'.
If you look further up the traceback, you can see what the problem is, but this can be tricky for newer users.
raise ImproperlyConfigured('SQLite 3.8.3 or later is required (found %s).' % Database.sqlite_version) django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17).
I think that if we made the error message clearer it would be helpful for new users. Perhaps we could do this by checking the sqlite version in a system check, or maybe there's a better approach.
Related Stack Overflow question: https://stackoverflow.com/questions/55512244/no-installed-app-with-label-admin-in-empty-django-2-2-project/
Change History (4)
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
comment:2 by , 6 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Bug |
Version: | 2.2 → master |
comment:3 by , 6 years ago
Description: | modified (diff) |
---|---|
Summary: | Make error message clearer when installed SQLite version is too old. → ImproperlyConfigured exceptions should be raised immediately. |
comment:4 by , 6 years ago
Description: | modified (diff) |
---|
I ran git bisect and I believe the behaviour changed in #27685 when the autoloader changed.
Only runserver
shows the LookupError
last - manage.py check
, manage.py migrate
and so on all show django.core.exceptions.ImproperlyConfigured
.
This behavior has been changed somewhere in the Django 2.2. I agree that it is a bug but probably not crucial. It affects all
ImproperlyConfigured
's exceptions, e.g.django.core.exceptions.ImproperlyConfigured: Error loading cx_Oracle module: No module named 'cx_Oracle'
,django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.X).
, etc.