horizon crashes on password expire reset request (multiregion)

Bug #1957926 reported by Marek Grudzinski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Undecided
Unassigned

Bug Description

versions:
  general: wallaby
  horizon: 19.2.1.dev12
  keystone: 19.0.1.dev11
  os: ubuntu 20.04.3 LTS
  installed from source: yes
  deployment method: kolla-ansible

keystone config:

[security_compliance]
change_password_upon_first_use = true

horizon config (local_settings):

ALLOW_USERS_CHANGE_EXPIRED_PASSWORD = True

multiregion: YES, single keystone/horizon with multiple regions

Problem:

When creating a new user and trying to login with said user horizon crashes with the following trace:

[Thu Jan 13 11:48:09.243737 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] Traceback (most recent call last):
[Thu Jan 13 11:48:09.243741 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 34, in inner
[Thu Jan 13 11:48:09.243744 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] response = get_response(request)
[Thu Jan 13 11:48:09.243747 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 115, in _get_response
[Thu Jan 13 11:48:09.243750 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] response = self.process_exception_by_middleware(e, request)
[Thu Jan 13 11:48:09.243756 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 113, in _get_response
[Thu Jan 13 11:48:09.243759 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Thu Jan 13 11:48:09.243763 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 71, in view
[Thu Jan 13 11:48:09.243767 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] return self.dispatch(request, *args, **kwargs)
[Thu Jan 13 11:48:09.243770 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 97, in dispatch
[Thu Jan 13 11:48:09.243772 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] return handler(request, *args, **kwargs)
[Thu Jan 13 11:48:09.243774 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/edit.py", line 133, in get
[Thu Jan 13 11:48:09.243792 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] return self.render_to_response(self.get_context_data())
[Thu Jan 13 11:48:09.243794 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/edit.py", line 66, in get_context_data
[Thu Jan 13 11:48:09.243800 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] kwargs['form'] = self.get_form()
[Thu Jan 13 11:48:09.243803 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/django/views/generic/edit.py", line 33, in get_form
[Thu Jan 13 11:48:09.243805 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] return form_class(**self.get_form_kwargs())
[Thu Jan 13 11:48:09.243807 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] File "/var/lib/kolla/venv/lib/python3.8/site-packages/openstack_auth/forms.py", line 213, in __init__
[Thu Jan 13 11:48:09.243809 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] self.fields['region'].initial = self.request.COOKIES.get(
[Thu Jan 13 11:48:09.243811 2022] [wsgi:error] [pid 699:tid 139676869314304] [remote x:35360] AttributeError: 'Password' object has no attribute 'request'

Changed in horizon:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/horizon/+/827887

Changed in horizon:
status: Confirmed → In Progress
Revision history for this message
Vishal Manchanda (vishalmanchanda) wrote :

@Marek Grudzinski, Hi Could you please confirm if the above patch fixes your issue?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit 88dd887ad3284601f0acec89cf52265602a70c8c
Author: Radomir Dopieralski <email address hidden>
Date: Fri Feb 4 18:01:17 2022 +0100

    Fix getting defaults from cookie for region field in password form

    Since the normal form doesn't have a request attribute, we have to
    pass the initial value for the region from the view.

    Change-Id: Icea647ad13718b74528922f362ad665be1392e9b
    Closes-bug: #1957926

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
Marek Grudzinski (ivve) wrote :

Hello and sorry for a very late reply.
I can confirm that this works perfectly. Thank you very much!

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

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

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

Other bug subscribers

Remote bug watches

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