All latest (0.14.0) client v2 requests broken when querying any Glance server which is not running head of tree code

Bug #1367326 reported by Stuart McLaren
30
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Critical
Unassigned

Bug Description

When the 0.14.0 client is run against a glance server which is not head of tree the following exception is raised:

2014-09-09 13:08:59.606 DEBUG curl -i -X GET -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: ***' -H 'Content-Type: application/octet-stream' http://10.22.152.47:9292/v2/schemas/metadefs/resource_type log_curl_request /opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/common/http.py:119
2014-09-09 13:08:59.621 ERROR Request returned failure status 404.
2014-09-09 13:08:59.624 CRITICAL HTTPNotFound: <html>
 <head>
  <title>404 Not Found</title>
 </head>
 <body>
  <h1>404 Not Found</h1>
  The resource could not be found.<br /><br />

 </body>
</html> (HTTP 404)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller Traceback (most recent call last):
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/usr/local/bin/dnsaas-installer", line 10, in <module>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller sys.exit(main())
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/dnsaasinstaller/shell.py", line 113, in main
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller fn(*fn_args)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/dnsaasinstaller/cmd/validate.py", line 84, in main
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller engine.run()
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 89, in run
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller for _state in self.run_iter():
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/taskflow/engines/action_engine/engine.py", line 137, in run_iter
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller misc.Failure.reraise_if_any(failures.values())
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/taskflow/utils/misc.py", line 797, in reraise_if_any
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller failures[0].reraise()
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/taskflow/utils/misc.py", line 804, in reraise
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller six.reraise(*self._exc_info)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/taskflow/engines/action_engine/executor.py", line 34, in _execute_task
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller result = task.execute(**arguments)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/installator/flows/validators.py", line 30, in execute
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller client = self.get_glance_client(credentials)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/installator/flows/base.py", line 109, in get_glance_client
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller insecure=credentials['glance']['insecure'],
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/client.py", line 22, in Client
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller return client_class(*args, **kwargs)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/v2/client.py", line 48, in __init__
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller resource_type_model = self._get_metadefs_resource_type_model()
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/v2/client.py", line 78, in _get_metadefs_resource_type_model
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller schema = self.schemas.get('metadefs/resource_type')
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/v2/schemas.py", line 84, in get
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller _, raw_schema = self.http_client.get(uri)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 253, in get
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller return self._request('GET', url, **kwargs)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller File "/opt/stack/venvs/dnsaas-installer/local/lib/python2.7/site-packages/glanceclient/common/http.py", line 221, in _request
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller raise exc.from_response(resp, resp.content)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller HTTPNotFound: <html>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller <head>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller <title>404 Not Found</title>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller </head>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller <body>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller <h1>404 Not Found</h1>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller The resource could not be found.<br /><br />
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller </body>
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller </html> (HTTP 404)
2014-09-09 13:08:59.624 1830 TRACE dnsaasinstaller

summary: - metadef exception when client run against older server
+ metadef exception when client run against older server's v2 api
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote : Re: metadef exception when client run against older server's v2 api

To reproduce:

 $ ./.tox/py27/bin/glance --verbose --os-image-api-version 2 image-list
 No handlers could be found for logger "glanceclient.common.http"
 Request returned failure status 404.
 <html>
  <head>
   <title>404 Not Found</title>
  </head>
  <body>
   <h1>404 Not Found</h1>
   The resource could not be found.<br /><br />

  </body>
 </html> (HTTP 404)

versus:

 $ ./.tox/py27/bin/glance --verbose --os-image-api-version 1 image-list
 +--------------------------------------+---------------------------------+-------------+------------------+------------+--------+
 | ID | Name | Disk Format | Container Format | Size | Status |
 +--------------------------------------+---------------------------------+-------------+------------------+------------+--------+
 | 3def22ed-e2eb-4575-b242-8704517e95d7 | cirros-0.3.2-x86_64-uec | ami | ami | 25165824 | active |
 | ca34f1b7-a839-474f-a16b-34779c65905c | cirros-0.3.2-x86_64-uec-kernel | aki | aki | 4969360 | active |

summary: - metadef exception when client run against older server's v2 api
+ All v2 client requests broken when querying any Glance server which is
+ not running head of tree code
Changed in python-glanceclient:
importance: Undecided → Critical
summary: - All v2 client requests broken when querying any Glance server which is
- not running head of tree code
+ All latest (0.14.0) client v2 requests broken when querying any Glance
+ server which is not running head of tree code
Revision history for this message
Stuart McLaren (stuart-mclaren) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-glanceclient (master)

Change abandoned by Stuart McLaren (<email address hidden>) on branch: master
Review: https://review.openstack.org/120143
Reason: Abandoning in favour of https://review.openstack.org/#/c/120300

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

Reviewed: https://review.openstack.org/120300
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=97b1506bdbccea9fbfcac731cf8b7e0cadebcbab
Submitter: Jenkins
Branch: master

commit 97b1506bdbccea9fbfcac731cf8b7e0cadebcbab
Author: Lakshmi N Sampath <email address hidden>
Date: Tue Sep 9 14:51:14 2014 -0700

    Fix v2 requests to non-bleeding edge servers

    In the case where v2 requests are sent to a server which is not running
    head of tree which includes the v2 metadef code some 404 cases need to
    be handled to enable standard requests to complete.

    This patch aslo improves fetching schemas -- they are now only
    fetched as needed.

    Change-Id: I8c871f11b909337bd7df19b77e606772dbc634b2
    Closes-bug: #1367326

Changed in python-glanceclient:
status: New → Fix Committed
Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
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.