rundeck-plugins / py-winrm-plugin

15 stars 21 forks source link

Ascii codec error when job has non ASCII characters in job name #76

Open igalvit opened 3 years ago

igalvit commented 3 years ago

When the job name has non US ASCII character like n with tilde (ñ) and has a script step fails with these errors:

[ERROR  ]  Execution finished with the following error (winrm-exec.py:323)[root]
[ERROR  ]  'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) (winrm-exec.py:324)[root]
[ERROR  ]  Execution finished with the following error (winrm-exec.py:323)[root]
[ERROR  ]  'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128) (winrm-exec.py:324)[root]

winrm_error1

WiRM 2.0.12 Rundeck 3.3.10-20210301 CentOS Linux release 7.8.2003

The example job content:

nodes true false ascending false 1 true aaaafb30-56db-4aaf-9aae-da6aaaaceac2 INFO ñ false name: Windows2019 true true script1 ps1 aaaafb30-56db-4aaf-9aae-da6aaaaceac2
Carlos-SS-PMI commented 2 years ago

Hi! I also got this failure using "py-winrm-plugin" on Rundeck 3.4 with this simple piece of MS-DOS code (as inline script):

@ECHO OFF
FOR /F %%i IN ('date /T') DO set FECHA=%%i
echo RUNDECK:DATA:REMOTE_DATE=%FECHA%

What we can do?

duylong commented 2 years ago

Hi,

Same problem with WinRM Node Executor Python. No problem with the standard WinRM executor.

molinacarlos commented 2 years ago

Any news about it ?

Carlos-SS-PMI commented 2 years ago

My problem came from job tree branch name (not in job name): I was using an Spanish notation (with special characters like "á", "ó", etc.) and by an unknown reason this was affecting job execution.

Once translated job tree branch name into plain English problem disappeared.

w00dst0ck commented 2 years ago

@Carlos-SS-PMI that seems to be the workaround. But the problem isn't fixed.