TypeError occurred when get resource list

Bug #1706490 reported by zhuli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sahara
Fix Released
Undecided
zhuli

Bug Description

Get resource list with limit,marker,name specified where marker and name point to different resources,
because marker doesn't in the candidate resources filtered by name values
during prev/next marker picking progress, then error occurs

for example:

$ curl -g -i -X GET 'http://10.76.6.11:8386/v1.1/b05a0d64868946769200d5e0ad8b2aab/node-group-templates?limit=2&marker=343eaffb-1692-49c3-afde-b0907485cfdc&name=cdh' -H "User-Agent: python-saharaclient" -H "X-Auth-Token: 2235b4972d634979aa56b05cb725120a"

HTTP/1.1 500 INTERNAL SERVER ERROR
Content-Type: application/json
Content-Length: 100
X-Openstack-Request-Id: req-aa82e751-3894-42ac-8573-f9d1adce3e4f
Date: Wed, 26 Jul 2017 03:04:26 GMT

{"error_name": "INTERNAL_SERVER_ERROR", "error_message": "Internal Server Error", "error_code": 500}

Traceback (most recent call last):
  File "/opt/stack/sahara/sahara/utils/api.py", line 97, in handler
    return func(**kwargs)
  File "/opt/stack/sahara/sahara/api/acl.py", line 43, in handler
    return func(*args, **kwargs)
  File "/opt/stack/sahara/sahara/service/validation.py", line 196, in handler
    return func(*args, **kwargs)
  File "/opt/stack/sahara/sahara/service/validation.py", line 160, in handler
    return func(*args, **kwargs)
  File "/opt/stack/sahara/sahara/api/v10.py", line 155, in node_group_templates_list
    **u.get_request_args().to_dict())
  File "/opt/stack/sahara/sahara/service/api/v10.py", line 197, in get_node_group_templates
    regex_search=True, **kwargs)
  File "/opt/stack/sahara/sahara/conductor/resource.py", line 42, in handle
    ret = func(*args, **kwargs)
  File "/opt/stack/sahara/sahara/conductor/api.py", line 245, in node_group_template_get_all
    context, regex_search, **kwargs)
  File "/opt/stack/sahara/sahara/conductor/manager.py", line 371, in node_group_template_get_all
    regex_search, **kwargs)
  File "/opt/stack/sahara/sahara/db/api.py", line 95, in decorator
    res = func(*args, **kwargs)
  File "/opt/stack/sahara/sahara/db/api.py", line 273, in node_group_template_get_allJul 25 23:04:26 sahara sahara-api[24634]: return IMPL.node_group_template_get_all(context, regex_search, **kwargs)
  File "/opt/stack/sahara/sahara/db/sqlalchemy/api.py", line 654, in node_group_template_get_all
    limit, marker, order=order)
  File "/opt/stack/sahara/sahara/db/sqlalchemy/api.py", line 85, in _get_prev_and_next_objects
    if position - limit >= 0:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'

zhuli (zhuli)
Changed in sahara:
assignee: nobody → zhuli (zhuli)
Changed in sahara:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/487264
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=0921792d9377ecc5ef465bb441f870c3adc54d52
Submitter: Jenkins
Branch: master

commit 0921792d9377ecc5ef465bb441f870c3adc54d52
Author: zhuli <email address hidden>
Date: Wed Jul 26 11:16:22 2017 +0800

    Fix TypeError when get resource list

    Fix TypeError when get resource list where marker doesn't in the
    candidate resources during prev/next marker picking progress.

    Change-Id: I29876b90f0784a36efa4d4e83f3ee23e8235f9fa
    Closes-Bug: #1706490

Changed in sahara:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/sahara 7.0.0.0rc1

This issue was fixed in the openstack/sahara 7.0.0.0rc1 release candidate.

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.