django.core.cache.backends.memcached.MemcachedCache backend is removed

Bug #2039225 reported by Corey Bryant
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Unassigned
OpenStack Dashboard Charm
Fix Committed
High
Unassigned
Ubuntu Cloud Archive
Fix Released
High
Unassigned
Bobcat
Fix Released
High
Unassigned
horizon (Ubuntu)
Fix Released
High
Unassigned
Mantic
Fix Released
High
Unassigned

Bug Description

[Description]
In 4.1 the django.core.cache.backends.memcached.MemcachedCache backend is removed.

https://github.com/django/django/blob/main/docs/releases/4.1.txt#L749

It's been deprecated since 3.2:

https://docs.djangoproject.com/en/4.2/releases/3.2/#features-deprecated-in-3-2

"The django.core.cache.backends.memcached.MemcachedCache backend is deprecated as python-memcached has some problems and seems to be unmaintained. Use django.core.cache.backends.memcached.PyMemcacheCache or django.core.cache.backends.memcached.PyLibMCCache instead."

This results in the following error on Ubuntu Mantic:

InvalidCacheBackendError at /
Could not find backend 'django.core.cache.backends.memcached.MemcachedCache': Module "django.core.cache.backends.memcached" does not define a "MemcachedCache" attribute/class
Request Method: GET
Request URL: http://10.5.3.66/horizon/
Django Version: 4.2.4
Exception Type: InvalidCacheBackendError
Exception Value:
Could not find backend 'django.core.cache.backends.memcached.MemcachedCache': Module "django.core.cache.backends.memcached" does not define a "MemcachedCache" attribute/class
Exception Location: /usr/lib/python3/dist-packages/django/core/cache/__init__.py, line 49, in create_connection
Python Executable: /usr/bin/python3
Python Version: 3.11.6
Python Path:
['/usr/lib/python3/dist-packages',
 '/usr/lib/python311.zip',
 '/usr/lib/python3.11',
 '/usr/lib/python3.11/lib-dynload',
 '/usr/local/lib/python3.11/dist-packages',
 '/usr/lib/python3/dist-packages',
 '/usr/lib/python3/dist-packages/openstack_dashboard']
Server time: Thu, 12 Oct 2023 20:44:30 +0000

[Test Case]
Deploy openstack with the openstack-dashboard (horizon) on Ubuntu mantic. Ensure the dashboard is functional and no errors in /var/log/apache/error.log.

[Regression Potential]
This fix is inline with the upstream. Currently the dashboard is not functional without this fix.

description: updated
description: updated
description: updated
Revision history for this message
Corey Bryant (corey.bryant) wrote :

If the horizon package fix is needed before the SRU lands, it is available in https://launchpad.net/~corey.bryant/+archive/ubuntu/mantic-bobcat

Changed in horizon (Ubuntu Mantic):
status: New → Triaged
importance: Undecided → High
Changed in charm-openstack-dashboard:
status: New → Triaged
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (master)
Changed in charm-openstack-dashboard:
status: Triaged → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

There is a patch to update the default cache backend. We can probably use it.
 https://review.opendev.org/c/openstack/horizon/+/891828

Changed in horizon:
status: New → In Progress
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Ubuntu package update uploaded to noble and mantic unapproved queue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package horizon - 4:23.3.0-0ubuntu2

---------------
horizon (4:23.3.0-0ubuntu2) noble; urgency=medium

  * d/p/ubuntu_settings.patch, d/p/switch-to-pymemcachecache-backend.patch,
    d/control: Switch to python3-pymemcache and PyMemcacheCache driver as
    the Django MemcachedCache backend was removed in Django 4.1 in favor of
    the PyMemcacheCache or PyLibMCCache backend (LP: #2039225).
  * d/p/ubuntu_settings.patch: Rebase and apply on top of
    switch-to-pymemcachecache-backend.patch.
  * d/gbp.conf, .launchpad.yaml: Sync from cloud-archive-tools for
    caracal.

 -- Corey Bryant <email address hidden> Thu, 12 Oct 2023 17:17:26 -0400

Changed in horizon (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Corey, or anyone else affected,

Accepted horizon into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/horizon/4:23.3.0-0ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in horizon (Ubuntu Mantic):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Hello Corey, or anyone else affected,

Accepted horizon into bobcat-proposed. The package will build now and be available in the Ubuntu Cloud Archive in a few hours, and then in the -proposed repository.

Please help us by testing this new package. To enable the -proposed repository:

  sudo add-apt-repository cloud-archive:bobcat-proposed
  sudo apt-get update

Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-bobcat-needed to verification-bobcat-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-bobcat-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-bobcat-needed
description: updated
Revision history for this message
Corey Bryant (corey.bryant) wrote (last edit ):

openstack-dashboard is functional on mantic-proposed
version tested: 4:23.3.0-0ubuntu1.1

Revision history for this message
Corey Bryant (corey.bryant) wrote :
tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
Revision history for this message
Corey Bryant (corey.bryant) wrote :

openstack-dashboard is functional on bobcat-proposed
version tested: openstack-dashboard/jammy-proposed,now 4:23.3.0-0ubuntu1.1~cloud0 all [installed]

Revision history for this message
Corey Bryant (corey.bryant) wrote :
tags: added: verification-bobcat-done
removed: verification-bobcat-needed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/c/openstack/horizon/+/891828
Committed: https://opendev.org/openstack/horizon/commit/caa99b2010bd914bbe3cb2779940b7c544fe1104
Submitter: "Zuul (22348)"
Branch: master

commit caa99b2010bd914bbe3cb2779940b7c544fe1104
Author: Radomir Dopieralski <email address hidden>
Date: Thu Aug 17 17:06:14 2023 +0200

    Switch to PyMemcacheCache backend

    The new library is already supported in django 3.2 and gives us better
    support for IPv6 addresses and encrypted connections.

    Also, the same library is being used by all other OpenStack projects.

    Depends-on: https://review.opendev.org/c/openstack/devstack/+/898302
    Closes-Bug: #2039225
    Change-Id: I964ac4d0d62dff4c1f7c1f1373763fbf23024269

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Update Released

The verification of the Stable Release Update for horizon has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package horizon - 4:23.3.0-0ubuntu1.1

---------------
horizon (4:23.3.0-0ubuntu1.1) mantic; urgency=medium

  * d/p/ubuntu_settings.patch, d/p/switch-to-pymemcachecache-backend.patch,
    d/control: Switch to python3-pymemcache and PyMemcacheCache driver as
    the Django MemcachedCache backend was removed in Django 4.1 in favor of
    the PyMemcacheCache or PyLibMCCache backend (LP: #2039225).
  * d/p/ubuntu_settings.patch: Rebase and apply on top of
    switch-to-pymemcachecache-backend.patch.
  * d/gbp.conf: Create stable/2023.2 branch.
  * d/gbp.conf, .launchpad.yaml: Sync from cloud-archive-tools for
    bobcat.

 -- Corey Bryant <email address hidden> Thu, 26 Oct 2023 14:38:06 -0400

Changed in horizon (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Corey Bryant (corey.bryant) wrote :

This bug was fixed in the package horizon - 4:23.3.0-0ubuntu1.1~cloud0
---------------

 horizon (4:23.3.0-0ubuntu1.1~cloud0) jammy-bobcat; urgency=medium
 .
   * New update for the Ubuntu Cloud Archive.
 .
 horizon (4:23.3.0-0ubuntu1.1) mantic; urgency=medium
 .
   * d/p/ubuntu_settings.patch, d/p/switch-to-pymemcachecache-backend.patch,
     d/control: Switch to python3-pymemcache and PyMemcacheCache driver as
     the Django MemcachedCache backend was removed in Django 4.1 in favor of
     the PyMemcacheCache or PyLibMCCache backend (LP: #2039225).
   * d/p/ubuntu_settings.patch: Rebase and apply on top of
     switch-to-pymemcachecache-backend.patch.
   * d/gbp.conf: Create stable/2023.2 branch.
   * d/gbp.conf, .launchpad.yaml: Sync from cloud-archive-tools for
     bobcat.

Changed in cloud-archive:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (master)

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/898246
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/16c5a026419e5c23ab4e7777cec8deb15c25ee6f
Submitter: "Zuul (22348)"
Branch: master

commit 16c5a026419e5c23ab4e7777cec8deb15c25ee6f
Author: Corey Bryant <email address hidden>
Date: Fri Oct 13 14:57:46 2023 -0400

    Add local_settings.py template for Bobcat

    This fixes issues found in testing with Django 4 in mantic.

    ugettext_lazy was deprecated in Django 3.0 and removed in
    Django 4.0. Switch to gettext_lazy.

    Switch to PyMemcacheCache backend as the Django MemcachedCache
    backend was removed in Django 4.1 in favor of the PyMemcacheCache
    or PyLibMCCache backend. This depends on a new openstack-dashboard
    package version that will be provided in an SRU for bug #2039225.

    Closes-Bug: #2039226
    Closes-Bug: #2039225
    Change-Id: Ia8e4f6f5f50d58268e4c6fa80c9f9c65a56a26ea

Changed in charm-openstack-dashboard:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to charm-openstack-dashboard (stable/2023.2)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-openstack-dashboard (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/charm-openstack-dashboard/+/901561
Committed: https://opendev.org/openstack/charm-openstack-dashboard/commit/dec3e0158f0fc7c484e3fc2ffd8fa31c166f9b58
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit dec3e0158f0fc7c484e3fc2ffd8fa31c166f9b58
Author: Corey Bryant <email address hidden>
Date: Fri Oct 13 14:57:46 2023 -0400

    Add local_settings.py template for Bobcat

    This fixes issues found in testing with Django 4 in mantic.

    ugettext_lazy was deprecated in Django 3.0 and removed in
    Django 4.0. Switch to gettext_lazy.

    Switch to PyMemcacheCache backend as the Django MemcachedCache
    backend was removed in Django 4.1 in favor of the PyMemcacheCache
    or PyLibMCCache backend. This depends on a new openstack-dashboard
    package version that will be provided in an SRU for bug #2039225.

    Closes-Bug: #2039226
    Closes-Bug: #2039225
    Change-Id: Ia8e4f6f5f50d58268e4c6fa80c9f9c65a56a26ea
    (cherry picked from commit 16c5a026419e5c23ab4e7777cec8deb15c25ee6f)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 23.4.0

This issue was fixed in the openstack/horizon 23.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.