magnum-api not working with www_authenticate_uri

Bug #1793813 reported by Dr. Clemens Hardewig
24
This bug affects 5 people
Affects Status Importance Assigned to Milestone
magnum (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

For magnum 7.0.1 package (Rockyrelease) the keystone_auth section is inconsistent to the keystone mainstream config

When configuring in /etc/magnum/magnum.conf

auth_uri = https://controller:5000/v3

then the /var/log/magnum-api.log contains a warning

WARNING oslo_config.cfg [-] Deprecated: Option "auth_uri" from group "keystone_authtoken" is deprecated for removal (The auth_uri option is deprecated in favor of www_authenticate_uri and will be removed in the S release.). Its value may be silently ignored in the future.

magnum related openstack cli commands properly work, eg

# openstack coe cluster list
+--------------------------------------+---------------+---------+------------+--------------+---------------+
| uuid | name | keypair | node_count | master_count | status |
+--------------------------------------+---------------+---------+------------+--------------+---------------+
| ae2395b8-8616-4721-b5de-9134472496cb | swarm-cluster | None | 1 | 1 | CREATE_FAILED |
| 5d6651a0-7be4-42ff-ad28-bd93633761c2 | swarm-cluster | None | 1 | 1 | CREATE_FAILED |
+--------------------------------------+---------------+---------+------------+--------------+---------------+

so far so good

BUT: when you configure

www_authenticate_uri = https://controller:5000/v3

(as it should be indeed latest since pike)

Then any kind of openstack cli command with magnum elements fails with

'NoneType' object has no attribute 'replace' (HTTP 500) (Request-ID: req-e6701428-5395-40c4-9b64-f0d4765501e9)

/var/log/magnum/magnum-api.log shows

2018-09-21 21:12:43.436 14212 INFO magnum.cmd.api [-] Starting server in PID 14212
2018-09-21 21:12:43.442 14212 INFO magnum.cmd.api [-] Serving on http://10.0.88.11:9511
2018-09-21 21:12:43.442 14212 INFO magnum.cmd.api [-] Server will handle each request in a new process up to 4 concurrent processes
2018-09-21 21:12:43.443 14212 INFO werkzeug [-] * Running on http://10.0.88.11:9511/ (Press CTRL+C to quit)
2018-09-21 21:13:04.193 14287 ERROR wsme.api [req-dc0a815a-822b-4459-95e6-0c5550670155 - - - - -] Server-side error: "'NoneType' object has no attribute 'replace'". Detail:
Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/wsmeext/pecan.py", line 85, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/magnum/api/controllers/v1/cluster.py", line 329, in get_all
    action='cluster:get_all')

  File "/usr/lib/python2.7/dist-packages/magnum/common/policy.py", line 100, in enforce
    add_policy_attributes(target)

  File "/usr/lib/python2.7/dist-packages/magnum/common/policy.py", line 110, in add_policy_attributes
    trustee_domain_id = admin_osc.keystone().trustee_domain_id

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 179, in trustee_domain_id
    access = self.domain_admin_auth.get_access(

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 145, in domain_admin_auth
    auth_url=self.auth_url,

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 47, in auth_url
    return CONF[ksconf.CFG_LEGACY_GROUP].auth_uri.replace('v2.0', 'v3')

AttributeError: 'NoneType' object has no attribute 'replace'

Note: the entire magnum configuration docs are outdated, the still contain description for port 35357 for keystone

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in magnum (Ubuntu):
status: New → Confirmed
Revision history for this message
Luca Cervigni (cervigni) wrote :

This is affecting queens as well
ii magnum-api 6.1.0-0ubuntu1~cloud0 all OpenStack containers as a service
ii magnum-common 6.1.0-0ubuntu1~cloud0 all OpenStack containers as a service - API server
ii magnum-conductor 6.1.0-0ubuntu1~cloud0 all OpenStack containers as a service - conductor
ii python-magnum 6.1.0-0ubuntu1~cloud0 all OpenStack containers as a service - Python library

2018-10-22 09:17:38.029 4373 ERROR wsme.api [req-eac33901-0e82-48aa-aa15-9e1a491ee393 - - - - -] Server-side error: "'NoneType' object has no attribute 'replace'". Detail:
Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/wsmeext/pecan.py", line 84, in callfunction
    result = f(self, *args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/magnum/api/controllers/v1/cluster_template.py", line 306, in get_all
    action='clustertemplate:get_all')

  File "/usr/lib/python2.7/dist-packages/magnum/common/policy.py", line 100, in enforce
    add_policy_attributes(target)

  File "/usr/lib/python2.7/dist-packages/magnum/common/policy.py", line 110, in add_policy_attributes
    trustee_domain_id = admin_osc.keystone().trustee_domain_id

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 179, in trustee_domain_id
    access = self.domain_admin_auth.get_access(

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 145, in domain_admin_auth
    auth_url=self.auth_url,

  File "/usr/lib/python2.7/dist-packages/magnum/common/keystone.py", line 47, in auth_url
    return CONF[ksconf.CFG_LEGACY_GROUP].auth_uri.replace('v2.0', 'v3')

AttributeError: 'NoneType' object has no attribute 'replace'

Revision history for this message
Nick Jones (yankcrime) wrote :

The upstream fix to this has just landed in master: https://review.openstack.org/#/c/614082/

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.