[dashboard] UI fails to report 400 api errors on malformed packages

Bug #1423844 reported by Kirill Zaitsev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Murano
Fix Released
Medium
Unassigned

Bug Description

To reproduce:

create a package like this `zip foo.zip *` (NOTE: no -r switch, so the directories inside archive are empty) and upload it.
dashboard would consider the package valid and pass it on to api, which it turn would return 400 (after raising PackageClassLoadError: Unable to load class "io.xxx.yyy.zzz" from package: File with class definition not found)

dashboard (or api) seem to treat this kind of 400 and 500 errors differently, after 500 exception.details contains html-string of the body of 500 response, while after 400 it contains a json-string with stacktrace and error description. It would be nice to unify this kind of behaviour.

On a side not it is also very likely that exception handling code from dashboard would break after translating, as it converts the body of the 500 response to str() which might cause problems after translation.

Revision history for this message
Andrew Pashkin (apashkin) wrote :

I don't understand - what do you consider as the bug in situation with the package?

On 500 vs other codes error handling - this makes sense, because when server completely gets down, it might not return JSON, it might return anything - so it is reasonable to pass this directly as an output.

By the way - Horizon has some configuration options to define how different exceptions must be handled:
https://github.com/openstack/horizon/blob/f112869e8b18d3c0835e75c9776b084a2fd2ca1b/openstack_dashboard/settings.py#L67-67

Revision history for this message
Kirill Zaitsev (kzaitsev) wrote :

I consider the fact, that any non-500 error message would not be shown to the user to be a bug. In my example 500 error message gets parsed and shown to the user, while 400 error message is not parsed and default error message is shown to the user.

Revision history for this message
Timur Nurlygayanov (tnurlygayanov) wrote :

We should show the correct error messages which can help to understand what the problem is and how it can be fixed.

Changed in murano:
importance: Undecided → Medium
Changed in murano:
milestone: none → kilo-3
status: New → Fix Committed
status: Fix Committed → Confirmed
Changed in murano:
milestone: kilo-3 → kilo-rc1
Revision history for this message
Kirill Zaitsev (kzaitsev) wrote :

The bug is fixed in current master

Changed in murano:
status: Confirmed → Fix Released
status: Fix Released → Fix Committed
Changed in murano:
status: Fix Committed → Fix Released
Changed in murano:
milestone: kilo-rc1 → 2015.1.0
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.