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

include_vars hungs if included file is bad formatted #36235

Closed
nkakouros opened this issue Feb 15, 2018 · 5 comments
Closed

include_vars hungs if included file is bad formatted #36235

nkakouros opened this issue Feb 15, 2018 · 5 comments
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@nkakouros
Copy link
Contributor

ISSUE TYPE
  • Bug Report
COMPONENT NAME

include_vars

ANSIBLE VERSION
ansible 2.6.0 (devel 8743b20c8e) last updated 2018/02/13 17:38:47 (GMT +200)                                                                                                                 
  config file = None                                                                                                                                                                         
  configured module search path = ['/home/nikos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']                                                                             
  ansible python module location = /home/nikos/Projects/ansible/lib/ansible                                                                                                                  
  executable location = /home/nikos/Projects/ansible/bin/ansible                                                                                                                             
  python version = 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224]
CONFIGURATION

default

OS / ENVIRONMENT

Arch linux latest

SUMMARY

If the included file has a bad format, then include_vars may hung.

STEPS TO REPRODUCE

playbook.yml:

- hosts: localhost                                                                                                                                                                                  
  tasks:
    - include_vars: vars.yml

vars.yml

q:                                                                                                                                                                                           
  - one                                                                                                                                                                                      
- two
EXPECTED RESULTS

Ansible should exit with error.

ACTUAL RESULTS

Ansible gets stuck while executing the TASK [include_vars] task.

 [WARNING]: No inventory was parsed, only implicit localhost is available

 [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'


PLAY [localhost] ****************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************
ok: [localhost]

TASK [include_vars] *************************************************************************************************************************************************************************
^C [ERROR]: User interrupted execution

@ansibot
Copy link
Contributor

ansibot commented Feb 15, 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 Feb 15, 2018

@ansibot ansibot added affects_2.6 This issue/PR affects Ansible v2.6 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Feb 15, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Feb 16, 2018
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 1, 2018
@Akasurde
Copy link
Member

@tterranigma I am not able to reproduce this using 2.6, I get following error message -

TASK [include_vars] ************************************************************************************************************
task path: /Volumes/data/src/ansible/playbooks/vmware_related/using_vars.yml:5
fatal: [localhost]: FAILED! => {
    "ansible_facts": {},
    "ansible_included_var_files": [],
    "changed": false,
    "message": "Syntax Error while loading YAML.\n  did not find expected key\n\nThe error appears to have been in '/Volumes/data/src/ansible/playbooks/vmware_related/vars/main.yml': line 3, column 1, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n  - a\n- b\n^ here\n"
}

Can you retry with latest 2.6 ?

@nkakouros
Copy link
Contributor Author

@Akasurde Yes, it seems to be resolved.

@sivel
Copy link
Member

sivel commented Jul 30, 2018

fwiw, I think this was resolved in #38194

@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.6 This issue/PR affects Ansible v2.6 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

5 participants