[nailgun] Nailgun returns Internal Server Error 500 while trying to get the list of 'openstack_config' with specified node ids

Bug #1602937 reported by Vitalii Kulanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Georgy Kibardin
Mitaka
Fix Released
High
Georgy Kibardin

Bug Description

Detailed bug description:
If we try to get the list of 'openstack_config' (through the python-fuelclient) for some, not even existing, environment with node params Nailgun returns '500 Server Error: Internal Server Error':

[root@fuel ~]# fuel2 openstack-config list --env 1 --node 1 2
500 Server Error: Internal Server Error for url: http://10.20.0.2:8000/api/v1/openstack-config/?cluster_id=1&is_active=True&node_ids=1%2C2 (Unexpected exception, please check logs)

Here is a log for Nailgun:

[root@fuel ~]# tail /var/log/nailgun/app.log -n 15
............
2016-07-14 05:02:47.827 ERROR [7fc2d98de880] (base) Unexpected exception occured
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nailgun/api/v1/handlers/base.py", line 287, in content_json
    resp = func(cls, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/nailgun/api/v1/handlers/openstack_config.py", line 45, in GET
    objects.OpenstackConfigCollection.filter_by(None, **data))
  File "/usr/lib/python2.7/site-packages/nailgun/objects/base.py", line 271, in filter_by
    return use_iterable.filter_by(**kwargs)
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/query.py", line 1510, in filter_by
    for key, value in kwargs.items()]
  File "/usr/lib64/python2.7/site-packages/sqlalchemy/orm/base.py", line 383, in _entity_descriptor
    (description, key)
InvalidRequestError: Entity '<class 'nailgun.db.sqlalchemy.models.openstack_config.OpenstackConfig'>' has no property 'node_ids'
..............

Steps to reproduce:
1. Deploy Fuel (e.g. 1 master + 5 nodes).
2. DO NOT create any environments.
3. Try to get the list of 'openstack_config' (through the python-fuelclient) for some, not even existing, environment with node params:
   fuel2 openstack-config list --env 1 --node 1 2
   or
   fuel openstack-config --list --env 1 --node 1,2

Expected results:
   Empty result (or 404 Not Found)

Actual result:
 500 Server Error: Internal Server Error for url: http://10.20.0.2:8000/api/v1/openstack-config/?is_active=1&cluster_id=5&node_ids=1%2C2 (Unexpected exception, please check logs)

Reproducibility:
Always

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

no longer affects: fuel/newton
Revision history for this message
Vitalii Kulanov (vitaliy-t) wrote :

@Maksim this bug is reproduced in ISO 410:
15 Jul 2016 11:40:49 fuel-10.0-community-410-2016-07-15_11-14-00

[root@fuel ~]# shotgun2 short-report
cat /etc/fuel_build_id:
 410
cat /etc/fuel_build_number:
 410
cat /etc/fuel_release:
 10.0
cat /etc/fuel_openstack_version:
 newton-10.0
rpm -qa | egrep 'fuel|astute|network-checker|nailgun|packetary|shotgun':
 fuelmenu-10.0.0-1.mos290.noarch
 fuel-agent-10.0.0-1.mos308.noarch
 fuel-migrate-10.0.0-1.mos8658.noarch
 shotgun-10.0.0-1.mos93.noarch
 fuel-notify-10.0.0-1.mos8658.noarch
 fuel-release-10.0.0-1.mos6367.noarch
 fuel-openstack-metadata-10.0.0-1.mos8857.noarch
 fuel-ostf-10.0.0-1.mos947.noarch
 fuel-setup-10.0.0-1.mos6367.noarch
 rubygem-astute-10.0.0-1.mos765.noarch
 python-fuelclient-10.0.0-1.mos356.noarch
 network-checker-10.0.0-1.mos77.x86_64
 fuel-utils-10.0.0-1.mos8658.noarch
 fuel-nailgun-10.0.0-1.mos8857.noarch
 nailgun-mcagents-10.0.0-1.mos765.noarch
 fuel-misc-10.0.0-1.mos8658.noarch
 fuel-library10.0-10.0.0-1.mos8658.noarch
 fuel-ui-10.0.0-1.mos2835.noarch
 fuel-10.0.0-1.mos6367.noarch
 fuel-bootstrap-cli-10.0.0-1.mos308.noarch

Dmitry Pyzhov (dpyzhov)
tags: added: 9.1-proposed
Changed in fuel:
assignee: Fuel Sustaining (fuel-sustaining-team) → Georgy Kibardin (gkibardin)
Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/347159

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

Reviewed: https://review.openstack.org/347159
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=8daeb5974fd9eb3d4d139bac8cdb25786c4339dc
Submitter: Jenkins
Branch: master

commit 8daeb5974fd9eb3d4d139bac8cdb25786c4339dc
Author: Georgy Kibardin <email address hidden>
Date: Tue Jul 26 10:16:45 2016 +0300

    node_ids parameter is interpreted correctly

    node_ids parameter cannot be passed to the filter_by() as is so
    filter_by_list is used instead.

    Change-Id: Ic8561a737347d804deddd8276e8299b23a58a523
    Closes-Bug: #1602937

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/356069

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/mitaka)

Reviewed: https://review.openstack.org/356069
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=3f4dc2e1f4bf55f466d06c4dfe62becc948fc895
Submitter: Jenkins
Branch: stable/mitaka

commit 3f4dc2e1f4bf55f466d06c4dfe62becc948fc895
Author: Georgy Kibardin <email address hidden>
Date: Tue Jul 26 10:16:45 2016 +0300

    node_ids parameter is interpreted correctly

    node_ids parameter cannot be passed to the filter_by() as is so
    filter_by_list is used instead.

    Change-Id: Ic8561a737347d804deddd8276e8299b23a58a523
    Closes-Bug: #1602937
    (cherry picked from commit 8daeb5974fd9eb3d4d139bac8cdb25786c4339dc)

tags: added: on-verification
Revision history for this message
Tatyana Kuterina (tkuterina) wrote :

Verified on 9.1 snapshot #165

tags: removed: on-verification
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 10.0.0rc1

This issue was fixed in the openstack/fuel-web 10.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/fuel-web 10.0.0

This issue was fixed in the openstack/fuel-web 10.0.0 release.

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.