Invalid JSON in parameters breaks deployments/parameters screen

Bug #1638523 reported by Julie Pichon on 2016-11-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Florian Fuchs

Bug Description

It's not always clear that pure JSON must be used for the parameters. If you make a mistake, the deployment will fail but it will become impossible to modify the parameter again.

Steps to reproduce
------------------
1. Pick an option, e.g. CephStorageConfig
2. Enter something wrong, e.g. the way you'd have made the change for a template: ceph::profile::params::osds:
  '/dev/sdc':
journal: '/dev/sdb'

Expected result
---------------
3. Some kind of warning, the wrong value is not saved in the Mistral environment

Actual result
-------------
3. The value is saved.

4. If you try to deploy, it fails with Failed to run action [action_ex_id=00e7c638-4741-4b79-a760-edfafb190cac, action_cls='<class 'mistral.actions.action_factory.DeployStackAction'>', attributes='{}', params='{u'container': u'master-tht-oct19', u'timeout': 240}'] ERROR: Failed to validate: Failed to validate: resources[0]: Value must be valid JSON: No JSON object could be decoded

5. If you reopen the parameters window, it closes quickly on its own before you can modify it, with the following error: Failed to run action [action_ex_id=None, action_cls='<class 'mistral.actions.action_factory.GetParametersAction'>', attributes='{}', params='{u'container': u'master-tht-oct19'}'] ERROR: Value must be valid JSON: No JSON object could be decoded

Julie Pichon (jpichon) on 2016-11-02
summary: - Entering invalid JSON for a parameter causes the UI to stop loading the
- configuration screen
+ Invalid JSON in parameters breaks deployments/parameters screen
Julie Pichon (jpichon) wrote :

This is what the parameter looks like in the mistral environment, after saving the wrong parameter:

"CephStorageExtraConfig": "ceph::profile::params::osds:\n '/dev/sdc':\n journal: '/dev/sdb'\n '/dev/sdd':\njournal: '/dev/sdb'"

Julie Pichon (jpichon) wrote :

As a workaround for when this happens, you can either update the broken parameter or reset the whole environment using the CLI, and start again.

$ openstack action execution run tripleo.parameters.update '{"container": "plan-name", "parameters": {"CephStorageExtraConfig": {}}}

$ openstack action execution run tripleo.parameters.reset '{"container": "plan-name"}'

Julie Pichon (jpichon) wrote :

I filed a bug for the tripleo-common side of things at bug 1638598. I set priority as medium because when working from the CLI it's easier to correct the problem, while in the UI you stay stuck or must switch the CLI - but feel free to change the importance if you disagree.

Changed in tripleo:
assignee: nobody → Florian Fuchs (flo-fuchs)

Fix proposed to branch: master
Review: https://review.openstack.org/393713

Changed in tripleo:
status: Triaged → In Progress

Reviewed: https://review.openstack.org/393713
Committed: https://git.openstack.org/cgit/openstack/tripleo-ui/commit/?id=f7ddb6539685e981bca6fc6117fa54aae086fe65
Submitter: Jenkins
Branch: master

commit f7ddb6539685e981bca6fc6117fa54aae086fe65
Author: Florian Fuchs <email address hidden>
Date: Fri Nov 4 12:07:58 2016 +0100

    Validate JSON parameters

    This change adds a global `isJson` validation rule to the App component
    and uses it to validate parameter fields with the `json` type.

    Change-Id: I7c6826a32af63fb862017ea53d710447b61e57b6
    Closes-Bug: #1638523

Changed in tripleo:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/395580
Committed: https://git.openstack.org/cgit/openstack/tripleo-ui/commit/?id=d5cd27997abf97e2c197b17050417123e40ff075
Submitter: Jenkins
Branch: stable/newton

commit d5cd27997abf97e2c197b17050417123e40ff075
Author: Florian Fuchs <email address hidden>
Date: Fri Nov 4 12:07:58 2016 +0100

    Validate JSON parameters

    This change adds a global `isJson` validation rule to the App component
    and uses it to validate parameter fields with the `json` type.

    Change-Id: I7c6826a32af63fb862017ea53d710447b61e57b6
    Closes-Bug: #1638523
    (cherry picked from commit f7ddb6539685e981bca6fc6117fa54aae086fe65)

tags: added: in-stable-newton

This issue was fixed in the openstack/tripleo-ui 1.0.5 release.

This issue was fixed in the openstack/tripleo-ui 2.0.0 release.

This issue was fixed in the openstack/tripleo-ui 1.0.5 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers