cannot import name 'ugettext_lazy' from 'django.utils.translation'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Magnum UI |
New
|
Undecided
|
Unassigned | ||
OpenStack Dashboard Charm |
Fix Committed
|
High
|
Corey Bryant | ||
2023.2 |
Fix Committed
|
Undecided
|
Unassigned | ||
Ubuntu Cloud Archive |
Fix Released
|
High
|
Unassigned | ||
Bobcat |
Fix Released
|
High
|
Unassigned | ||
watcher-dashboard |
New
|
Undecided
|
Unassigned | ||
magnum-ui (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Mantic |
Fix Released
|
High
|
Unassigned | ||
watcher-dashboard (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
On Ubuntu Mantic, the dashboard fails to load and the apache error log shows:
[Thu Oct 12 20:33:48.383727 2023] [wsgi:error] [pid 52899:tid 140293563209408] ERROR:root:cannot import name 'ugettext_lazy' from 'django.
[Thu Oct 12 20:33:48.383757 2023] [wsgi:error] [pid 52899:tid 140293563209408] Traceback (most recent call last):
[Thu Oct 12 20:33:48.383764 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "/usr/lib/
[Thu Oct 12 20:33:48.383769 2023] [wsgi:error] [pid 52899:tid 140293563209408] submodule = import_module(name)
[Thu Oct 12 20:33:48.383773 2023] [wsgi:error] [pid 52899:tid 140293563209408] ^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 20:33:48.383777 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "/usr/lib/
[Thu Oct 12 20:33:48.383787 2023] [wsgi:error] [pid 52899:tid 140293563209408] return _bootstrap.
[Thu Oct 12 20:33:48.383791 2023] [wsgi:error] [pid 52899:tid 140293563209408] ^^^^^^^
[Thu Oct 12 20:33:48.383795 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383799 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383803 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383807 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383811 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383814 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "<frozen importlib.
[Thu Oct 12 20:33:48.383818 2023] [wsgi:error] [pid 52899:tid 140293563209408] File "/usr/lib/
[Thu Oct 12 20:33:48.383823 2023] [wsgi:error] [pid 52899:tid 140293563209408] from django.
It looks like the charm template needs updating to work with Django 4.x in Mantic.
See upstream commit in horizon:
commit cd7c1b5110fe1f6
Author: Akihiro Motoki <email address hidden>
Date: Wed Jan 26 22:42:15 2022 +0900
Address RemovedInDjango
django.
ungettext(), and ungettext_lazy() are deprecated in favor of the
functions that they’re aliases for: django.
gettext_lazy(), gettext_noop(), ngettext(), and ngettext_lazy().
https:/
Change-Id: I77878f84e9d10c
== Ubuntu SRU Details ==
[Impact]
magnum dashboard can't be used with Django 4.x.
[Test Case]
Deploy openstack with magnum + magnum-ui. Ensure dashboard is functional and no errors in /var/log/
[Regression Potential]
This is a pretty simple change to aliased functions and regression testing mentioned above should be good enough to ensure behavior is as expected. Currently the dashboard doesn't work on Mantic where Django is at 4.2.4. This package is backported to the Bobcat cloud archive on Jammy where Django is at 3.2.12 and will need testing there, however should be fine considering these functions were deprecated in Django 3.0.
Changed in charm-openstack-dashboard: | |
status: | New → Triaged |
importance: | Undecided → High |
description: | updated |
Changed in charm-openstack-dashboard: | |
assignee: | nobody → Corey Bryant (corey.bryant) |
https:/ /review. opendev. org/c/openstack /watcher- dashboard/ +/898235