Multiple errors across the UI appear as json strings

Bug #1819628 reported by Steve Rydz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Medium
Unassigned
maas-ui
Triaged
Medium
Unassigned

Bug Description

When enabling DHCP or relaying VLAN, if there is an error, for example enabling DHCP without specifying a primary rack or relaying VLAN to an invalid VLAN the error comes back as a JSON string.

Screenshot: https://images.zenhubusercontent.com/5a9d4ee34b5806bc2bc9694d/14579fd7-4019-465f-b1ae-e9c5984aebf6

It's not possible to simply parse this client side as the key isn't always the same. I have seen it as `__relay__` rather than `__all__`, and other times it's been just a string.

Ideally a string will always be returned, otherwise if a JSON response is necessary it should be consistent so it can be parsed client side.

Changed in maas:
status: New → Triaged
Revision history for this message
Andres Rodriguez (andreserl) wrote :

This is an error across all of the UI. This is because the API returns a json string but the error handling on the UI doesn't deal with that correctly.

Changed in maas:
importance: Undecided → Low
milestone: none → 2.6.0alpha2
summary: - DHCP errors appear as JSON string
+ [UI] Multiple errors across the UI appear as json strings
Changed in maas:
importance: Low → Undecided
milestone: 2.6.0alpha2 → 2.6.0
Revision history for this message
Steve Rydz (steverydz) wrote : Re: [UI] Multiple errors across the UI appear as json strings

The errors come back to the UI as either a string or a JSON string so it's unpredictable, and in the case that it is a JSON string the format is inconsistent e.g. `__relay__` as a key in one case, `__all__` in another as examples.

tags: added: error-surface
summary: - [UI] Multiple errors across the UI appear as json strings
+ Multiple errors across the UI appear as json strings
Changed in maas:
importance: Undecided → Medium
milestone: 2.6.0 → 3.5.0
Revision history for this message
Thorsten Merten (thorsten-merten) wrote :

Might be a frontend, an inconsistency how errors communicated or a mix of both

Changed in maas-ui:
importance: Undecided → Medium
milestone: none → 3.5.0
status: New → Triaged
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.