Hello Jordan and Hawkesworth, Many Thanks for your email..!!
I disabled all services of Anti-Virus software on the server and tried win_ping but still the same issue. Tried with unrestricted, remotesigned and bypass execution policy but still win_ping does not work. Local user account which I am using to connect to windows server definitely has full access so, full permissions every where on this server. Please note that it is not giving any permission not found on any file rather it says file not found..!!! Below is the traceback with -vvvvv verbosity: TASK [win_ping] ********************************************************************************************************************************************* Using module file /usr/lib/python2.7/site-packages/ansible/modules/windows/win_ping.ps1 Pipelining is enabled. <a.b.c.d> ESTABLISH WINRM CONNECTION FOR USER: administrator on PORT 5986 TO a.b.c.d <a.b.c.d> WINRM CONNECT: transport=ssl endpoint=https://a.b.c.d:5986/wsman <a.b.c.d> WINRM OPEN SHELL: 6557236D-D283-4BAC-AFF8-E5FFC26B3265 EXEC (via pipeline wrapper) <a.b.c.d> WINRM EXEC 'PowerShell' ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Unrestricted', '-EncodedCommand', u'UAAGUAZABDAG8AbQBtAGEAbgBkACAASgBnAEIAagBBAEcAZwBBAFkAdwBCAHcAQQBDADQAQQBZAHcAQgB2AEEAAQgAwAEEARwBVAE**************ALPHANUMERICCHARSREMOVEDFORBEVERTY********8EASwBBAEEAawBBAEgATQBBAGMAQQBCAHMAQQBHAGsAQQBkAEEAQgBmAEEASABBAEEAWQBRAEIAeQBBAEgAUQBBAGMAdwBCAGIAQQBEAEEAQQBYAFEAQQBwAEEAQQBvAEEASgBnAEEAawBBAEcAVQBBAGUAQQBCAGwAQQBHAE0AQQBYAHcAQgAzAEEASABJAEEAWQBRAEIAdwBBAEgAQQBBAFoAUQBCAHkAQQBBAD0APQA='] <a.b.c.d> WINRM RESULT u'<Response code 1, out "{"exception":"Failed", err "">' <a.b.c.d> WINRM STDOUT {"exception":"Failed to compile C# code: \r\nerror CS0010: Unexpected fatal error -- \u0027n\u0027\r\nAt line:279 char:13\r\n+ throw [InvalidOperationException]$msg\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : OperationStopped: (:) [], InvalidOperationException\r\n + FullyQualifiedErrorId : Failed to compile C# code: \r\nerror CS0010: Unexpected fatal error -- \u0027n\u0027\r\n\r\nScriptStackTrace:\r\nat Add-CSharpType, \u003cNo file\u003e: line 279\r\nat \u003cScriptBlock\u003e, \u003cNo file\u003e: line 19\r\nat \u003cScriptBlock\u003e\u003cEnd\u003e, \u003cNo file\u003e: line 137\r\nat \u003cScriptBlock\u003e, \u003cNo file\u003e: line 7\r\n","msg":"internal error: failed to run exec_wrapper action module_powershell_wrapper: Failed to compile C# code: \r\nerror CS0010: Unexpected fatal error -- \u0027n\u0027","failed":true} <a.b.c.d> WINRM STDERR <a.b.c.d> WINRM CLOSE SHELL: 6558656D-D283-4BAC-AJJ8-E5FFC26B3612 The full traceback is: Failed to compile C# code: error CS0010: Unexpected fatal error -- 'n' At line:279 char:13 + throw [InvalidOperationException]$msg + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OperationStopped: (:) [], InvalidOperationException + FullyQualifiedErrorId : Failed to compile C# code: error CS0010: Unexpected fatal error -- 'n' ScriptStackTrace: at Add-CSharpType, <No file>: line 279 at <ScriptBlock>, <No file>: line 19 at <ScriptBlock><End>, <No file>: line 137 at <ScriptBlock>, <No file>: line 7 fatal: [a.b.c.d]: FAILED! => changed=false msg: |- internal error: failed to run exec_wrapper action module_powershell_wrapper: Failed to compile C# code: error CS0010: Unexpected fatal error -- 'n' Thanks, Piyush On Tue, Feb 25, 2020 at 3:36 AM Jordan Borean <[email protected]> wrote: > We use C# code in our code for a lot of things, in this case it's the > Ansible wrapper we use to abstract the communication to and from the > controller. Part of that process is to compile the C# code to a dll and > load that in PowerShell. This all happens in the background and is part of > PowerShell, similar to how the Add-Type cmdlet works. > > If it's failing to write to a file in the temp directory then it could be > an issue with; > > - Not having permissions to the dir > - Antivirus blocking the process > > I don't think it's the permissions issue as that's the temp dir for the > current user but it's probably still a good idea to check. As for the > anti-virus, it could be seeing a process writing a dll as something > suspicious and just block it from doing so. Unfortunately this is how > Ansible compiles the C# code for use in it's modules and we can't really do > too much about that. I would check to see if there are any AV logs to see > if it logged a reason why it blocked access. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/8c2131f4-5856-4779-88e5-adb3e628e3da%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/8c2131f4-5856-4779-88e5-adb3e628e3da%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BLLie7OrCfS9tMR56_n8R%2BXeHRKva3%2BErxXJbukQXCNpRGb1Q%40mail.gmail.com.
