Skip to content

Instantly share code, notes, and snippets.

@zl4bv
Last active August 29, 2015 14:18
Show Gist options
  • Save zl4bv/bb5d5b6f322f29198535 to your computer and use it in GitHub Desktop.
Save zl4bv/bb5d5b6f322f29198535 to your computer and use it in GitHub Desktop.
Attempts to reproduce file transfer error using winrmcp

Attempt 1: "Server execution failed"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de321-abfa-d5a3-769a-82d07712b1c1.tmp: Couldn't create shell: http error: 5
00 - <s:Envelope xml:lang="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/
ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2
004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman
/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/
wbem/wsman/1/wsman/fault</a:Action><a:MessageID>uuid:10DDAF0C-7AED-44FC-A4E0-356F05727E90</a:MessageID><a:To>http://sche
mas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:03f180e1-4432-4a1d-6227-18314036acfb</a:Rel
atesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s
:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">Server execution failed </s:Text></s:Reason><s:Detail><f:WSManFault
 xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2148007941" Machine="localhost"><f:Message><f:Prov
iderFault provider="Shell cmd plugin" path="%systemroot%\system32\winrscmd.dll">Server execution failed </f:ProviderFaul
t></f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope>

Attempt 2: "Server execution failed"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de36f-171d-d260-3cab-3b80b9fe086e.tmp: Couldn't create shell: http error: 5
00 - <s:Envelope xml:lang="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/
ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2
004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman
/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/
wbem/wsman/1/wsman/fault</a:Action><a:MessageID>uuid:C3973ABE-C2FB-44E7-AE91-654B6C3F5920</a:MessageID><a:To>http://sche
mas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:e9d3b702-cf36-4f38-468b-0e0f90ad88d5</a:Rel
atesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s
:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">Server execution failed </s:Text></s:Reason><s:Detail><f:WSManFault
 xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2148007941" Machine="localhost"><f:Message><f:Prov
iderFault provider="Shell cmd plugin" path="%systemroot%\system32\winrscmd.dll">Server execution failed </f:ProviderFaul
t></f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope>

Attempt 3: "Server execution failed"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de3ba-a72f-4e7d-e69d-3ab445a586bd.tmp: Couldn't create shell: http error: 5
00 - <s:Envelope xml:lang="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/
ws/2004/08/addressing" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2
004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman
/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/
wbem/wsman/1/wsman/fault</a:Action><a:MessageID>uuid:7B5DFA28-787F-4E86-B03B-6F8E336EEF51</a:MessageID><a:To>http://sche
mas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:c43e8347-2c2d-4349-7fec-41a6d2900804</a:Rel
atesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s
:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">Server execution failed </s:Text></s:Reason><s:Detail><f:WSManFault
 xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2148007941" Machine="localhost"><f:Message><f:Prov
iderFault provider="Shell cmd plugin" path="%systemroot%\system32\winrscmd.dll">Server execution failed </f:ProviderFaul
t></f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope>

At this point I decided to run SysInternals' Process Explorer inside the VM to see what it was doing.

The following error occurred during the step where it reads the temp file into memory (inside the VM), base64 decodes it, and writes it to file.

Attempt 4: "MemoryException"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Exception calling "Join" wi
th "2" argument(s): "Exception of type 'System.OutOf_x000D__x000A_</S><S S="Error">MemoryException' was thrown."_x000D__
x000A_</S><S S="Error">At line:14 char:35_x000D__x000A_</S><S S="Error">+             $base64_string = [string]::join &l
t;&lt;&lt;&lt; ("",$base64_lines)_x000D__x000A_</S><S S="Error">    + CategoryInfo          : NotSpecified: (:) [], Meth
odInvocationException_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : DotNetMethodException_x000D__x000A_</S
><S S="Error"> _x000D__x000A_</S></Objs>

The following error occurred during the "echo ~8000 bytes at a time over WinRM" step.

Attempt 5: "Access is denied"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=
vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de77f-60cb-bae5-9737-63eef066ca41.tmp: http error: 500 - <s:Envelope xml:la
ng="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:
n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="
http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/faul
t</a:Action><a:MessageID>uuid:69C51DAA-DE71-41B6-8547-D3949AC62BA1</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004
/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:0a7c2790-9644-4752-6061-38413674fcc8</a:RelatesTo></s:Header><s:Bo
dy><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>w:AccessDenied</s:Value></s:Subcode></s:Code><s:Reaso
n><s:Text xml:lang="en-US">Access is denied. </s:Text></s:Reason><s:Detail><f:WSManFault xmlns:f="http://schemas.microso
ft.com/wbem/wsman/1/wsmanfault" Code="5" Machine="localhost"><f:Message><f:ProviderFault provider="Shell cmd plugin" pat
h="%systemroot%\system32\winrscmd.dll">Access is denied. </f:ProviderFault></f:Message></f:WSManFault></s:Detail></s:Fau
lt></s:Body></s:Envelope>

The following error occurred at the start of the copy step before it could even start copying the file.

Attempt 6: "The maximum number of concurrent operations for this user has been exceeded"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de7c3-cb56-bd10-9f29-702299ae09ca.tmp: http error: 500 - <s:Envelope xml:la
ng="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:
n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="
http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/faul
t</a:Action><a:MessageID>uuid:5ADE7DE6-C828-4FF9-BBED-14E649620B3A</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004
/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:6815f017-4229-430e-534f-f636b96dcf87</a:RelatesTo></s:Header><s:Bo
dy><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s:Subcode></s:Code><s:Re
ason><s:Text xml:lang="en-US">The WS-Management service cannot process the request. The maximum number of concurrent ope
rations for this user has been exceeded. Close existing operations for this user, or raise the quota for this user. </s:
Text></s:Reason><s:Detail><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859174"
 Machine="localhost"><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum num
ber of 15 concurrent operations, which has been exceeded. Close existing operations for this user, or raise the quota fo
r this user. </f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope>

Attempt 7: "The maximum number of concurrent operations for this user has been exceeded"

PS K:\packer> .\bin\packer-winrmcp.exe -addr=localhost:6776 -user=vagrant -pass=vagrant .\sample.wav c:\sample.wav
Error uploading file to $env:TEMP\winrmfs-551de80b-d036-4b28-33cd-2d963e539537.tmp: http error: 500 - <s:Envelope xml:la
ng="en-US" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:
n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="
http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><s:Header><a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/faul
t</a:Action><a:MessageID>uuid:9E765B36-FCF9-40DE-A9FB-38EAF5117AD9</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004
/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:30d667d0-3b98-4e45-76cd-28a18b865550</a:RelatesTo></s:Header><s:Bo
dy><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value>w:InternalError</s:Value></s:Subcode></s:Code><s:Re
ason><s:Text xml:lang="en-US">The WS-Management service cannot process the request. The maximum number of concurrent ope
rations for this user has been exceeded. Close existing operations for this user, or raise the quota for this user. </s:
Text></s:Reason><s:Detail><f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="2150859174"
 Machine="localhost"><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum num
ber of 15 concurrent operations, which has been exceeded. Close existing operations for this user, or raise the quota fo
r this user. </f:Message></f:WSManFault></s:Detail></s:Fault></s:Body></s:Envelope>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment