[Django] #33490: Potential bug: mysql-connector-python Django 3.2.11 and third-party packages that populate the Admin Site

16 views
Skip to first unread message

Django

unread,
Feb 3, 2022, 1:06:31 PM2/3/22
to django-...@googlegroups.com
#33490: Potential bug: mysql-connector-python Django 3.2.11 and third-party
packages that populate the Admin Site
-------------------------------------+-------------------------------------
Reporter: rocha6464 | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 3.2
Uncategorized | Keywords: mysql-connector
Severity: Normal | 8.0.26, Django 3.2.11
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Platform: Observed on Ubuntu 20.04, RHEL8

1. Install MySQL (Either 5.7 and 8.0)
2. Create a Virtual environment using venv, and activate it.
3. Install Django 3.2.11
4. Install mysql-connector-python (Either 8.0.26 and 8.0.28)
5. Install django-easy-audit and/or django-axes (both these third party
packages populate the Django Admin Site, where the apparent bug
manifests).
6. Create a superuser (python manage.py createsuperuser)
7. Start Django (python manage.py runserver)
8. Launch the Django Admin Site and log in with the superuser.
9. The pane on the left hand side will have links to objects created by
django-easy-audit and/or django-axes, depending on what was installed.
10. Click on the "Request event" link under "Easy Audit Application" or
"Access logs" under "Axes"
RESULT:
Template error: In template /home/......../.venv/lib/python3.8/site-
packages/django/contrib/admin/templates/admin/base.html, error at line 44
'NoneType' object has no attribute 'day' [OR 'NoneType' object has no
attribute 'month']

This behaviour is observed on MySQL 5.7.37 and 8.0.26 using mysql-
connector 8.0.26 and 8.0.28.

Replacing MySQL with SQLite or PostgreSQL 12 solves the issue.

Replacing mysql-connector with mysqlclient-2.1.0 solves the issue.

The problem does not manifest when using mysql-connector-python 8.0.26
with Django 3.1.14 and these third-party packages.

This implies there is a bug in the interaction between some third-party
packages that populate the Django Admin Site like django-easy-audit and
django-axes, Django 3.2.11 and mysql-connector 8.0.26 and 8.0.28.

settings.py and the full traceback are attached.

--
Ticket URL: <https://code.djangoproject.com/ticket/33490>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 3, 2022, 1:07:00 PM2/3/22
to django-...@googlegroups.com
#33490: Potential bug: mysql-connector-python Django 3.2.11 and third-party
packages that populate the Admin Site
-------------------------------------+-------------------------------------
Reporter: rocha6464 | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution:
Keywords: mysql-connector | Triage Stage:
8.0.26, Django 3.2.11 | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by rocha6464):

* Attachment "settings.txt" added.

settings.py file

Django

unread,
Feb 3, 2022, 1:07:21 PM2/3/22
to django-...@googlegroups.com
#33490: Potential bug: mysql-connector-python Django 3.2.11 and third-party
packages that populate the Admin Site
-------------------------------------+-------------------------------------
Reporter: rocha6464 | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution:
Keywords: mysql-connector | Triage Stage:
8.0.26, Django 3.2.11 | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by rocha6464):

* Attachment "traceback.txt" added.

Full traceback

Django

unread,
Feb 3, 2022, 1:49:50 PM2/3/22
to django-...@googlegroups.com
#33490: Potential bug: mysql-connector-python Django 3.2.11 and third-party
packages that populate the Admin Site
-------------------------------------+-------------------------------------
Reporter: Richard Mayebo | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution: invalid

Keywords: mysql-connector | Triage Stage:
8.0.26, Django 3.2.11 | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

* status: new => closed
* resolution: => invalid


Comment:

> This implies there is a bug in the interaction between some third-party
packages that populate the Django Admin Site like django-easy-audit and
django-axes, Django 3.2.11 and mysql-connector 8.0.26 and 8.0.28.

This bug tracker is only used to track confirmed issues with Django
itself.

Please refer to TicketClosingReasons/UseSupportChannels

--
Ticket URL: <https://code.djangoproject.com/ticket/33490#comment:1>

Reply all
Reply to author
Forward
0 new messages