{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/32441","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/32441/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/32441/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/32441/events","html_url":"https://github.com/ansible/ansible/issues/32441","id":270323463,"number":32441,"title":"stderr_lines are missing when stderr is present","user":{"login":"jean-christophe-manciot","id":13176858,"avatar_url":"https://avatars3.githubusercontent.com/u/13176858?v=4","gravatar_id":"","url":"https://api.github.com/users/jean-christophe-manciot","html_url":"https://github.com/jean-christophe-manciot","followers_url":"https://api.github.com/users/jean-christophe-manciot/followers","following_url":"https://api.github.com/users/jean-christophe-manciot/following{/other_user}","gists_url":"https://api.github.com/users/jean-christophe-manciot/gists{/gist_id}","starred_url":"https://api.github.com/users/jean-christophe-manciot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jean-christophe-manciot/subscriptions","organizations_url":"https://api.github.com/users/jean-christophe-manciot/orgs","repos_url":"https://api.github.com/users/jean-christophe-manciot/repos","events_url":"https://api.github.com/users/jean-christophe-manciot/events{/privacy}","received_events_url":"https://api.github.com/users/jean-christophe-manciot/received_events","type":"User","site_admin":false},"labels":[{"id":686214011,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.5","name":"affects_2.5","color":"ededed","default":false},{"id":785271699,"url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":636352796,"url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-01T14:19:50Z","updated_at":"2018-05-14T15:53:28Z","closed_at":null,"author_association":"NONE","body":"##### ISSUE TYPE\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\n\r\nscript\r\n\r\n##### ANSIBLE VERSION\r\n\r\nLatest unstable version:\r\n```\r\nansible 2.5.0 (devel 1068aa3ce7) last updated 2017/11/01 11:34:22 (GMT +200)\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = [u'/home/actionmystique/Ansible/git-yang-networkop/ansible-101/library']\r\n  ansible python module location = /home/actionmystique/src/Ansible/git-ansible/lib/ansible\r\n  executable location = /home/actionmystique/src/Ansible/git-ansible/bin/ansible\r\n  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]\r\n```\r\n##### CONFIGURATION\r\n```\r\ninventory   = ./hosts\r\nlibrary        = /home/actionmystique/Ansible/git-yang-networkop/ansible-101/library\r\nforks = 1000\r\ngathering = explicit\r\ngather_timeout = 30\r\nroles_path = /home/actionmystique/Ansible/Roles/roles\r\nprivate_role_vars = yes\r\nhash_behaviour = merge\r\nlog_path = /var/log/ansible.log\r\nretry_files_enabled = False\r\nshow_custom_stats = True\r\ntimeout = 120\r\npipelining = True\r\nconnect_timeout = 240\r\nconnect_retry_timeout = 180\r\n```\r\n##### OS / ENVIRONMENT\r\n- host: Ubuntu 17.04 4.10\r\n- targets: \r\n  + NX-OSv 9k 7.0(3)I6(1)\r\n- paramiko: 2.0.6\r\n\r\n##### SUMMARY\r\n\r\nWhen the **script** module is run **locally** (no ssh) and returns an error, stderr is present but not stderr_lines.\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n**Role**: \r\n\r\n```\r\n- name: Checking for duplicate keys in json answer\r\n  local_action: script /home/actionmystique/Bash/Scripts/json-check-duplicate-keys.sh '\"{{ uri_return.content }}\"' 'false'\r\n  register: json_check_duplicate_keys\r\n  failed_when: json_check_duplicate_keys.stderr \r\n```\r\n\r\n##### EXPECTED RESULTS\r\n\r\nstderr_lines\r\n\r\n##### ACTUAL RESULTS:\r\n\r\n```\r\nfatal: [NX_OSv_9k_Spine_31 -> localhost]: FAILED! => {\r\n    \"changed\": true, \r\n    \"failed_when_result\": true, \r\n    \"msg\": \"non-zero return code\", \r\n    \"rc\": 2, \r\n    \"stderr\": \"Checking /tmp/data.json...\\n----\\nDuplicate keys found in /tmp/data.json:\\n* subinterface\\n* subinterface\\n* subinterface\\n* subinterface\\n* subinterface\\n* subinterface\\n* subinterface\\n* subinterface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n* interface\\n/root/.ansible/tmp/ansible-tmp-1509543791.83-202226908799664/json-check-duplicate-keys.sh: line 99: exit: return_code: numeric argument required\\n\", \r\n    \"stdout\": \"-------------------------------------------------------------------\\nChecking for duplicate keys in json file /tmp/fixed_json_data.json\\n-------------------------------------------------------------------\\n\", \r\n    \"stdout_lines\": [\r\n        \"-------------------------------------------------------------------\", \r\n        \"Checking for duplicate keys in json file /tmp/fixed_json_data.json\", \r\n        \"-------------------------------------------------------------------\"\r\n    ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/388867573","html_url":"https://github.com/ansible/ansible/issues/32441#issuecomment-388867573","issue_url":"https://api.github.com/repos/ansible/ansible/issues/32441","id":388867573,"user":{"login":"Akasurde","id":633765,"avatar_url":"https://avatars1.githubusercontent.com/u/633765?v=4","gravatar_id":"","url":"https://api.github.com/users/Akasurde","html_url":"https://github.com/Akasurde","followers_url":"https://api.github.com/users/Akasurde/followers","following_url":"https://api.github.com/users/Akasurde/following{/other_user}","gists_url":"https://api.github.com/users/Akasurde/gists{/gist_id}","starred_url":"https://api.github.com/users/Akasurde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Akasurde/subscriptions","organizations_url":"https://api.github.com/users/Akasurde/orgs","repos_url":"https://api.github.com/users/Akasurde/repos","events_url":"https://api.github.com/users/Akasurde/events{/privacy}","received_events_url":"https://api.github.com/users/Akasurde/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T15:53:28Z","updated_at":"2018-05-14T15:53:28Z","author_association":"MEMBER","body":"resolved_by_pr #40079 "}}
{"actor":{"display_login":"Akasurde"}}