OpenStack Identity (Keystone)

admin_port not being properly transposed when launching keystone

Reported by Jeff Lane on 2013-07-16
60
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Keystone
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) on 2013-07-16
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
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

Dolph Mathews (dolph) wrote :

s/oslo.config/paste.deploy/

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.

Apurva TN (athippe) wrote :

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

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

Andrea Giardini (agiardini) wrote :

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

Apurva TN (athippe) wrote :

path would be devstack/lib/keystone

Sushil Kumar (sushil-kumar2) wrote :

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

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/

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

Changed in keystone:
assignee: nobody → Dolph Mathews (dolph)
status: Triaged → In Progress

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

Dolph Mathews (dolph) on 2013-08-23
Changed in keystone:
milestone: none → havana-3
Dolph Mathews (dolph) on 2013-09-03
Changed in keystone:
assignee: Dolph Mathews (dolph) → nobody
status: In Progress → Triaged
milestone: havana-3 → none
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) on 2013-09-18
Changed in keystone:
status: Triaged → Incomplete
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  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers