Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1516992 - Cannot use % on password for aodh connection to database
Summary: Cannot use % on password for aodh connection to database
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-aodh
Version: 9.0 (Mitaka)
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: zstream
: 9.0 (Mitaka)
Assignee: Mehdi ABAAKOUK
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-23 19:36 UTC by Marc Methot
Modified: 2018-03-15 12:46 UTC (History)
7 users (show)

Fixed In Version: openstack-aodh-2.0.5-2.el7ost
Doc Type: Bug Fix
Doc Text:
Previously, using a '%' character in the password connection string for aodh would cause aodh-dbsync to throw an error. With this update, you can now use a '%' in the password for the database url.
Clone Of:
Environment:
Last Closed: 2018-03-15 12:45:24 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0540 None None None 2018-03-15 12:46:21 UTC
OpenStack gerrit 524230 None None None 2017-11-30 16:11:31 UTC

Description Marc Methot 2017-11-23 19:36:03 UTC
Using a % in the password connection string for aodh:
-------------------------------------------
#vi /etc/aodh/aodh.conf
[database]
connection = mysql+pymysql://aodh:password%@111.111.111.111/aodh
-------------------------------------------
makes aodh-dbsync throw the following error:
-------------------------------------------
017-11-21 12:19:08.989 17234 CRITICAL aodh [-] ValueError: invalid interpolation syntax in 'mysql+pymysql://aodh:password%@111.111.111.111/aodh' at position 28
2017-11-21 12:19:08.989 17234 ERROR aodh Traceback (most recent call last):
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/bin/aodh-dbsync", line 10, in <module>
2017-11-21 12:19:08.989 17234 ERROR aodh     sys.exit(dbsync())
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/lib/python2.7/site-packages/aodh/cmd/storage.py", line 29, in dbsync
2017-11-21 12:19:08.989 17234 ERROR aodh     storage.get_connection_from_config(conf).upgrade()
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/lib/python2.7/site-packages/aodh/storage/impl_sqlalchemy.py", line 84, in upgrade
2017-11-21 12:19:08.989 17234 ERROR aodh     cfg = self._get_alembic_config()
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/lib/python2.7/site-packages/aodh/storage/impl_sqlalchemy.py", line 80, in _get_alembic_config
2017-11-21 12:19:08.989 17234 ERROR aodh     self.conf.database.connection)
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/lib/python2.7/site-packages/alembic/config.py", line 201, in set_main_option
2017-11-21 12:19:08.989 17234 ERROR aodh     self.file_config.set(self.config_ini_section, name, value)
2017-11-21 12:19:08.989 17234 ERROR aodh   File "/usr/lib64/python2.7/ConfigParser.py", line 752, in set
2017-11-21 12:19:08.989 17234 ERROR aodh     "position %d" % (value, tmp_value.find('%')))
2017-11-21 12:19:08.989 17234 ERROR aodh ValueError: invalid interpolation syntax in 'mysql+pymysql://aodh:password%@111.111.111.111/aodh' at position 28
2017-11-21 12:19:08.989 17234 ERROR aodh 
-------------------------------------------

AFAIK, using % in the password should be possible. The rest of OpenStack Services are using the very same password without any problem to connect to DB.

[root@server1 ~(keystone_admin)]$ rpm -qa | grep aodh
openstack-aodh-expirer-2.0.5-1.el7ost.noarch
python-aodhclient-0.5.0-1.el7ost.noarch
openstack-aodh-notifier-2.0.5-1.el7ost.noarch
openstack-aodh-compat-2.0.5-1.el7ost.noarch
openstack-aodh-common-2.0.5-1.el7ost.noarch
openstack-aodh-api-2.0.5-1.el7ost.noarch
python-aodh-2.0.5-1.el7ost.noarch
openstack-aodh-listener-2.0.5-1.el7ost.noarch
openstack-aodh-evaluator-2.0.5-1.el7ost.noarch

I also replicated this issue in OSP10

Comment 7 errata-xmlrpc 2018-03-15 12:45:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0540


Note You need to log in before you can comment on or make changes to this bug.