glance.registry.db.api does not support + as a special character for database password

Bug #1075676 reported by Daneyon Hansen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Wishlist
Brian Waldon
Grizzly
Fix Released
Wishlist
Brian Waldon

Bug Description

Here is what I from Glance:

Glance works just fine with password glance_pass

root@control01:~# glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
522d08d7-e748-42c1-917c-5db9180fe5da precise

I change the db password to glance+pass and mysql accepts the new password:

root@control01:~# mysql -h192.168.220.41 -uglance -pglance+pass glance
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 69647
Server version: 5.5.23 Source distribution, wsrep_23.6.r3755

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

I change the password in glance-registry.conf:

root@control01:~# grep mysql /etc/glance/glance-registry.conf
sql_connection = mysql://glance:glance+pass@192.168.220.41/glance

The service fails to restart

root@control01:~# service glance-registry restart
stop: Unknown instance:
glance-registry start/running, process 5486

root@control01:~# service glance-registry status
glance-registry stop/waiting

The registry log shows the password not being accepted

root@control01:~# tail -f /var/log/glance/registry.log
2012-11-06 17:52:36 5545 ERROR [glance.registry.db.api] Error configuring registry database with supplied sql_connection 'mysql://glance:glance+pass@192.168.220.41/glance'. Got error:
(OperationalError) (1045, "Access denied for user 'glance'@'control01' (using password: YES)") None None
2012-11-06 17:52:37 5552 ERROR [glance.registry.db.api] Error configuring registry database with supplied sql_connection 'mysql://glance:glance+pass@192.168.220.41/glance'. Got error:

Revision history for this message
Brian Waldon (bcwaldon) wrote :

I remember seeing this resolved somewhere (maybe the mailing list), but I'll reiterate what the solution was:

you need to urlencode your password before passing it to sqlalchemy

I'll make a note of this in the glance docs

Changed in glance:
assignee: nobody → Brian Waldon (bcwaldon)
status: New → In Progress
importance: Undecided → Wishlist
milestone: none → grizzly-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/16323

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

Reviewed: https://review.openstack.org/16323
Committed: http://github.com/openstack/glance/commit/5acfb0cb69d4ce9db4f0207c114262ea40cc374c
Submitter: Jenkins
Branch: master

commit 5acfb0cb69d4ce9db4f0207c114262ea40cc374c
Author: Brian Waldon <email address hidden>
Date: Fri Nov 16 10:39:03 2012 -0800

    Add note about urlencoding the sql_connection config opt

    Fixes bug 1075676.

    Change-Id: Ib4149277b6ec060350a3a01496e3b01c26c19181

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
Daneyon Hansen (danehans) wrote :

Glance shows inconsistent behavior for url encoding the db password when compared to Keystone, Nova, etc.. Glance requires and additional % which is an operational pain. This is also identified in bug 1043662.

Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
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.