[Django] #34561: "DatabaseError: Forced update did not affect any rows" on SessionStore save()

35 views
Skip to first unread message

Django

unread,
May 12, 2023, 4:04:03 AM5/12/23
to django-...@googlegroups.com
#34561: "DatabaseError: Forced update did not affect any rows" on SessionStore
save()
--------------------------------------------+------------------------
Reporter: danielfbnunes | Owner: nobody
Type: Bug | Status: new
Component: contrib.sessions | Version: 3.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
After a user login while working with [https://github.com/mozilla/mozilla-
django-oidc mozilla-django-oidc], I came across this "DatabaseError:
Forced update did not affect any rows" error on
[https://github.com/mozilla/mozilla-django-
oidc/blob/71e4af8283a10aa51234de705d34cd298e927f97/mozilla_django_oidc/views.py#L112
request.session.save()].
This looks to me like a race condition where the session doesn't exist but
[https://github.com/django/django/blob/e1bbbbe6acb69e755554088bc573cc1835673209/django/contrib/sessions/backends/db.py#L87
we still try to update it].

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

Django

unread,
May 12, 2023, 4:06:14 AM5/12/23
to django-...@googlegroups.com
#34561: "DatabaseError: Forced update did not affect any rows" on SessionStore
save()
-------------------------------------+-------------------------------------

Reporter: danielfbnunes | Owner: nobody
Type: Bug | Status: new
Component: contrib.sessions | Version: 3.2
Severity: Normal | Resolution:
Keywords: session, session | Triage Stage:
error, session save | Unreviewed

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by danielfbnunes):

* keywords: => session, session error, session save


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

Django

unread,
May 12, 2023, 4:23:19 AM5/12/23
to django-...@googlegroups.com
#34561: "DatabaseError: Forced update did not affect any rows" on SessionStore
save()
-------------------------------------+-------------------------------------
Reporter: danielfbnunes | Owner: nobody
Type: Bug | Status: closed
Component: contrib.sessions | Version: 3.2
Severity: Normal | Resolution: invalid

Keywords: session, session | Triage Stage:
error, session save | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

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


Comment:

As far as I'm aware, this should be handled by `mozilla-django-oidc` not
silently ignored by Django. Please report it on their bugtracker.

--
Ticket URL: <https://code.djangoproject.com/ticket/34561#comment:2>

Reply all
Reply to author
Forward
0 new messages