You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task runs and returns successfully with no visible issues.
ACTUAL RESULTS
Task runs and returns successfully, however the output is broken and there's a clear indication of some issue in the backend. I can run with extra verbosity but I think the normal output gives all the necessary information.
You can see the C# errors and the broken output with an unknown list inserted in it.
{
"changed": true,
"debug": [],
"error": [
{
"category_info": {
"activity": "",
"category": "OperationStopped",
"category_id": 14,
"reason": "InvalidOperationException",
"target_name": "",
"target_type": ""
},
"error_details": null,
"exception": {
"help_link": null,
"hresult": -2146233079,
"inner_exception": null,
"message": "Failed to compile C# code:\r\n(1,1): hidden CS8019: Unnecessary using directive.\r\nusing Microsoft.Win32.SafeHandles;\r\n^\r\nerror CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: 'diasymreader.dll''",
"source": null,
"type": "System.InvalidOperationException"
},
"fully_qualified_error_id": "Failed to compile C# code:\r\n(1,1): hidden CS8019: Unnecessary using directive.\r\nusing Microsoft.Win32.SafeHandles;\r\n^\r\nerror CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: 'diasymreader.dll''",
"output": "Failed to compile C# code:\r\n(1,1): hidden CS8019: Unnecessary using directive.\r\nusing Microsoft.Win32.SafeHandles;\r\n^\r\nerror CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: \r\n'diasymreader.dll''\r\nAt line:259 char:17\r\n+ ... throw [InvalidOperationException]\"Failed to compile C# co ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : OperationStopped: (:) [], InvalidOperationException\r\n + FullyQualifiedErrorId : Failed to compile C# code:\r\n(1,1): hidden CS8019: Unnecessary using directive.\r\nusing Microsoft.Win32.SafeHandles;\r\n^\r\nerror CS0041: Unexpected error writing debug information -- 'The version of Windows PDB writer is older than required: \r\n'diasymreader.dll''\r\n \r\n",
"pipeline_iteration_info": [],
"script_stack_trace": "at <ScriptBlock>, <No file>: line 259\r\nat <ScriptBlock>, <No file>: line 30",
"target_object": null
}
],
"host_err": "",
"host_out": "",
"information": [],
"output": [
{
"Capacity": 122,
"Length": 52,
"MaxCapacity": 2147483647
},
{
"Capacity": 122,
"Length": 88,
"MaxCapacity": 2147483647
},
{
"Capacity": 122,
"Length": 88,
"MaxCapacity": 2147483647
},
{
"Capacity": 122,
"Length": 88,
"MaxCapacity": 2147483647
},
{
"Capacity": 122,
"Length": 89,
"MaxCapacity": 2147483647
},
{
"GitCommitId": "7.4.0",
"OS": "Microsoft Windows 10.0.17763",
"PSCompatibleVersions": [
"1.0",
"2.0",
"3.0",
"4.0",
"5.0",
"5.1",
"6.0",
"7.0"
],
"PSEdition": "Core",
"PSRemotingProtocolVersion": {
"Build": -1,
"Major": 2,
"MajorRevision": -1,
"Minor": 3,
"MinorRevision": -1,
"Revision": -1
},
"PSVersion": {
"BuildLabel": null,
"Major": 7,
"Minor": 4,
"Patch": 0,
"PreReleaseLabel": null
},
"Platform": "Win32NT",
"SerializationVersion": {
"Build": 0,
"Major": 1,
"MajorRevision": 0,
"Minor": 1,
"MinorRevision": 1,
"Revision": 1
},
"WSManStackVersion": {
"Build": -1,
"Major": 3,
"MajorRevision": -1,
"Minor": 0,
"MinorRevision": -1,
"Revision": -1
}
}
],
"result": {},
"verbose": [],
"warning": []
}
The text was updated successfully, but these errors were encountered:
Thanks, I wonder if the issue is due to a change in pwsh 7.4 which uses dotnet 8. Will have to look into the Add-Type error and see how we can fix this.
I am weirdly not able to replicate the error but I believe #572 will fix this issue for you. I'm not sure if potentially there are some env vars that might be cause a problem here or whether a custom compiler is higher in the PATH causing these errors to be emitted.
SUMMARY
Running the win_powershell task with
executable: pwsh.exe
specified results in broken output, with "Failed to compile C# code" among the error output.ISSUE TYPE
COMPONENT NAME
win_powershell
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Host is WSL running Ubuntu 20.04.6 LTS
Target is Windows Server 2019 Datacenter
Issues only happen with Powershell 7, not 5
STEPS TO REPRODUCE
A simple powershell task is enough as long as it runs Powershell 7
EXPECTED RESULTS
Task runs and returns successfully with no visible issues.
ACTUAL RESULTS
Task runs and returns successfully, however the output is broken and there's a clear indication of some issue in the backend. I can run with extra verbosity but I think the normal output gives all the necessary information.
You can see the C# errors and the broken output with an unknown list inserted in it.
The text was updated successfully, but these errors were encountered: