nova-manage list_cells doesn't work if some special characters are in the passwords

Bug #1778515 reported by Surya Seetharaman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Won't Fix
Undecided
Surya Seetharaman

Bug Description

nova-manage cell_v2 list_cells does not work without the --verbose flag if square brackets are used in the DB or transport URL passwords because we use https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlsplit during masking of the passwords and it is explicitly mentioned that this gives a "ValueError: Invalid IPv6 URL", for square brackets if they are not symmetric (https://github.com/enthought/Python-2.7.3/blob/69fe0ffd2d85b4002cacae1f28ef2eb0f25e16ae/Lib/urlparse.py#L181). Also using "?" or "#" in passwords do not mask the password. These exceptions surely need to be at least documented somewhere in nova if they cannot be fixed.

This is what the Error looks like, which is not very helpful:
An error has occurred:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 1762, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 1454, in list_cells
    mask_passwd_in_url(cell.database_connection)])
  File "/usr/lib/python2.7/site-packages/nova/cmd/manage.py", line 100, in mask_passwd_in_url
    parsed = urlparse.urlparse(url)
  File "/usr/lib64/python2.7/urlparse.py", line 142, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib64/python2.7/urlparse.py", line 213, in urlsplit
    raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL

description: updated
description: updated
description: updated
Revision history for this message
Matt Riedemann (mriedem) wrote :

So you have "[" or "]" in the password in those URLs? We're having similar discussions in https://review.openstack.org/578163 and it seems those should be URL encoded to work.

summary: - nova-manage list_cells doesn't work is some special characters are in
+ nova-manage list_cells doesn't work if some special characters are in
the passwords
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Surya Seetharaman (tssurya) wrote :

So as indicated, the passwords have to be urlencoded for the parsing and masking to work. No changes will be done on the masking function on the nova side to check for special chars in passwords as it doesn't make sense. Marking this as a Won't Fix.

Changed in nova:
status: New → Won't Fix
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.