Currently I am facing a very confusing issue.
I am executing a job from (Rundeck) to (remote windows machine) using winrm as executor and file copier, which execute an inline powershell script.
Tried and worked fine on one of 3 environments.
On the Preprod, and Prod Rundeck.. Same job (exported/imported), fails, though same setting on the 3 environment, same script, same args, even same windows version.
I added a WINRM Check connection step, and it succeeds.
- Rundeck manage to throw the script on the machine (with wrong name however), which means authentication is going well. However, it fails with this abstract error.
[ERROR ] Execution finished with the following error (winrm-exec.py:304)[root] [ERROR ] The parameter is incorrect. (extended fault data: {u'fault_subcode': 'w:InvalidParameter', u'fault_code': 's:Sender', u'wsmanfault_code': '87', 'transport_message': u'Bad HTTP response returned from server. Code 500', 'http_status_code': 500}) (winrm-exec.py:305)[root] [WinRMPython]: result code: 1, success: false Failed: NonZeroResultCode: [WinRMPython] Result code: 1
- When I try to execute the thrown Powershell script locally from the machine it works well.
WinRM plugin version: 2.0.9
Python: 2.7.17
For future references, the solution is here. Switching to Python 3 interpreter (instead of Python 2) on Default Node Executor and Default File Copier (Project Settings > Edit Configuration > Default Node Executor and Default File copier tabs) solves the issue.