xebialabs-community / xlr-variable-setter-plugin

XL Release plugin that will set release variables values from URL accessible remote files. The plugin can also set variables from other release variables that contain JSON or XML strings.
MIT License
2 stars 2 forks source link

Mapping values are not allowed here in 'string' error #8

Open nessadc opened 4 years ago

nessadc commented 4 years ago

We have followed the instructions in the github repo and have setup our variable to be set by a YAML file. It keeps failing with error code:

Exception during execution: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here in 'string', line 3, column 17: <head prefix="og: http://ogp.me/ns#"> ^ in <script> at line number 103

We are using Version 9.5.4 of XLR.

testYaml.yaml:

variables:
  - key: listOfVersions
    type: xlrelease.StringVariable
    value: hello

We have setup our variable like so: image

Our task is setup like so (I know the authentication works and it seems to find the file): image

ladamato commented 4 years ago

Hi nessadc, Thank you for contacting us with this issue. Our research shows that this type of problem occurs when the yaml parser attempts to parse invalid yaml. We have tried to reproduce the error you received but have not been able to. Our testing confirms that your yaml file is valid and that the plugin is able to successfully set the release variable. We must consider though that what the plugin actually parses in your environment is the text returned from the https call to the Target URL rather than the actual file. Please confirm that a call to that URL from a browser (of course substitute the actual file name - testYaml.yaml for the place holder :filename:) returns valid yaml. The browser should display plain text that is valid yaml. Yaml is finicky in regard to whitespace and indentation. You can check for validity here: http://www.yamllint.com/. Although this type of test may help find the problem, it does not ensure that the the text string XLR is receiving is the same as you see in the browser since that also assumes that the credentials entered into the Get Vars task are right. Please check those again to confirm they are correct. Let us know how your testing goes and in the meantime, we will continue to try to reproduce your error. The log file for this plugin can be found in your XLR log directory and is named varSetterPlugin.log. You may find some useful information there as well. Let us know how it goes - we look forward to your feedback. Thanks!