Opened 4 years ago

Closed 3 years ago

#30329 closed Bug (fixed)

ImproperlyConfigured exceptions should be raised immediately.

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 Alasdair Nicol)

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/

See django/apps/registry.py.

Change History (5)

comment:1 Changed 4 years ago by Alasdair Nicol

Description: modified (diff)

comment:2 Changed 4 years ago by Mariusz Felisiak

Triage Stage: UnreviewedAccepted
Type: UncategorizedBug
Version: 2.2master

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.

comment:3 Changed 4 years ago by Mariusz Felisiak

Description: modified (diff)
Summary: Make error message clearer when installed SQLite version is too old.ImproperlyConfigured exceptions should be raised immediately.

comment:4 Changed 4 years ago by Alasdair Nicol

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.

comment:5 Changed 3 years ago by Mariusz Felisiak

Resolution: fixed
Status: newclosed
Version: master2.2
Note: See TracTickets for help on using tickets.
Back to Top