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

starting agents on Unix systems fails with java.io.EOFException.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • slave-setup-plugin
    • Jenkins 2.375.3, Java 11 multiple vendors
      Solaris 11.4, AIX 7.2 and HPIA11

      Seems that the agent is running, 

      find /tmp -type f -atime +10 -delete -iname 'jenkins.sh' -maxdepth 0

       

      It will return non-zero on most Unix platforms -maxdepth and -delete are not standard options on UNIX to find.

      when there is an error and so will normally result in the following log, 

       

       

      <===[JENKINS REMOTING CAPACITY]===>channel started
      Remoting version: 3044.vb_940a_a_e4f72e
      Launcher: SSHLauncher
      Communication Protocol: Standard in/out
      This is a Unix agent
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by jenkins.slaves.StandardOutputSwapper$ChannelSwapper to constructor java.io.FileDescriptor(int)
      WARNING: Please consider reporting this to the maintainers of jenkins.slaves.StandardOutputSwapper$ChannelSwapper
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      Evacuated stdout
      Updating existing installations for sol114
      Clearing temporally data on sol114
      [dev-jenkins] $ /bin/sh -xe /var/tmp/jenkins14295555655355881769.sh
      + find /tmp -type f -atime +10 -delete -iname 'jenkins.sh' -maxdepth 0
      find: bad option -delete
      find: [-H | -L] path-list predicate-list
      ScriptFailed 1
      Agent JVM has not reported exit code. Is it still running?
      [02/14/23 15:12:03] Launch failed - cleaning up connection
      [02/14/23 15:12:03] [SSH] Connection closed.
      ERROR: Connection terminated
      java.io.EOFException
          at java.base/java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2911)
          at java.base/java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3406)
          at java.base/java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:932)
          at java.base/java.io.ObjectInputStream.<init>(ObjectInputStream.java:375)
          at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
          at hudson.remoting.Command.readFrom(Command.java:142)
          at hudson.remoting.Command.readFrom(Command.java:128)
          at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
          at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:61)
      Caused: java.io.IOException: Unexpected termination of the channel
          at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:75)

          [JENKINS-70622] starting agents on Unix systems fails with java.io.EOFException.

          Mark Waite added a comment - - edited

          cousinsgerry that command is used in the agent setup plugin, not in remoting. The agent setup plugin is up for adoption.

          That change was introduced in agent setup plugin source code 5 years ago, but was only released to the Jenkins update center a few days ago with agent setup plugin 1.15.

          If your organization depends on the agent setup plugin, you are encouraged to persuade your organization to allow you to adopt the plugin, improve the plugin, and release a new version of the plugin (either manually or automatically).

          If you're not willing to adopt the plugin, then you can avoid that message by using an older version of the agent setup plugin (1.10 or earlier).

          You can also avoid that problem by not using the agent setup plugin. Remove it from your system and perform agent configuration steps with some other technique.

          Mark Waite added a comment - - edited cousinsgerry that command is used in the agent setup plugin , not in remoting. The agent setup plugin is up for adoption. That change was introduced in agent setup plugin source code 5 years ago, but was only released to the Jenkins update center a few days ago with agent setup plugin 1.15. If your organization depends on the agent setup plugin, you are encouraged to persuade your organization to allow you to adopt the plugin , improve the plugin , and release a new version of the plugin (either manually or automatically ). If you're not willing to adopt the plugin, then you can avoid that message by using an older version of the agent setup plugin (1.10 or earlier). You can also avoid that problem by not using the agent setup plugin. Remove it from your system and perform agent configuration steps with some other technique.

          Mark Waite added a comment - - edited

          Since I was the one that released 1.15, I submitted a pull request to remove the cleanup step that includes the find. I'm not a user of the agent setup plugin. I can't test it. I am willing to release a new version of the agent setup plugin with that fix if an active user of the plugin will confirm that the change works in their installation.

          Download the hpi file from https://ci.jenkins.io/job/Plugins/job/slave-setup-plugin/view/change-requests/job/PR-24/ and report the results of your tests if you're interested in the fix.

          I don't have access to a system that can test the problem. The find command included on FreeBSD and OpenBSD both include the -maxdepth predicate.

          Mark Waite added a comment - - edited Since I was the one that released 1.15, I submitted a pull request to remove the cleanup step that includes the find . I'm not a user of the agent setup plugin. I can't test it. I am willing to release a new version of the agent setup plugin with that fix if an active user of the plugin will confirm that the change works in their installation. Download the hpi file from https://ci.jenkins.io/job/Plugins/job/slave-setup-plugin/view/change-requests/job/PR-24/ and report the results of your tests if you're interested in the fix. I don't have access to a system that can test the problem. The find command included on FreeBSD and OpenBSD both include the -maxdepth predicate.

          Gerry added a comment -

          I have deployed PR-24 and have not had any issues, with it thanks Mark.

           

          Yea, the POSIX version of find is really different than the gnu version.

          Gerry added a comment - I have deployed PR-24 and have not had any issues, with it thanks Mark.   Yea, the POSIX version of find is really different than the gnu version.

            Unassigned Unassigned
            cousinsgerry Gerry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: