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

WinRM credentials reported invalid, but they just aren't... #8952

Open
hanserasmus opened this issue Feb 24, 2024 · 0 comments
Open

WinRM credentials reported invalid, but they just aren't... #8952

hanserasmus opened this issue Feb 24, 2024 · 0 comments

Comments

@hanserasmus
Copy link

Describe the bug
Ansible playbooks with winrm works 100% through rundeck. Configuring the winrm credentials in rundeck results in nodes being discovered through the ansible inventory, and added to rundeck. But, none of the jobs or commands using winrm wants to execute, and results in an error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 328, in _send_message_request
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error:  for url: http://10.65.170.142:5985/wsman
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/var/lib/rundeck/libext/cache/py-winrm-plugin-2.1.3/winrm-check.py", line 256, in <module>
    result = session.run_cmd(exec_command)
  File "/usr/local/lib/python3.10/dist-packages/winrm/__init__.py", line 40, in run_cmd
    shell_id = self.protocol.open_shell()
  File "/usr/local/lib/python3.10/dist-packages/winrm/protocol.py", line 166, in open_shell
    res = self.send_message(xmltodict.unparse(req))
  File "/usr/local/lib/python3.10/dist-packages/winrm/protocol.py", line 243, in send_message
    resp = self.transport.send_message(message)
  File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 322, in send_message
    response = self._send_message_request(prepared_request, message)
  File "/usr/local/lib/python3.10/dist-packages/winrm/transport.py", line 332, in _send_message_request
    raise InvalidCredentialsError("the specified credentials were rejected by the server")
winrm.exceptions.InvalidCredentialsError: the specified credentials were rejected by the server
Script result code was: 1
Execution failed: 21 in project ced_win_adhoc: [Workflow result: , step failures: {1=NonZeroResultCode: Script result code was: 1}, status: failed]

As I said, the credentials are not invalid, because the same credentials are being used in ansible playbooks, and the same credentials actually logs into the devices to pull the node details (I can see that in the logs).

My Rundeck detail

  • Rundeck version: 5.1.0
  • install type: deb
  • OS Name/version: Ubuntu 22.04]
  • DB Type/version: MariaDB

To Reproduce
Steps to reproduce the behavior:

  1. Add a project with default executor of winrm
  2. Under project hosts, add your ansible inventory file as source of nodes
  3. Once all nodes are imported, try and run a simple command, like ipconfig on a node, via the rundeck command tab.
  4. Check the log output.

Expected behavior
I expect the connection to be successful and execute the command.

Screenshots
.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Browser; Firefox
  • Version 110
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant