[OSTF] OSTF reports Internal Server Error if try to get list of test sets for non-existing environment through the REST API

Bug #1624920 reported by Vitalii Kulanov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
New
Undecided
Unassigned

Bug Description

Detailed bug description:
OSTF reports Internal Server Error if try to get list of test sets for non-existing environment through the REST API:

[tivalii@fuel] curl -s -H "X-Auth-Token: $AUTH_TOKEN" http://10.20.0.2:8000/ostf/testsets/3
Internal Server Error

[root@fuel ~]# tail /var/log/ostf.log -n 25
2016-09-18 19:09:15 INFO (connectionpool) Starting new HTTP connection (1): 10.20.0.2
2016-09-18 19:09:15 DEBUG (connectionpool) "GET /api/clusters/3 HTTP/1.1" 404 None
2016-09-18 19:09:15 DEBUG (connectionpool) "GET /api/nodes?cluster_id=3 HTTP/1.1" 200 None
2016-09-18 19:09:15 DEBUG (connectionpool) "GET /api/releases/failed%20to%20get%20id HTTP/1.1" 404 None
2016-09-18 19:09:15 ERROR (hooks) Pecan state <pecan.core.RoutingState object at 0x4f4f790>
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pecan/core.py", line 678, in __call__
    self.invoke_controller(controller, args, kwargs, state)
  File "/usr/lib/python2.7/site-packages/pecan/core.py", line 572, in invoke_controller
    result = controller(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/fuel_plugin/ostf_adapter/wsgi/controllers.py", line 54, in get
    mixins.discovery_check(request.session, cluster, request.token)
  File "/usr/lib/python2.7/site-packages/fuel_plugin/ostf_adapter/mixins.py", line 73, in discovery_check
    cluster_attrs = _get_cluster_attrs(cluster_id, token=token)
  File "/usr/lib/python2.7/site-packages/fuel_plugin/ostf_adapter/mixins.py", line 205, in _get_cluster_attrs
    release_data = REQ_SES.get(release_url).json()
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 812, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib64/python2.7/site-packages/simplejson/__init__.py", line 501, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.7/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/lib64/python2.7/site-packages/simplejson/decoder.py", line 393, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Nailgun logs:

[root@fuel ~]# tail -f /var/log/nailgun/api.log
2016-09-18 19:16:55.321 DEBUG [7ff5962ef880] (logger) Request GET /api/clusters/3 from 10.20.0.2:37428
2016-09-18 19:16:55.332 DEBUG [7ff5962ef880] (logger) Response code '404 Not Found' for GET /api/clusters/3 from 10.20.0.2:37428
2016-09-18 19:16:55.339 DEBUG [7ff5962ef880] (logger) Request GET /api/nodes?cluster_id=3 from 10.20.0.2:37428
2016-09-18 19:16:55.363 DEBUG [7ff5962ef880] (logger) Response code '200 OK' for GET /api/nodes?cluster_id=3 from 10.20.0.2:37428
2016-09-18 19:16:55.370 DEBUG [7ff5962ef880] (logger) Request GET /api/releases/failed%20to%20get%20id from 10.20.0.2:37428
2016-09-18 19:16:55.373 DEBUG [7ff5962ef880] (logger) Response code '404 Not Found' for GET /api/releases/failed%20to%20get%20id from 10.20.0.2:37428

Reproducibility:
Always

Description of the environment:
[root@fuel ~]# shotgun2 short-report
cat /etc/fuel_build_id:
 667
cat /etc/fuel_build_number:
 667
cat /etc/fuel_release:
 10.0
cat /etc/fuel_openstack_version:
 newton-10.0

Revision history for this message
Roman Sokolkov (rsokolkov) wrote :

This is either fuelclient bug or Nailgun.

Fuel API returns None for many calls, but fuelclient always expects JSON.

tags: added: module-client
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-nailgun-extension-cluster-upgrade (stable/mitaka)

Reviewed: https://review.openstack.org/403909
Committed: https://git.openstack.org/cgit/openstack/fuel-nailgun-extension-cluster-upgrade/commit/?id=5b8392298aba043c6192c12ab0de5fa38836cf64
Submitter: Jenkins
Branch: stable/mitaka

commit 5b8392298aba043c6192c12ab0de5fa38836cf64
Author: Ilya Kharin <email address hidden>
Date: Tue Nov 29 00:17:00 2016 +0300

    Return a list of nodes on reprovision=false

    Unfortunetely, a type of response depends on inputs and that's what we
    have right now. By spending more time we can split this handle on two
    handlers to have more clear API for clients. But right now this patch
    fixes the problem with the response in NodeReassignHandler.

    Partial-bug: #1624920

    Change-Id: I896636fd78502318cdbbf92dd312b87fc23a3c41

tags: added: in-stable-mitaka
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.