Bug 1860586 - If a non-json value is used in a json type property, heat only says a non-json value is being used but doesn't indicate which one is wrong
Summary: If a non-json value is used in a json type property, heat only says a non-jso...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-heat
Version: 16.2 (Train)
Hardware: x86_64
OS: All
medium
low
Target Milestone: ---
: ---
Assignee: OSP Team
QA Contact: David Rosenfeld
URL:
Whiteboard:
: 1756595 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-25 12:17 UTC by David Hill
Modified: 2023-10-06 21:15 UTC (History)
8 users (show)

Fixed In Version: openstack-heat-13.1.1-2.20201103005042.0d7e5bd.el8ost.1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-15 07:08:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack Storyboard 2007957 0 None None None 2020-07-25 12:18:07 UTC
OpenStack gerrit 743029 0 None MERGED Lazily cache parsed value of list/json parameters 2021-02-02 11:14:00 UTC
OpenStack gerrit 750469 0 None MERGED Lazily cache parsed value of list/json parameters 2021-02-02 11:13:59 UTC
Red Hat Issue Tracker OSP-3039 0 None None None 2022-08-23 22:48:55 UTC
Red Hat Knowledge Base (Solution) 5248431 0 None None None 2020-07-25 12:42:25 UTC
Red Hat Product Errata RHEA-2021:3483 0 None None None 2021-09-15 07:09:09 UTC

Description David Hill 2020-07-25 12:17:49 UTC
Description of problem:
If a non-json value is used in a json type property, heat only says a non-json value is being used but doesn't indicate which one is wrong :
$ sh overcloud.sh --debug
Running "openstack overcloud deploy" command
Removing the current plan files
Uploading new plan files
Temporary Swift GET/PUT URL parameters have successfully been updated.
Plan updated.
Processing templates in the directory /tmp/tripleoclient-8jpt8_jh/tripleo-heat-templates
Action tripleo.parameters.update execution failed: Error validating environment for plan viper: ERROR: Internal Error
Traceback (most recent call last):

File "/usr/lib/python3.6/site-packages/heat/engine/parameters.py", line 455, in parse
return jsonutils.loads(val)

File "/usr/lib/python3.6/site-packages/oslo_serialization/jsonutils.py", line 264, in loads
return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)

File "/usr/lib64/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)

File "/usr/lib64/python3.6/json/decoder.py", line 342, in decode
raise JSONDecodeError("Extra data", s, end)

json.decoder.JSONDecodeError: Extra data: line 1 column 7 (char 6)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/lib/python3.6/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
res = self.dispatcher.dispatch(message)

File "/usr/lib/python3.6/site-packages/oslo_messaging/rpc/dispatcher.py", line 274, in dispatch
return self._do_dispatch(endpoint, method, ctxt, args)

File "/usr/lib/python3.6/site-packages/oslo_messaging/rpc/dispatcher.py", line 194, in _do_dispatch
result = func(ctxt, **new_args)

File "/usr/lib/python3.6/site-packages/osprofiler/profiler.py", line 160, in wrapper
result = f(*args, **kwargs)

File "/usr/lib/python3.6/site-packages/heat/common/context.py", line 423, in wrapped
return func(self, ctx, *args, **kwargs)

File "/usr/lib/python3.6/site-packages/heat/engine/service.py", line 1292, in validate_template
strict_validate=False)

File "/usr/lib/python3.6/site-packages/heat/engine/stack.py", line 220, in init
parent_info)

File "/usr/lib/python3.6/site-packages/heat/engine/stk_defn.py", line 43, in init
template.env.param_defaults)

File "/usr/lib/python3.6/site-packages/heat/engine/hot/template.py", line 222, in parameters
param_defaults=param_defaults)

File "/usr/lib/python3.6/site-packages/heat/engine/parameters.py", line 527, in init
self.params[pd_name].set_default(param_default)

File "/usr/lib/python3.6/site-packages/heat/engine/parameters.py", line 383, in set_default
self._update_parsed()

File "/usr/lib/python3.6/site-packages/heat/engine/parameters.py", line 390, in _update_parsed
self.parsed = self.parse(self.default())

File "/usr/lib/python3.6/site-packages/heat/engine/parameters.py", line 458, in parse
raise ValueError(message)

ValueError: Value must be valid JSON: Extra data: line 1 column 7 (char 6)

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Write a non-json value in a json-type parameter
2.
3.

Actual results:
heat-engine doesn't like it very much

Expected results:
it should not like it but at least give us an indication of where to look at

Additional info:

Comment 1 Kevin Carter 2020-07-29 16:23:04 UTC
*** Bug 1756595 has been marked as a duplicate of this bug. ***

Comment 7 David Rosenfeld 2021-06-07 18:53:44 UTC
In /usr/share/openstack-tripleo-heat-templates/network_data.yaml changed:


allocation_pools: [{'start': '10.0.1.4', 'end': '10.0.1.250'}] to 
allocation_pools: 'start': '10.0.1.4', 'end': '10.0.1.250'

Deployment fails with this message:

2021-06-04 17:26:13.967 371994 ERROR openstack [  admin] Exception updating plan: mapping values are not allowed here
  in "<unicode string>", line 144, column 28:
      allocation_pools: 'start': '10.0.1.4', 'end': '10.0.1.250'

Comment 9 errata-xmlrpc 2021-09-15 07:08:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:3483


Note You need to log in before you can comment on or make changes to this bug.