Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45337

EC2 plugin cant launch windows slave (Unexpected EOF)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • ec2-plugin
    • None
    • ec2-plugin 1.36
      jenkins 2.7.4
      jdk 1.8.0_131
      Windows 2008x64

      Hi all,

      Recently i started to create my AWS environment for Windows 2008 slaves.

      I have configured my AMI (2008 x64) with:

      • Jenkins user under Administrators group
        -Windows Firewall off. (I reach the instance using telnet to 445 and 5985 ports)
        -WinRM HTTP configuration:

      winrm quickconfig
      winrm set winrm/config/service/Auth @

      {Basic="true"}

      winrm set winrm/config/service @

      {AllowUnencrypted="true"}

      winrm set winrm/config/winrs @

      {MaxMemoryPerShellMB="1024"}

      This is the Jenkins log:

      WinRM service responded. Waiting for WinRM service to stabilize on Windows slave (i-089160ce7ccb480fb)
      WinRM should now be ok on Windows slave (i-089160ce7ccb480fb)
      Connected with WinRM.
      Creating tmp directory if it does not exist
      slave.jar sent remotely. Bootstrapping it
      <===[JENKINS REMOTING CAPACITY]===>Slave.jar version: 2.60
      This is a Windows agent
      ERROR: Connection terminated
      Ouch:
      hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected EOF
      	at hudson.remoting.Request.abort(Request.java:303)
      	at hudson.remoting.Channel.terminate(Channel.java:847)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:92)
      	at ......remote call to Windows slave (i-089160ce7ccb480fb)(Native Method)
      	at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1416)
      	at hudson.remoting.Request.call(Request.java:172)
      	at hudson.remoting.Channel.call(Channel.java:780)
      	at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:536)
      	at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:381)
      	at hudson.plugins.ec2.win.EC2WindowsLauncher.launch(EC2WindowsLauncher.java:70)
      	at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:122)
      	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:253)
      	at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.IOException: Unexpected EOF
      	at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:99)
      	at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
      	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
      java.io.IOException: Unexpected EOF
      	at hudson.remoting.ChunkedInputStream.readUntilBreak(ChunkedInputStream.java:99)
      	at hudson.remoting.ChunkedCommandTransport.readBlock(ChunkedCommandTransport.java:39)
      	at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
      

      WinRM Jenkins logger:

      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2461 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 154 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 154 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 154 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 154 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 154 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 310 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 310 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 310 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 310 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 2 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 310 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 1 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 321 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 76 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 0 bytes from stdout
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      piping 0 bytes from stderr
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      no more output - command is now done - exit code: 1
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WindowsProcess
      no more output for java  -jar C:\\jenkins\\tmp\\slave.jar
      Jul 07, 2017 10:02:02 AM SEVERE hudson.plugins.ec2.win.winrm.WinRMClient sendRequest
      I/O Exception in HTTP POST
      java.io.IOException: Attempted read from closed stream.
      	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:167)
      	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
      	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
      	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      	at java.io.InputStreamReader.read(InputStreamReader.java:184)
      	at java.io.Reader.read(Reader.java:140)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:247)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:291)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:264)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:191)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendInput(WinRMClient.java:123)
      	at hudson.plugins.ec2.win.winrm.WindowsProcess$2.run(WindowsProcess.java:145)
      
      Jul 07, 2017 10:02:02 AM WARNING hudson.plugins.ec2.win.winrm.WindowsProcess$2 run
      ouch, STDIN exception for java  -jar C:\\jenkins\\tmp\\slave.jar
      hudson.plugins.ec2.win.winrm.RuntimeIOException: I/O Exception Attempted read from closed stream.
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:279)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:191)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendInput(WinRMClient.java:123)
      	at hudson.plugins.ec2.win.winrm.WindowsProcess$2.run(WindowsProcess.java:145)
      Caused by: java.io.IOException: Attempted read from closed stream.
      	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:167)
      	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
      	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
      	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      	at java.io.InputStreamReader.read(InputStreamReader.java:184)
      	at java.io.Reader.read(Reader.java:140)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:247)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:291)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:264)
      	... 3 more
      
      Jul 07, 2017 10:02:02 AM FINE hudson.plugins.ec2.win.winrm.WinRMClient
      signalling winrm shell E1A58BD8-49F1-4CC0-905C-A6584AF4B447 command: 0C31E7B9-BA0B-42EF-BC76-B00BD5703627
      Jul 07, 2017 10:02:02 AM FINEST hudson.plugins.ec2.win.winrm.WinRMClient
      Request:
      POST http://54.194.182.247: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://54.194.182.247: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:00E642F1-F57B-4739-945A-5877F3B5A896</a:MessageID><w:Locale mustUnderstand="false" xml:lang="en-US"/><p:DataLocale mustUnderstand="false" xml:lang="en-US"/><w:OperationTimeout>PT24H0S</w:OperationTimeout><a:Action mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/Command</a:Action><w:SelectorSet><w:Selector Name="ShellId">E1A58BD8-49F1-4CC0-905C-A6584AF4B447</w:Selector></w:SelectorSet><w:ResourceURI mustUnderstand="true">http://schemas.microsoft.com/wbem/wsman/1/windows/shell/cmd</w:ResourceURI></env:Header><env:Body><rsp:Signal CommandId="0C31E7B9-BA0B-42EF-BC76-B00BD5703627"><rsp:Code>http://schemas.microsoft.com/wbem/wsman/1/windows/shell/signal/terminate</rsp:Code></rsp:Signal></env:Body></env:Envelope>
      Jul 07, 2017 10:02:03 AM SEVERE hudson.plugins.ec2.win.winrm.WinRMClient sendRequest
      I/O Exception in HTTP POST
      java.io.IOException: Attempted read from closed stream.
      	at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:167)
      	at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
      	at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
      	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
      	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      	at java.io.InputStreamReader.read(InputStreamReader.java:184)
      	at java.io.Reader.read(Reader.java:140)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:247)
      	at org.apache.http.util.EntityUtils.toString(EntityUtils.java:291)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:264)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.sendRequest(WinRMClient.java:191)
      	at hudson.plugins.ec2.win.winrm.WinRMClient.signal(WinRMClient.java:116)
      	at hudson.plugins.ec2.win.winrm.WindowsProcess.destroy(WindowsProcess.java:88)
      	at hudson.plugins.ec2.win.EC2WindowsLauncher$1.onClosed(EC2WindowsLauncher.java:73)
      	at hudson.remoting.Channel.terminate(Channel.java:868)
      	at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:92)
      

      I need help, this is very important for my work.

      Thanks!

            kohsuke Kohsuke Kawaguchi
            majano Daniel Majano
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: