-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
Jenkins 2.1, Windows Server 2012 R2, EC2 version 1.31.
Hello All,
I've been trying to run this plugin with Windows 2012 and i'm stuck in some WinRM loop where it cannot connect. I tried setting the launch delay up to 600 seconds to ensure my instance is up before trying any WinRM commands. No luck. Here is what i'm seeing:
May 04, 2016 4:42:34 PM FINE hudson.plugins.ec2.win.winrm.WinRMClient opening winrm shell to: http://172.31.202.208:5985/wsman May 04, 2016 4:42:34 PM FINEST hudson.plugins.ec2.win.winrm.WinRMClient Request: POST http://172.31.202.208:5985/wsman <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd"><env:Header><a:To>http://172.31.202.208:5985/wsman</a:To><a:ReplyTo><a:Address mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:MaxEnvelopeSize mustUnderstand="true">153600</w:MaxEnvelopeSize><a:MessageID>uuid:D6FA9229-05D6-4199-B7B6-ACFA6D195CBE</a:MessageID><w:Locale mustUnderstand="false" xml:lang="en-US"/><p:DataLocale mustUnderstand="false" xml:lang="en-US"/><w:OperationTimeout>PT60S</w:OperationTimeout><a:Action mustUnderstand="true">http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI><w:OptionSet><w:Option Name="WINRS_NOPROFILE">FALSE</w:Option><w:Option Name="WINRS_CODEPAGE">437</w:Option></w:OptionSet></env:Header><env:Body><rsp:Shell><rsp:InputStreams>stdin</rsp:InputStreams><rsp:OutputStreams>stdout stderr</rsp:OutputStreams></rsp:Shell></env:Body></env:Envelope> May 04, 2016 4:42:35 PM FINEST hudson.plugins.ec2.win.winrm.WinRMClient Response: <?xml version="1.0" encoding="UTF-8"?> <s:Envelope 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:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:rsp="http://schemas.microsoft.com/wbem/wsman/1/windows/shell" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xml:lang="en-US"><s:Header><a:Action>http://schemas.xmlsoap.org/ws/2004/09/transfer/CreateResponse</a:Action><a:MessageID>uuid:792A9FDE-030D-4646-89A5-8432A425C947</a:MessageID><a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To><a:RelatesTo>uuid:D6FA9229-05D6-4199-B7B6-ACFA6D195CBE</a:RelatesTo></s:Header><s:Body><x:ResourceCreated><a:Address>http://172.31.202.208:5985/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI><w:SelectorSet><w:Selector Name="ShellId">96758FBF-0CF8-4E59-9E41-FF96E16903AC</w:Selector></w:SelectorSet></a:ReferenceParameters></x:ResourceCreated><rsp:Shell><rsp:ShellId>96758FBF-0CF8-4E59-9E41-FF96E16903AC</rsp:ShellId><rsp:ResourceUri>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</rsp:ResourceUri><rsp:Owner>JENKINSSLAVE\Administrator</rsp:Owner><rsp:ClientIP>172.31.202.241</rsp:ClientIP><rsp:IdleTimeOut>PT7200.000S</rsp:IdleTimeOut><rsp:InputStreams>stdin</rsp:InputStreams><rsp:OutputStreams>stdout stderr</rsp:OutputStreams><rsp:ShellRunTime>P0DT0H0M0S</rsp:ShellRunTime><rsp:ShellInactivity>P0DT0H0M0S</rsp:ShellInactivity></rsp:Shell></s:Body></s:Envelope> May 04, 2016 4:42:35 PM FINER hudson.plugins.ec2.win.winrm.WinRMClient shellid: 96758FBF-0CF8-4E59-9E41-FF96E16903AC May 04, 2016 4:42:35 PM FINE hudson.plugins.ec2.win.winrm.WinRMClient closing winrm shell 96758FBF-0CF8-4E59-9E41-FF96E16903AC May 4, 2016 4:20:46 PM WARNING hudson.plugins.ec2.win.winrm.WinRMClient sendRequest winrm returned 401 - shouldn't happen though - retrying in 2 minutes Waiting for WinRM to come up. Sleeping 10s. Connecting to ec2-windows-host.compute-1.amazonaws.com(<<host ip>>) with WinRM as svc.... Waiting for WinRM to come up. Sleeping 10s. etc etc
I know WinRM is setup and working correctly, i can connect over Telnet. And I've run the commands suggested from the plugin:
winrm quickconfig winrm set winrm/config/service/Auth @{Basic="true"} winrm set winrm/config/service @{AllowUnencrypted="true"} winrm set winrm/config/winrs @{MaxMemoryPerShellMB="1024"}
I do have a question in addition to the bug and that is: Do we just need to specify and administrative user, not precisely "Administrator" ?
I've spent the entire day working on this and I'm simply out of options.
Thank you Brendan for this information.
I also found another cause of connection issues: the Windows 10 server AMIs on Amazon will block incoming WinRM traffic from the public network by default (I think this is the default setting in Windows). This needs to be changed in the firewall rules.
(BTW I would suggest to only allow traffic from the Jenkins master IP, either through the Windows firewall or the Amazon security group or both)