[2.x] Storing settings over the UI uses different form than API, which could cause API fields to be reverted

Bug #1787467 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Critical
Andres Rodriguez

Bug Description

There was an error in MAAS where a global config was set to a default, but the actual value of the config was empty in the database. So when MAAS tried to use the setting, it would fail because it was null. This was found as part of [1], and because of [2].

The issue was that the UI would reset a global setting value that's not exposed in the UI, e.g:

1. maas <user> maas set-config name=maas_proxy_port value=8000
2. Go to UI and disable proxy
3. Go to UI and set 'built-in proxy'
4. maas <user> maas get-config name=maas_proxy_port would return 'null'

After investigating the settings, the API uses a different form from the UI. For example, the API validates the data from:

src/maasserver/forms/settings.py

While the UI uses a different form:

src/maasserver/forms/__init__.py:ProxyForm

Once I removed the field from src/maasserver/forms/__init__.py:ProxyForm, the UI stopped overriding the values of the field.

Based on the behavior observed this affects to the ProxyForm because the UI is in Angular, and no longer uses the settings form for validation. In comparison, the DNSForm does becuase the settings for this form are created automatically.

[1]: https://bugs.launchpad.net/maas/+bug/1787381
[2]: https://bugs.launchpad.net/maas/+bug/1787381/comments/6

Changed in maas:
importance: Undecided → Critical
status: New → Triaged
description: updated
Changed in maas:
assignee: nobody → Andres Rodriguez (andreserl)
milestone: none → 2.5.0alpha2
Revision history for this message
Andres Rodriguez (andreserl) wrote :

An example on how to addres sthis would be the UbuntuForm.

description: updated
Changed in maas:
milestone: 2.5.0alpha2 → 2.5.0beta1
Changed in maas:
milestone: 2.5.0beta1 → 2.5.0beta2
Changed in maas:
milestone: 2.5.0beta2 → 2.5.0rc1
Changed in maas:
milestone: 2.5.0rc1 → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Triaged → Invalid
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.