Nailgun returns 500 if plugin tries to reserve more VIPs than available in the pool

Bug #1499289 reported by Ihor Kalnytskyi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
High
Ihor Kalnytskyi
7.0.x
Won't Fix
High
Ihor Kalnytskyi

Bug Description

(extracted from here https://bugs.launchpad.net/fuel/+bug/1484181/comments/3)

Also reproduced in the case when number of reserved vips in network_roles.yaml (http://paste.openstack.org/show/414041/)
bigger then number of accessible public addresses in the pool.

{"build_id": "2015-08-12_17-24-26", "build_number": "165", "release_versions": {"2015.1.0-7.0": {"VERSION": {"build_id": "2015-08-12_17-24-26", "build_number": "165", "api": "1.0", "fuel-library_sha": "1176b634eeafb8465a88ff357fdcf40005fba610", "nailgun_sha": "68642a8207d6f12543f244bab0c130e2510536ee", "feature_groups": ["mirantis"], "fuel-nailgun-agent_sha": "e01693992d7a0304d926b922b43f3b747c35964c", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "57145b1d8804389304cd04322ba0fb3dc9d30327", "production": "docker", "python-fuelclient_sha": "26fc025e0fc5791b62e5ed8561a6016bf8a406bc", "astute_sha": "e1d3a435e5df5b40cbfb1a3acf80b4176d15a2dc", "fuel-ostf_sha": "58220583f10fa47f12291488ef77854809c68310", "release": "7.0", "fuelmain_sha": "67e5214c0dc5d4ba6da4ae651cef9934800459a9"}}}, "auth_required": true, "api": "1.0", "fuel-library_sha": "1176b634eeafb8465a88ff357fdcf40005fba610", "nailgun_sha": "68642a8207d6f12543f244bab0c130e2510536ee", "feature_groups": ["mirantis"], "fuel-nailgun-agent_sha": "e01693992d7a0304d926b922b43f3b747c35964c", "openstack_version": "2015.1.0-7.0", "fuel-agent_sha": "57145b1d8804389304cd04322ba0fb3dc9d30327", "production": "docker", "python-fuelclient_sha": "26fc025e0fc5791b62e5ed8561a6016bf8a406bc", "astute_sha": "e1d3a435e5df5b40cbfb1a3acf80b4176d15a2dc", "fuel-ostf_sha": "58220583f10fa47f12291488ef77854809c68310", "release": "7.0", "fuelmain_sha": "67e5214c0dc5d4ba6da4ae651cef9934800459a9"}

description: updated
summary: - fgfg
+ Nailgun returns 500 if plugin tries to reserve more VIPs than available
+ in the pool
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Ok, the reason is obvious: OutOfIPs exception is thrown, it hasn't been catched.. and here we are - 500 internal error.

Obviously, we MUST return something more meaningful, like 400 Bad Request with proper error message. But that won't help from all the problem, since fuel UI won't be able to update network configuration and won't allow us to preview our cluster.

It looks like we should forbid to enable Plugins if it requires more VIPs than we have in the pool, but which pool we should check? With network templating we can re-assign network role to any network, so checking it agains default network is a wrong approach.

Guys, could someone suggest something another?

Revision history for this message
Evgeniy L (rustyrobot) wrote :

Not enabling plugin if there is not enough ips looks like a good approach, but as you said it will be tricky to check, I think we should get Ivan K, or Alexey K, to write what they think about it.

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/228800

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/228800
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=f7fb05d0cd2f6ed148b175d9fdb641757310fdb9
Submitter: Jenkins
Branch: master

commit f7fb05d0cd2f6ed148b175d9fdb641757310fdb9
Author: Igor Kalnitsky <email address hidden>
Date: Mon Sep 28 15:44:39 2015 +0300

    Throw 400 Bad Request in case of not enough IPs

    Since Fuel 7.0 we have network role entities, and plugins are allowed to
    export them. Network role itself could define requirements for the
    network, such as amount of VIPs it requires. If network has not enough
    free IP addresses the '500 Internal Server' has been raised when
    retrieve network configuration. So let's return '400 Bad Request' with
    proper error message in this case.

    Partial-Bug: #1499289

    Change-Id: I299d29de16c911a4b4740a2b70abcb680df90c98
    Signed-off-by: Igor Kalnitsky <email address hidden>

Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Ok, backen returns a 400 Bad Request now in this case. The story about how to handle properly errors on UI is moved to another bug #1504572.

Moving to Fix Commited so.

Changed in fuel:
status: In Progress → Fix Committed
Dmitry Pyzhov (dpyzhov)
tags: added: area-python
Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Won't Fix in 7.0-updates as the fix is improving exception handling by throwing more relevant exception but customer impact is the same

Revision history for this message
Tatyanka (tatyana-leontovich) wrote :

verifided VERSION:
  feature_groups:
    - mirantis
  production: "docker"
  release: "8.0"
  api: "1.0"
  build_number: "466"
  build_id: "466"
  fuel-nailgun_sha: "f81311bbd6fee2665e3f96dcac55f72889b2f38c"
  python-fuelclient_sha: "4f234669cfe88a9406f4e438b1e1f74f1ef484a5"
  fuel-agent_sha: "6823f1d4005a634b8436109ab741a2194e2d32e0"
  fuel-nailgun-agent_sha: "b2bb466fd5bd92da614cdbd819d6999c510ebfb1"
  astute_sha: "b81577a5b7857c4be8748492bae1dec2fa89b446"
  fuel-library_sha: "fe03d887361eb80232e9914eae5b8d54304df781"
  fuel-ostf_sha: "ab5fd151fc6c1aa0b35bc2023631b1f4836ecd61"
  fuel-mirror_sha: "b62f3cce5321fd570c6589bc2684eab994c3f3f2"
  fuelmenu_sha: "fac143f4dfa75785758e72afbdc029693e94ff2b"
  shotgun_sha: "63645dea384a37dde5c01d4f8905566978e5d906"
  network-checker_sha: "9f0ba4577915ce1e77f5dc9c639a5ef66ca45896"
  fuel-upgrade_sha: "616a7490ec7199f69759e97e42f9b97dfc87e85b"
  fuelmain_sha: "727f7076f04cb0caccc9f305b149a2b5b5c2af3a"

Changed in fuel:
status: Fix Committed → Fix Released
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.