opentelekomcloud-infra / octavia-proxy

Open Telekom Cloud Octavia Proxy
6 stars 0 forks source link

Wrong exception handling for load balancer creation with invalid VIP #90

Open kucerakk opened 3 years ago

kucerakk commented 3 years ago

When I try to create a load balancer with invalid vip IP address (not valid in the used vip_subnet_id), it reports back to client 201 Created, even though in the octavia_proxy logs there are errors like:

Provider 'elbv2' raised an unknown error: IP address 203.0.113.50 is not a valid IP for the specified subnet.:

(octavia-client) [linux@kkucerak-jump ~]$ curl -s -i -X POST -H "$AUTH_TOKEN" -H "Content-Type: application/json" -d '{
    "loadbalancer": {
        "description": "My favorite load balancer",
        "admin_state_up": true,
        "vip_subnet_id": "aa4a6aa9-8670-43aa-bd6a-df39f22d01ad",
                "vip_address": "203.0.113.50",
        "name": "best_load_balancer"
    }
}' http://localhost:9876/v2/lbaas/loadbalancers
HTTP/1.0 201 Created
Date: Thu, 28 Oct 2021 13:39:05 GMT
Server: WSGIServer/0.2 CPython/3.9.6
Content-Length: 22
Content-Type: application/json
x-openstack-request-id: req-bc00edde-2834-4688-adb7-d876dde6d405

{"loadbalancer": null}(octavia-client) [linux@kkucerak-jump ~]$