admin_port not being properly transposed when launching keystone

Bug #1201861 reported by Jeff Lane 
60
This bug affects 12 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Expired
Medium
Unassigned

Bug Description

I noticed this issue while trying to launch devstack. When I got to the point where keystone is supposed to start, it fails to start because of the following traceback:

Traceback (most recent call last):
  File "/opt/stack/keystone/bin/keystone-all", line 112, in <module>
    options = deploy.appconfig('config:%s' % paste_config)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 261, in appconfig
    global_conf=global_conf)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
    global_conf=global_conf)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
    return loader.get_context(object_type, name, global_conf)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 413, in get_context
    defaults = self.parser.defaults()
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 68, in defaults
    defaults[key] = self.get('DEFAULT', key) or val
  File "/usr/lib/python2.7/ConfigParser.py", line 623, in get
    return self._interpolate(section, option, value, d)
  File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 75, in _interpolate
    self, section, option, rawval, vars)
  File "/usr/lib/python2.7/ConfigParser.py", line 669, in _interpolate
    option, section, rawval, e.args[0])
ConfigParser.InterpolationMissingOptionError: Error in file /etc/keystone/keystone.conf: Bad value substitution:
        section: [DEFAULT]
        option : admin_endpoint
        key : admin_port
        rawval : http://192.168.0.100:%(admin_port)s/

If you look at the full debug output, admin_port is clearly identified as 35357:

(keystone-all): 2013-07-16 11:16:02,807 DEBUG cfg log_opt_values admin_endpoint = http://192.168.0.100:%(admin_port)s/
(keystone-all): 2013-07-16 11:16:02,807 DEBUG cfg log_opt_values admin_port = 35357

but the value of admin_port is not being resolved in the %(admin_port)s variable in the admin endpoint url.

See the full debug output here:
http://pastebin.ubuntu.com/5881166/

Including the command line used to generate that output.

The only way to work around this, I've found, is to enusre that instead of %(variable)s in the endpoint definition, the values are hard coded:

admin_endpoint = http://192.168.0.100:35357/
public_endpoint = http://192.168.0.100:5000/

Doing this in keystone.conf, I am able to successfully start keystone.

Dolph Mathews (dolph)
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
Dolph Mathews (dolph) wrote :

Unfortunately, changing the default configuration values won't fix this for existing configurations.

It looks like oslo.config is jumping in to apply the same functionality that we were applying here:

  https://github.com/openstack/keystone/blob/d803277ee06b8f64a520958c655e3cabdbacb97b/keystone/common/controller.py#L208-L210

Revision history for this message
Dolph Mathews (dolph) wrote :

s/oslo.config/paste.deploy/

Revision history for this message
Abishek Subramanian (absubram) wrote :

Is there a workaround for this? I'm hitting this every time now for the last 2 days and I'm not able to proceed.

Revision history for this message
Apurva TN (athippe) wrote :

I hardcoded the admin_port and public_port values in lib/keystone and it works fine for me.

Revision history for this message
Abishek Subramanian (absubram) wrote :

Can you please give me the full path to the file? I don't see a "lib/keystone" in /opst/stack/keystone

Revision history for this message
Andrea Giardini (agiardini) wrote :

I modified the file /etc/keystone/keystone.conf hardcoding admin_port and public_port and now it works

Revision history for this message
Apurva TN (athippe) wrote :

path would be devstack/lib/keystone

Revision history for this message
Sushil Kumar (sushil-kumar2) wrote :

please help me about the how can i change for "redstack install" in rove-integration.

Revision history for this message
yogesh-mehra (yogesh-mehra) wrote :

working around with a temp hack-
1. Edited devstack/lib/keystone to put values for update public_endpoint,cadmin_endpoint with relevant ports.
2. Add read and execute permissions for /usr/local/lib/python2.7/dist-packages/ and
    read permissions for /usr/lib/python2.7/dist-packages/

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

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

Changed in keystone:
assignee: nobody → Dolph Mathews (dolph)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Dolph Mathews (dolph)
Changed in keystone:
milestone: none → havana-3
Dolph Mathews (dolph)
Changed in keystone:
assignee: Dolph Mathews (dolph) → nobody
status: In Progress → Triaged
milestone: havana-3 → none
Revision history for this message
David Stanek (dstanek) wrote :

This appears to work OK in master. I'm using the following config values:

    public_port = 5001
    public_endpoint = http://localhost:%(public_port)s/
    admin_port = 35358
    admin_endpoint = http://localhost:%(admin_port)s/

Are you still having this issue and if you are what branch are you running?

Dolph Mathews (dolph)
Changed in keystone:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Keystone because there has been no activity for 60 days.]

Changed in keystone:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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