Open tomfotherby opened 7 years ago
Value 15601 for 'version' expected to be a string.
Got it. This happens in the scenario where the survey has a variable that is type "Text" and you give it this type of input.
The burden here is on tower-cli, because Tower UI will automatically coerce the data into text. Tower-cli should do the same.
Support should point to https://access.redhat.com/products/ansible-tower-red-hat/, and any links that persist to the old page need to be changed. Thanks for bringing that to our attention.
@AlanCoding - Yes, you are right, thank you. I used Tower to edit the Survey of the Job template to change "Answer Type" from Text
to Float
. Then my tower-cli commands started working again. Good stuff.
(feel free to close this issue if you feel it's not relevant)
This may get re-evaluated whenever additional survey work is done, because I'm not sure how intrusive type checking will be.
One support link fixed in https://github.com/ansible/ansible/pull/22212
We got exactly the same issue with the upgrade of Tower to 3.0.x to 3.1.x. In our case, we are posting arrays to the tower:
[u217229@svn_to_git_worker-int-i ~]$ tower-cli job launch --job-template=gsharp_DiDok_GEO-INT_deploy-webapp '--extra-vars=findAndReplaceValues: [{'\''source'\'' : '\''app.*.js'\'', '\''find'\'' : '\''geo-int'\'', '\''replace'\'' : '\''geo-int'\''}, {'\''source'\'' : '\''app.*.js'\'', '\''find'\'' : '\''geo-dev'\'', '\''replace'\'' : '\''geo-int'\''}, {'\''source'\'': '\''app.*.js'\'', '\''find'\'':'\''Dienststellen_temp'\'', '\''replace'\'':'\''Dienststellen'\''}, {'\''source'\'': '\''app.*.js'\'', '\''find'\'':'\''useArcGISToken:true'\'', '\''replace'\'':'\''useArcGISToken:false'\''}]' --monitor
Error: The Tower server claims it was sent a bad request.
POST https://deploy-t.sbb.ch/api/v1/job_templates/3816/launch/
Params: None
Data: {"extra_vars": "{\"webAppName\": \"DiDok\", \"findAndReplaceValues\": [{\"source\": \"app.*.js\", \"find\": \"geo-int\", \"replace\": \"geo-int\"}, {\"source\": \"app.*.js\", \"find\": \"geo-dev\", \"replace\": \"geo-int\"}, {\"source\": \"app.*.js\", \"find\": \"Dienststellen_temp\", \"replace\": \"Dienststellen\"}, {\"source\": \"app.*.js\", \"find\": \"useArcGISToken:true\", \"replace\": \"useArcGISToken:false\"}], \"version\": \"LATEST\", \"groupId\": \"ch.sbb.didok\", \"artifactId\": \"didokjs\"}"}
Response: {"variables_needed_to_start":["Value [{u'source': u'app.*.js', u'find': u'geo-int', u'replace': u'geo-int'}, {u'source': u'app.*.js', u'find': u'geo-dev', u'replace': u'geo-int'}, {u'source': u'app.*.js', u'find': u'Dienststellen_temp', u'replace': u'Dienststellen'}, {u'source': u'app.*.js', u'find': u'useArcGISToken:true', u'replace': u'useArcGISToken:false'}] for 'findAndReplaceValues' expected to be a string."]}
The parameter in the survey is a TextArea. Is there any way to post arrays with the help of the tower-cli? Or should we rely on REST?
Ansible Support in Case 01869195 cross-checked against this issue and they came to the conclusion as well, that the burden is on site of the tower-cli.
I ran into the same issue when using numeric strings in a survey field which validates to Text. I've solved this issue by sending extra vars in JSON format so I can enforce numeric strings to be strings.
Today I upgraded Tower from v3.0.2 to v3.1.0 and my tower-cli job launches started failing.
It seems Tower 3.1 has some new type checks and now doesn't like getting integers in
extra-vars
. This is a example of the new error:I found a workaround was to use yml syntax to specify the extra var as a string explicitly.
It would be great if tower-cli supported a syntax where you can tell it that integers should be treated as strings. for example, using quotes:
I wanted to contact Ansible support about this change in Tower, but the website isn't working ( https://support.ansible.com/hc/en-us ).