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

Invalid yml causes include_vars to hang or freeze without output #38190

Closed
wbreeze opened this issue Apr 2, 2018 · 4 comments · Fixed by #38194
Closed

Invalid yml causes include_vars to hang or freeze without output #38190

wbreeze opened this issue Apr 2, 2018 · 4 comments · Fixed by #38194
Assignees
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@wbreeze
Copy link

wbreeze commented Apr 2, 2018

I made some attempt to sift through the 3,511 issues. Apology for adding yet another to this hopelessly large list. I did not set-up for development and try to reproduce.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

include_vars

ANSIBLE VERSION
ansible 2.4.3.0
  config file = /Users/dclo/Documents/ansible/ansible.cfg
  configured module search path = ['/Users/dclo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.6.4 (default, Mar 22 2018, 13:54:22) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
CONFIGURATION
DEFAULT_HOST_LIST(/Users/dclo/Documents/ansible/ansible.cfg) = ['/Users/dclo/Documents/ansible/staging']
DEFAULT_VAULT_PASSWORD_FILE(/Users/dclo/Documents/ansible/ansible.cfg) = /Users/dclo/Documents/ansible/.vault_pass
OS / ENVIRONMENT

macOS High Sierra 10.13.3

SUMMARY

ansible-playbook test.yml -vvv outputs the beginning of the include_vars task and then hangs.

STEPS TO REPRODUCE
  • Create a vars file with ansible-vault (create/edit) that has malformed yaml.
  • Include it in the playbook.
---
- hosts: all
   gather_facts: no
   tasks:
   - include_vars: "vars/vault.yml"
EXPECTED RESULTS

Ansible outputs syntax error on the yaml file.

ACTUAL RESULTS

Ansible hangs

TASK [include_vars] ********************************************************************************
task path: /Users/dclo/Documents/ansible/test.yml:5
^CProcess WorkerProcess-2:
 [ERROR]: User interrupted execution
@ansibot
Copy link
Contributor

ansibot commented Apr 2, 2018

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Apr 2, 2018

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 2, 2018
@sivel sivel changed the title include_vars hangs or freezes, without output, given vault with incorrect yml syntax Invalid yml causes include_vars to hang or freeze without output Apr 2, 2018
@sivel sivel self-assigned this Apr 2, 2018
@sivel sivel added has_pr This issue has an associated PR. and removed needs_triage Needs a first human triage before being processed. labels Apr 2, 2018
@sivel
Copy link
Member

sivel commented Apr 2, 2018

I've submitted a fix for this issue at #38194

sivel added a commit to sivel/ansible that referenced this issue Apr 3, 2018
sivel added a commit to sivel/ansible that referenced this issue Apr 3, 2018
@wbreeze
Copy link
Author

wbreeze commented Apr 3, 2018

Cool!

samdoran pushed a commit that referenced this issue Apr 5, 2018
* Don't pass keyword args as positional, include file_name. Fixes #38190 (#38194)

(cherry picked from commit ddf937d)

* Add changelog for #38194
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.4 This issue/PR affects Ansible v2.4 bug This issue/PR relates to a bug. has_pr This issue has an associated PR. module This issue/PR relates to a module. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants