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

win_updates: handle if module failed to run #38363

Merged
merged 1 commit into from Apr 9, 2018

Conversation

jborean93
Copy link
Contributor

SUMMARY

If the win_updates module fails to run at all or an unhandled exception, the action plugin will just return the message instead of trying to continue.

Somewhat Fixes #38232

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

win_updates

ANSIBLE VERSION
devel
2.5

@ansibot ansibot added bug This issue/PR relates to a bug. 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 Apr 5, 2018
@mkrizek mkrizek removed the needs_triage Needs a first human triage before being processed. label Apr 6, 2018
@jborean93 jborean93 merged commit ccc56e1 into ansible:devel Apr 9, 2018
@jborean93 jborean93 deleted the win_update-failure-handler branch April 9, 2018 19:25
jborean93 added a commit to jborean93/ansible that referenced this pull request Apr 9, 2018
@jborean93
Copy link
Contributor Author

Backport PR to stable-2.5 #38498

jborean93 added a commit that referenced this pull request Apr 9, 2018
* win_updates: handle if module failed to run (#38363)

(cherry picked from commit ccc56e1)

* Added changelog fragment
@macampo
Copy link

macampo commented Apr 11, 2018

We encounter the same bug. I updated our win_updates.py with your changes and the error we got back now has changed to:
{
"msg": "Unexpected failure during module execution.",
"exception": "Traceback (most recent call last):\n File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 138, in run\n res = self._execute()\n File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 554, in _execute\n result = self._handler.run(task_vars=variables)\n File "/usr/lib/python2.7/site-packages/ansible/plugins/action/win_updates.py", line 192, in run\n if result['failed']:\nKeyError: 'failed'\n",
"stdout": ""
}

I'm happy to work on this issue together, because when it is fixed it will save me quite some time.

@svpudik
Copy link

svpudik commented May 16, 2018

Hello I have same issue on a lot of servers this module failing. We are using ansible 2.5

The full traceback is:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 138, in run
res = self._execute()
File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 554, in _execute
result = self._handler.run(task_vars=variables)
File "/usr/lib/python2.7/site-packages/ansible/plugins/action/win_updates.py", line 189, in run
changed = result['changed']
KeyError: 'changed'

fatal: [server01]: FAILED! => {
"msg": "Unexpected failure during module execution.",
"stdout": ""
}

@jborean93
Copy link
Contributor Author

@macampo this was an issue I unfortunately added with this change, the fix for that is here #38856.

@svpudik make sure you are on 2.5.1 or 2.5.2, this change was added in 2.5.1.

In the future, please raise a separate PR as we don't usually monitor closed issues and PRs

ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
@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
bug This issue/PR relates to a bug. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

win_updates module fails with keyerror changed
5 participants