Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing workflow breaks extra_vars #4293

Closed
blindrood opened this issue Jul 9, 2019 · 7 comments
Closed

Editing workflow breaks extra_vars #4293

blindrood opened this issue Jul 9, 2019 · 7 comments

Comments

@blindrood
Copy link

blindrood commented Jul 9, 2019

ISSUE TYPE
  • Bug Report
SUMMARY

Editing workflow generates lots of issues with extra vars on job templates

ENVIRONMENT
  • AWX version:6.0.0
  • AWX install method: docker
  • Ansible version: 2.8.1
  • Operating System: Win
  • Web Browser: FF/Chrome
STEPS TO REPRODUCE

Edit existing workflow template.

EXPECTED RESULTS

Everything is working as on v3

ACTUAL RESULTS

Workflow designer to some jobs adds pipe to extra vars, like this:

|
  {}

Causing error: Failed to parse variables. Attempted to parse yaml. Parser did not return an object.

On other jobs it splits extra vars content char by char generating list of numbered, one char vars, like this:
https://gist.github.com/blindrood/156a73d31654114508bff7307ef2fdd1

ADDITIONAL INFORMATION
@awxbot awxbot added the type:bug label Jul 9, 2019
@ghjm
Copy link
Contributor

ghjm commented Jul 12, 2019

Possible duplicate of #4303

@mabashian
Copy link
Member

@blindrood you'll have to provide some more information to help us reproduce this issue. Can you describe the setup of the job template being referenced in the workflow? What fields are promptable? Does it have a survey? If possible can you provide a gif or screenshot of the error being reproduced?

@blindrood
Copy link
Author

blindrood commented Jul 15, 2019

Some templates have survey, some doesn't. Seems like, if there's no extra_var then a pipe is added. If there's something, then it's splitted
Adnotacja 2019-07-15 075225
Adnotacja 2019-07-15 075808
Adnotacja 2019-07-15 075405

@blindrood
Copy link
Author

We've upgraded awx to 6.1. Extra pipe no longer appears.
Extra variables are still splitted char by char

@kfattig
Copy link

kfattig commented Aug 12, 2019

We're also seeing this. I'm recording here since there was already a public issue, but we do have Tower support. If you'd like me to file a vendor ticket LMK.

When creating the 'node' in the workflow, things are normal:
image

The confirmation screen is also normal:
image

After hitting 'Save', it seems that the extra_variables are written incorrectly to the workflow_node's entry in the database:

select extra_data from main_workflowjobnode where id=31770;

Returns:

{"0": "j", "1": "t", "2": "_", "3": "v", "4": "a", "5": "r", "6": "1", "7": ":", "8": " ", "9": "j", "10": "t", "11": "_", "12": "v", "13": "a", "14": "l", "15": "1", "16": "\n", "17": "j", "18": "t", "19": "_", "20": "v", "21": "a", "22": "r", "23": "2", "24": ":", "25": " ", "26": "j", "27": "t", "28": "_", "29": "v", "30": "a", "31": "l", "32": "2"}

If you re-open the workflow visualizer, each character in extra_vars has become its own var:
image

They are then passed onto the job at exeuction:

select extra_vars from main_job where unifiedjob_ptr_id=161395; 

Returns:

{"jt_var1": "jt_val1", "jt_var2": "jt_val2", "0": "j", "1": "t", "2": "_", "3": "v", "4": "a", "5": "r", "6": "1", "7": ":", "8": " ", "9": "j", "10": "t", "11": "_", "12": "v", "13": "a", "14": "l", "15": "1", "16": "\n", "17": "j", "18": "t", "19": "_", "20": "v", "21": "a", "22": "r", "23": "2", "24": ":", "25": " ", "26": "j", "27": "t", "28": "_", "29": "v", "30": "a", "31": "l", "32": "2", "wf_var1": "wf_val1", "wf_var2": "wf_val2"}

image

@mabashian
Copy link
Member

Pretty sure this is related to #3669 #3567 #3359

@dsesami
Copy link
Contributor

dsesami commented Aug 29, 2019

Manipulated a workflow with both JSON and YAML formatted extra vars. Created and edited the workflow with different variables. There does not appear to be any strange output by the application anymore. 👍

@dsesami dsesami closed this as completed Aug 29, 2019
ryanpetrello added a commit to ryanpetrello/awx that referenced this issue May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants