test-kitchen / winrm-transport

WinRM transport logic for re-using remote shells and uploading files
Other
8 stars 9 forks source link

FileTransporter fails on WMF5 production preview #14

Closed brantb closed 8 years ago

brantb commented 8 years ago

During a kitchen converge, when FileTransporter attempts to transport files to a Windows 2012 R2 host running the WMF5 Production Preview, the check_files.ps1 script writes a ] to stderr, causing the command to fail.

INFO -- InstanceName: Transferring files to <InstanceName>
DEBUG -- InstanceName: [TmpZip::C:/Users/Username/AppData/Local/Temp/tmpzip-20150923-9904-1emv2xl.zip] Populating files
DEBUG -- InstanceName: [TmpZip::C:/Users/Username/AppData/Local/Temp/tmpzip-20150923-9904-1emv2xl.zip] +++ Adding configuration/dsc_configuration.ps1
DEBUG -- InstanceName: [TmpZip::C:/Users/Username/AppData/Local/Temp/tmpzip-20150923-9904-1emv2xl.zip] === All files added.
DEBUG -- InstanceName: [TmpZip::C:/Users/Username/AppData/Local/Temp/tmpzip-20150923-9904-1e0861b.zip] Populating files
[file list snipped]
DEBUG -- InstanceName: [TmpZip::C:/Users/Username/AppData/Local/Temp/tmpzip-20150923-9904-1e0861b.zip] === All files added.
DEBUG -- InstanceName: [FileTransporter] Running check_files.ps1
DEBUG -- InstanceName: [FileTransporter] @{
DEBUG -- InstanceName: [FileTransporter]   "$env:TEMP\tmpzip-7cb0aa29ea8ee60b15cd8822a7f7e39e.zip" = "7cb0aa29ea8ee60b15cd8822a7f7e39e";
DEBUG -- InstanceName: [FileTransporter]   "$env:TEMP\tmpzip-11058e52d4c96c187e4595050c9be61e.zip" = "11058e52d4c96c187e4595050c9be61e"
DEBUG -- InstanceName: [FileTransporter] }
DEBUG -- InstanceName: Cleaning up local sandbox in C:/Users/Username/AppData/Local/Temp/InstanceName-sandbox-20150923-9904-z2tupe
ERROR -- InstanceName: Converge failed on instance <InstanceName>.
ERROR -- InstanceName: ------Exception-------
ERROR -- InstanceName: Class: WinRM::Transport::FileTransporterFailed
ERROR -- InstanceName: Message: [WinRM::Transport::FileTransporter] Upload failed (exitcode: 0), but stderr present
]
ERROR -- InstanceName: ------Backtrace-------
ERROR -- InstanceName: C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.2/lib/winrm/transport/file_transporter.rb:387:in `parse_response'
ERROR -- InstanceName: C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.2/lib/winrm/transport/file_transporter.rb:184:in `check_files'
ERROR -- InstanceName: C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/winrm-transport-1.0.2/lib/winrm/transport/file_transporter.rb:90:in `block in upload'
[stacktrace snipped]

(From a discussion in #kitchenci)

cc: @smurawski

brantb commented 8 years ago

The ] character might be a red herring. The actual contents of output.stderr in the parse_response method is the following string:

=> "#< CLIXML\r\n<Objs Version=\"1.1.0.1\" xmlns=\"http://schemas.microsoft.com/powershell/2004/04\"><Obj S=\"progress\" RefId=\"0\"><TN RefId=\"0\"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N=\"SourceId\">1</I64><PR N=\"Record\"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S=\"progress\" RefId=\"1\"><TNRef RefId=\"0\" /><MS><I64 N=\"SourceId\">1</I64><PR N=\"Record\"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>"

Passing this through clixml_to_s returns an empty string, so I'm not sure where the "]" in the console output is actually coming from.

On a target host running WMF4, output.stderr is an empty string.

rschiefer commented 8 years ago

I'm also having this issue.

smurawski commented 8 years ago

I believe this is related to not silencing the progress stream in checkfiles.ps1 - which https://github.com/test-kitchen/winrm-transport/pull/15 addresses.

JasonMorgan commented 8 years ago

Also failing on WMF 5 RTM for 2012r2.

smurawski commented 8 years ago

@jasonmorgan what version of winrm-transport? Have you updated to the latest?

JasonMorgan commented 8 years ago

I was at 1.0.2, just updated to 1.0.3, I'll let you know if it still occurs.

On Wed, Dec 23, 2015 at 3:32 PM, Steven Murawski notifications@github.com wrote:

@jasonmorgan https://github.com/jasonmorgan what version of winrm-transport? Have you updated to the latest?

— Reply to this email directly or view it on GitHub https://github.com/test-kitchen/winrm-transport/issues/14#issuecomment-167002723 .

Respectfully, Jason Morgan jmorgan@f9vs.com (720) 877-1864 Twitter @rjasonmorgan

JasonMorgan commented 8 years ago

Well Merry Christmas to me, upgrading winrm-transport to 1.0.3 from 1.0.2 fixed my issue. Thanks a ton @smurawski!

smurawski commented 8 years ago

@jasonmorgan you are very welcome! Merry Christmas!

beaudryj commented 8 years ago

Thank you @JasonMorgan this just solved our Woes :+1:

smurawski commented 8 years ago

This was fixed with 1.0.3.