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

Failed to connect slave due to missing folder on the master

    XMLWordPrintable

Details

    Description

      We have a JNLP slave which failed to connect.
      On the slave side there was something about a connection reset as error.

      On the server side we found this in the log:

      Feb 5, 2013 9:36:44 AM hudson.TcpSlaveAgentListener$ConnectionHandler run
      INFO: Accepted connection #142 from /10.1.31.168:4798
      Feb 5, 2013 9:36:44 AM hudson.TcpSlaveAgentListener$ConnectionHandler run
      WARNING: Connection #142 failed
      hudson.util.IOException2: Failed to open /opt/jenkins_home/logs/slaves/srv-nl-crd62/slave.log
      	at hudson.util.io.ReopenableFileOutputStream.current(ReopenableFileOutputStream.java:58)
      	at hudson.util.io.ReopenableFileOutputStream.write(ReopenableFileOutputStream.java:65)
      	at hudson.remoting.ClassicCommandTransport.create(ClassicCommandTransport.java:137)
      	at hudson.remoting.Channel.<init>(Channel.java:392)
      	at hudson.remoting.Channel.<init>(Channel.java:388)
      	at hudson.remoting.Channel.<init>(Channel.java:349)
      	at hudson.remoting.Channel.<init>(Channel.java:345)
      	at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:320)
      	at jenkins.slaves.JnlpSlaveAgentProtocol$Handler.jnlpConnect(JnlpSlaveAgentProtocol.java:120)
      	at jenkins.slaves.JnlpSlaveAgentProtocol2$Handler2.run(JnlpSlaveAgentProtocol2.java:100)
      	at jenkins.slaves.JnlpSlaveAgentProtocol2.handle(JnlpSlaveAgentProtocol2.java:44)
      	at hudson.TcpSlaveAgentListener$ConnectionHandler.run(TcpSlaveAgentListener.java:150)
      Caused by: java.io.FileNotFoundException: /opt/jenkins_home/logs/slaves/srv-nl-crd62/slave.log (No such file or directory)
      	at java.io.FileOutputStream.open(Native Method)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:209)
      	at hudson.util.io.ReopenableFileOutputStream.current(ReopenableFileOutputStream.java:56)
      	... 11 more
      

      It appeared to be that the folder /opt/jenkins_home/logs/slaves/srv-nl-crd62 did not exist.
      After creating the folder, the slave could connect.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/pom.xml
            core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
            core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java
            core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java
            http://jenkins-ci.org/commit/jenkins/9a34d9f8b2d388ca625af3bc24801826a2f0cb64
            Log:
            [FIXED JENKINS-16634] Do not fail to write a log file just because something deleted the parent directory.
            (cherry picked from commit afe17a4bda72dc722e505967efc88ef449c0fd75)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java http://jenkins-ci.org/commit/jenkins/9a34d9f8b2d388ca625af3bc24801826a2f0cb64 Log: [FIXED JENKINS-16634] Do not fail to write a log file just because something deleted the parent directory. (cherry picked from commit afe17a4bda72dc722e505967efc88ef449c0fd75)

            Code changed in jenkins
            User: Jesse Glick
            Path:
            core/pom.xml
            core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
            core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java
            core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java
            http://jenkins-ci.org/commit/jenkins/afe17a4bda72dc722e505967efc88ef449c0fd75
            Log:
            [FIXED JENKINS-16634] Do not fail to write a log file just because something deleted the parent directory.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/pom.xml core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/test/java/hudson/util/io/ReopenableRotatingFileOutputStreamTest.java core/src/test/java/hudson/util/io/RewindableRotatingFileOutputStreamTest.java http://jenkins-ci.org/commit/jenkins/afe17a4bda72dc722e505967efc88ef449c0fd75 Log: [FIXED JENKINS-16634] Do not fail to write a log file just because something deleted the parent directory.
            danielbeck Daniel Beck added a comment -

            No response to comment asking for updated information in 2.5 months, so resolving as Incomplete.

            danielbeck Daniel Beck added a comment - No response to comment asking for updated information in 2.5 months, so resolving as Incomplete.

            AFAIR various logs were moved from JENKINS_HOME to subdirectory. Is it still reproducible?

            integer Kanstantsin Shautsou added a comment - AFAIR various logs were moved from JENKINS_HOME to subdirectory. Is it still reproducible?
            danielbeck Daniel Beck added a comment -

            Can this be reproduced on recent versions of Jenkins? Quite a bit was changed in JNLP slave handling, so I'm not sure how relevant this report still is to current Jenkins.

            danielbeck Daniel Beck added a comment - Can this be reproduced on recent versions of Jenkins? Quite a bit was changed in JNLP slave handling, so I'm not sure how relevant this report still is to current Jenkins.
            cbos Cees Bos added a comment -

            No, we did change anything to the logging. All other slaves (80+) were working fine.
            The master is a linux machine, the slave is a windows machine.
            The error is in the logfile of the master, and is complaining about a location on the master.

            cbos Cees Bos added a comment - No, we did change anything to the logging. All other slaves (80+) were working fine. The master is a linux machine, the slave is a windows machine. The error is in the logfile of the master, and is complaining about a location on the master.
            oleg_nenashev Oleg Nenashev added a comment -

            Do you redirect log directory outside the slave's workspace (opt/jenkins_home/logs/slaves/srv-nl-crd62/slave.log)? If yes, then behavior is predictable. Jenkins creates folders tree only for workspace.

            oleg_nenashev Oleg Nenashev added a comment - Do you redirect log directory outside the slave's workspace (opt/jenkins_home/ logs /slaves/srv-nl-crd62/slave.log)? If yes, then behavior is predictable. Jenkins creates folders tree only for workspace.

            Try update jenkins version?

            integer Kanstantsin Shautsou added a comment - Try update jenkins version?

            People

              jglick Jesse Glick
              cbos Cees Bos
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: