HTTP 500 when `nova list --name` contains invalid regexp

Bug #1681155 reported by Rene Soto
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Confirmed
Wishlist
Roman Podoliaka

Bug Description

Detailed bug description:
When a Nova CLI command contains a regexp, it fails with HTTP 500 error
Steps to reproduce:
root@node-6:~# nova list --name \*
ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'sqlalchemy.exc.OperationalError'> (HTTP 500) (Request-ID: req-9c59f50c-21cc-4d1b-87d3-6e0d3d5afb3b)

Expected results:
Catch the syntax error in the command before the request is made

Actual result:
Request goes through, and returned with a HTTP 500 error. Nova API log is attached with more details.

Reproducibility:
100%

Workaround:
None

Impact:
Nothing major, but in this case, the HTTP 500 error triggered alerts in the monitoring system.

Description of the environment:
- Operation system: Ubuntu 14.04
- Versions of components: MOS 9.1
- Reference architecture: N/A
- Network model: N/A
- Related projects installed: N/A
Additional information:
N/A

Revision history for this message
Rene Soto (rsoto) wrote :
Revision history for this message
Denis Meltsaykin (dmeltsaykin) wrote :

Roman, could you please take a look? It looks like a general issue of all the versions of novaclient. Though, I'm not sure if it is even possible to "validate" a regular expression, but may be some sort of sanitizing of inputs...

Changed in mos:
assignee: nobody → Roman Podoliaka (rpodolyaka)
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

While we could "validate" (basically re.compile()) a regular expression both on the client side before making a request and on the server side before executing a DB query, that would only give us so much - the problem is that we pass this regular expression to MySQL as is and we can't guarantee that something valid in Python RE is going to be valid in MySQL as well.

I guess, I'd rather let it fail in the DB layer, but catch the exception up the stack, so that we return a proper 400 Bad Request to a user.

Anyway, this sounds like an enhancement request to me. I suggest we give it Wishlist priority and see if we can implement this in upstream (at this point - Pike or Queens).

Changed in mos:
status: New → Confirmed
importance: Undecided → Wishlist
milestone: none → 10.0
tags: added: area-nova enhancement
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.