How to fix "The WinRM service cannot process the request because the wsman:ConnectionRetry element in the DeliverTo is invalid."
Description
This error occurs in Microsoft Windows environments when using Windows Remote Management (WinRM) for event forwarding, remote scripting, or WS-Management sessions. It specifically indicates a schema validation failure within the SOAP request payload sent to the WinRM service.
The DeliverTo element in the WS-Eventing or WS-Management XML structure defines how and where notifications or responses should be delivered. Inside this structure, the wsman:ConnectionRetry element tells the service how many times or how frequently it should attempt to reconnect if a connection fails.
The WinRM service throws this error due to two primary reasons:
- Invalid Value Data Types: The value provided inside the
<wsman:ConnectionRetry>tags does not conform to the expected XML data type (such as an integer or specific duration format). - Schema Mismatch (WS-Management Version Compatibility): The client application generating the request is using an outdated or non-standard implementation of the WS-Management protocol that introduces syntax elements that the receiving Windows WinRM service cannot parse or explicitly rejects.
Step-by-Step Fixes
Depending on whether you are running an event subscription, executing custom PowerShell scripts, or managing third-party monitoring tools, use the following methods to resolve the issue.
Method 1: Modify or Remove the ConnectionRetry Parameter in Event Subscriptions
If you are using Windows Event Forwarding (WEF), the retry element is often defined inside the subscription configuration.
- Open PowerShell as an Administrator.
- Export your current subscription configuration to an XML file by running:
wecutil gs "YourSubscriptionName" /f:xml > C:\subscription.xml - Open
C:\subscription.xmlusing Notepad or an XML editor. - Search for the
<wsman:ConnectionRetry>tag. - Verify its value. If it contains invalid characters, symbols, or letters, change it to a valid integer (for example,
5). - If the parameter is not strictly required by your workflow, delete the entire
<wsman:ConnectionRetry>...</wsman:ConnectionRetry>block from the file. - Save and close the file.
- Update the subscription in Windows using the modified XML file:
wecutil ss /c:C:\subscription.xml
Method 2: Update Third-Party Monitoring Agents or Management Software
If this error occurs when a Linux server, a monitoring tool (like Nagios, Zabbix, SolarWinds), or a backup system connects to your Windows machine, the client software is sending malformed XML headers.
- Identify the software initiating the remote connection to the Windows machine.
- Check the vendor documentation for known WinRM compatibility patches.
- Update the management agent, SDK, or command-line utility on the client side to the latest version.
- If you are using a custom Python script (e.g., via
pywinrm), ensure your libraries are updated, as older versions had formatting bugs with certain WS-Man extensions.
Method 3: Restart and Reset the WinRM Service Configuration
Corrupted WinRM listeners or conflicting configuration policies can cause parsing errors. Resetting the service ensures standard parameters are applied.
- Press the Windows Key + X and select Terminal (Admin) or Command Prompt (Admin).
- Stop the WinRM service by typing:
net stop winrm - Reset the WinRM default configuration parameters back to factory settings:
winrm quickconfig -q - Check the status of your listeners to ensure they are clean:
winrm e winrm/config/listener - Start the WinRM service again:
net start winrm
Method 4: Adjust WSman Retry Registry Values (For Advanced Environments)
If group policies or registry configurations are pushing strict or corrupt WS-Management delivery settings, you can check the registry.
- Press Windows Key + R, type
regedit, and hit Enter to open the Registry Editor. - Navigate to the following path:
HKEY LOCAL MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\ - Look for any subkeys related to
ClientorServiceconfigurations that define custom retry profiles. - Ensure no string values (
REG SZ) are assigned where DWORD values are expected for retry counts. - Close the Registry Editor and reboot the computer to apply changes.
There may be some errors. Learn Microsoft