Zun

zun REST API incorrectly says 500 when client incorrectly creates container with nets as an array of strings

Bug #1797656 reported by Jacob Burckhardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Released
Medium
Unassigned

Bug Description

Below I show an HTTP request and response message with status code 500. The response message does not say what the error is and I could not find anything related to this in the systemd journals for zun-api, zun-wsproxy, kuryr-libnetwork, or zun-compute.

Please change the following response from 500 to 400.

Please also change the error message to something like "Error: nets should be an array of objects instead of an array of strings."

Thanks.

POST /v1/containers?run=true HTTP/1.1
Host: pdv-packstack-02:9517
Content-Length: 216
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-327.36.3.el7.x86_64
OpenStack-API-Version: container 1.12
Connection: keep-alive
X-Auth-Token: gAAAAABbwR8539f0L7lVn5SC5GzZr6vyRJ3SPRG7FLJ2Ur6OWG8mJS3XUCNNnWmsaHStsJLgk-sUU_P_MPqQOkNjVoG-L7R6-a5qmA2J4TG9f_sOiXZlqNhmMJv6yK6tuuY-F9DXMNXfFjpsM1jbkkECqpQtB82XHPoFBOJExEorysLKzEQWRps
Content-Type: application/json

{"name": "nto_client5", "image": "nto_client", "command": "dumb-init install/bin/asio-cl2 https://192.168.77.10:9999 README.rst", "image_driver": "glance", "nets": ["private_network"], "security_groups": ["default"]}HTTP/1.1 500 Internal Server Error
Openstack-Api-Minimum-Version: container 1.1
Openstack-Api-Maximum-Version: container 1.12
Openstack-Api-Version: container 1.12
Vary: OpenStack-API-Version
Content-Type: application/json
Content-Length: 261
X-Openstack-Request-Id: req-c6aee26f-7a5f-4ee1-a2cb-947dafc42d81
Date: Fri, 12 Oct 2018 22:24:58 GMT
Connection: keep-alive

{"errors": [{"status": 500, "code": "container.", "links": [], "title": "Internal Server Error", "detail": "Your request could not be handled because of a problem in the server. Error Correlation id is: a28d8d23-812b-4b12-9a05-b9aa2e288483", "request_id": ""}]}

hongbin (hongbin034)
Changed in zun:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zun (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/610282

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zun (stable/queens)

Reviewed: https://review.openstack.org/610282
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=6e71a885429a7ca4553e5cde75b85f42fdcbac87
Submitter: Zuul
Branch: stable/queens

commit 6e71a885429a7ca4553e5cde75b85f42fdcbac87
Author: deepak_mourya <email address hidden>
Date: Wed Feb 28 12:51:43 2018 +0530

    Improve the validation of 'nets' parameter

    This PS will improve the validation for the
    'nets' parameter.

    Change-Id: I3007c412d06ebe9f3494dc07eef4f962ead4d151
    Closes-Bug: #1748811
    Closes-Bug: #1797656
    (cherry picked from commit fa1eed9a79da1eb29e3b9325968e9693616a6016)

tags: added: in-stable-queens
Ji.Wei (jiwei)
Changed in zun:
status: Triaged → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/zun queens-eol

This issue was fixed in the openstack/zun queens-eol 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.