Project

General

Profile

Bug #50155

nautilus: mgr/dashboard: python 2: error when setting user's non-ASCII password

Added by Alfonso Martínez 15 days ago. Updated about 8 hours ago.

Status:
Resolved
Priority:
Normal
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

After PR https://github.com/ceph/ceph/pull/40522 there is a regression for py2 when setting non-ASCII password.

2021-04-06 06:48:37.194 7f7863717700  0 mgr[dashboard] [06/Apr/2021:06:48:37] HTTP Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cptools.py", line 221, in wrap
    return self.newhandler(innerfunc, *args, **kwargs)
  File "/ceph/src/pybind/mgr/dashboard/services/exception.py", line 88, in dashboard_exception_handler
    return handler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/ceph/src/pybind/mgr/dashboard/controllers/__init__.py", line 663, in inner
    ret = func(*args, **kwargs)
  File "/ceph/src/pybind/mgr/dashboard/controllers/__init__.py", line 856, in wrapper
    return func(*vpath, **params)
  File "/ceph/src/pybind/mgr/dashboard/controllers/user.py", line 55, in create
    user = mgr.ACCESS_CTRL_DB.create_user(username, password, name, email)
  File "/ceph/src/pybind/mgr/dashboard/services/access_control.py", line 301, in create_user
    user = User(username, password_hash(password), name, email)
  File "/ceph/src/pybind/mgr/dashboard/services/access_control.py", line 46, in password_hash
    return bcrypt.hashpw(password.encode('utf8'), salt_password).decode('utf8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 0: ordinal not in range(128)

Related issues

Copied from mgr - Bug #49278: nautilus: mgr/dashboard: python 2: error when setting user's non-ASCII password Resolved

History

#1 Updated by Alfonso Martínez 15 days ago

  • Copied from Bug #49278: nautilus: mgr/dashboard: python 2: error when setting user's non-ASCII password added

#2 Updated by Alfonso Martínez 15 days ago

  • Status changed from Resolved to Fix Under Review
  • Pull request ID set to 40610

#3 Updated by Ernesto Puerta 15 days ago

  • Status changed from Fix Under Review to Resolved

#4 Updated by Loïc Dachary about 8 hours ago

  • Target version changed from v14.2.20 to v14.2.21

Also available in: Atom PDF