You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ chaos.exe validate experiments/expermiment-aws-02.yaml
[2024-02-13 14:15:38 ERROR] Failed parsing YAML experiment: while parsing a flow sequence
in "experiments/expermiment-aws-02.yaml", line 30, column 16
expected ',' or ']', but got '{'
in "experiments/expermiment-aws-02.yaml", line 30, column 19
To Reproduce
Create variable using configuration in file yaml, and use this value in someone list
Expected behavior
If no problem, my expected was pass value dynamicly to probe and actions
Additional context
none
The text was updated successfully, but these errors were encountered:
This same question was asked in chaostoolkit-aws (issue 146). I have added a comment that explains this behaviour and what the user needs to do to remediate it but I am also posting it here for completeness
The issue here is with the syntax of the yaml. In most cases you can leave strings unquoted and yaml will just consider them as strings. however in some cases you need to use quotes so yaml doesn't interprete a specific char as a yaml token, which is the case here. Using your experiment2.yaml we can replicate this issue outside of chaostoolkit
line 483, in parse_flow_sequence_entry
raise ParserError("while parsing a flow sequence", self.marks[-1],
yaml.parser.ParserError: while parsing a flow sequence
in "experiment2.yaml", line 35, column 16
expected ',' or ']', but got '{'
in "experiment2.yaml", line 35, column 19
Also you seem to be mixing the block style and flow style with your sequences and mappings. While these yield the same result in most cases, flow style is what's causing your issue here and how it is handled by the parser.
There are two way to resolve this. Either quote your values in the flow sequence and mappings for example
Or switch these to block style, this would be my prefered choice as its the more common style used and what the majority of your experiment already uses for its style
chaos validate .\experiment2.yaml
[2024-03-02 09:16:32 ERROR] Failed parsing YAML experiment: while parsing a flow sequence
in ".\experiment2.yaml", line 35, column 16
expected ',' or ']', but got '{'
in ".\experiment2.yaml", line 35, column 19
Description:
When I use configuration values inside a list, such as tags or subnets_ids from the chasaws addon, json parse error occurs
python -V:
Python 3.11.7
chaos.exe info core:
NAME VERSION
CLI 1.18.0
Core library 1.41.0
chaos info extensions
NAME VERSION LICENSE DESCRIPTION
chaostoolkit-aws 0.31.1 Apache License Version 2.0 AWS
chaostoolkit-kubernetes 0.34.1 Apache License Version 2.0 Kubernetes
chaostoolkit-reporting 0.17.1 Apache License Version 2.0 Chaos engineering toolkit reporting library
Experiment 01:
Experiment 02:
Error msg:
To Reproduce
Create variable using configuration in file yaml, and use this value in someone list
Expected behavior
If no problem, my expected was pass value dynamicly to probe and actions
Additional context
none
The text was updated successfully, but these errors were encountered: