%(tenant_id)s returned in API response

Bug #1409846 reported by Elliott Davis
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Unassigned

Bug Description

When running nova --debug list I get a list of servers, as expected. However, in the API response the string %(teanant_id)s is returned as part of the URL:

{
         "OS-EXT-STS:task_state":null,
         "addresses":{
            "172.16.0.0/16":[
               {
                  "OS-EXT-IPS-MAC:mac_addr":"fa:16:3e:9e:2f:84",
                  "version":4,
                  "addr":"172.16.2.194",
                  "OS-EXT-IPS:type":"fixed"
               }
            ]
         },
         "links":[
            {
               "href":"http://x.x.x.x:8774/v2/%(tenant_id)s/v2/8fb83ba43aad454e8214aaf00d7c5781/servers/9d2b996e-c0de-4de6-9fe7-0d2b6d12e008",
               "rel":"self"
            },
            {
               "href":"http://x.x.x.x:8774/v2/%(tenant_id)s/8fb83ba43aad454e8214aaf00d7c5781/servers/9d2b996e-c0de-4de6-9fe7-0d2b6d12e008",
               "rel":"bookmark"
            }
         ],
         "image":{
            "id":"a93a8797-ff58-472d-991f-4257e2ce0e38",
            "links":[
               {
                  "href":"http://x.x.x.x:8774/v2/%(tenant_id)s/8fb83ba43aad454e8214aaf00d7c5781/images/a93a8797-ff58-472d-991f-4257e2ce0e38",
                  "rel":"bookmark"
               }
            ]
         },
         "OS-EXT-STS:vm_state":"stopped",
         "OS-EXT-SRV-ATTR:instance_name":"instance-000002b7",
         "OS-SRV-USG:launched_at":"2015-01-09T21:30:42.000000",
         "flavor":{
            "id":"f40b9006-57e1-41b0-85f1-5d3c1e3c9f01",
            "links":[
               {
                  "href":"http://x.x.x.x:8774/v2/%(tenant_id)s/8fb83ba43aad454e8214aaf00d7c5781/flavors/f40b9006-57e1-41b0-85f1-5d3c1e3c9f01",
                  "rel":"bookmark"
               }
            ]
         },
         "id":"9d2b996e-c0de-4de6-9fe7-0d2b6d12e008",
         "security_groups":[
            {
               "name":"default"
            }
         ],
         "user_id":"7ffb93b05a47416f857670595215cf28",
         "OS-DCF:diskConfig":"MANUAL",
         "accessIPv4":"",
         "accessIPv6":"",
         "OS-EXT-STS:power_state":4,
         "OS-EXT-AZ:availability_zone":"nova",
         "config_drive":"",
         "status":"SHUTOFF",
         "updated":"2015-01-09T21:33:26Z",
         "hostId":"a5375d976c9b63a11a32588abec4548037279c2ed758db08ac9bb29e",
         "OS-EXT-SRV-ATTR:host":"hypervisor02b",
         "OS-SRV-USG:terminated_at":null,
         "key_name":null,
         "OS-EXT-SRV-ATTR:hypervisor_hostname":"hypervisor02b",
         "name":"Foo",
         "created":"2015-01-09T21:30:35Z",
         "tenant_id":"8fb83ba43aad454e8214aaf00d7c5781",
         "os-extended-volumes:volumes_attached":[

         ],
         "metadata":{

         }
      }

Keystone endpoint-list looks like:

8a90df89c7f94465aed159cc5dbe156e | Houston | http://x.x.x.x:8774/v2/%(tenant_id)s | http://x.x.x.x:8774/v2/%(tenant_id)s | http://x.x.x.x:8774/v2/%(tenant_id)s | bb130706320945cebaffb86787913c45

Nova endpoints returns:

+-------------+-------------------------------------------------------------+
| nova | Value |
+-------------+-------------------------------------------------------------+
| adminURL | http://x.x.x.x:8774/v2/8fb83ba43aad454e8214aaf00d7c5781 |
| id | 71927fe5105d43e1a555892778d6c081 |
| internalURL | http://x.x.x.x:8774/v2/8fb83ba43aad454e8214aaf00d7c5781 |
| publicURL | http://x.x.x.x:8774/v2/8fb83ba43aad454e8214aaf00d7c5781 |
| region | Houston |
| serviceName | nova |
+-------------+-------------------------------------------------------------+

I am running a straight package install on ubuntu 14.04. The cinder API with the same string matcher seems to be working as expected.

Tags: api
melanie witt (melwitt)
tags: added: api
Revision history for this message
Liyingjun (liyingjun) wrote :

Can't reproduce the bug, seems like you should replace '%(tenant_id)s' with '$(tenant_id)s' in the endpoint.

Revision history for this message
Elliott Davis (elliott-davis) wrote :

Just tried replacing the keystone endpoint with '$(tenant_id)s'. The url returned is still '%(tenant_id)s' which I find curious.

Revision history for this message
Padmakanth (padmakanth-chandrapati) wrote :

Can't reproduce the bug ? Please help me how to produce error lines?

Revision history for this message
Elliott Davis (elliott-davis) wrote :

To reproduce:

1) set osapi_compute_link_prefix = http://<hostname>:<port>/v2/%(tenant_id)s
2) restart the nova-api-os-compute service
3) run nova --debug list to verify broken links

Revision history for this message
Joe Gordon (jogo) wrote :

You are setting osapi_compute_link_prefix incorrectly, why are you setting this in the first place. Since this isn't a bug you should use ask.openstack.org for support.

Changed in nova:
status: New → Invalid
Revision history for this message
Matt Riedemann (mriedem) wrote :

This should probably be a docs bug, it seems there is confusion around when you'd use osapi_compute_link_prefix and if you use it, if you should update anything in keystone.

Revision history for this message
Matt Riedemann (mriedem) wrote :

If you're using chef cookbooks to deploy openstack, the problem might be with this change:

https://github.com/stackforge/cookbook-openstack-compute/commit/a8c79c8f846bf137df801f81ca1616a7e611b478

Where it defaults osapi_compute_link_prefix to the nova endpoint URL which I think is wrong since that's a full URL, not a prefix as this is intended to be used.

Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
Elliott Davis (elliott-davis) wrote :

This does appear to be a problem with the way the chef cookbooks set up that config option. I would say this is safe to close and it can be addressed on the chef side.

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.