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

groovy script fails after upgrade to version 2.361.2 from 2.346.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • groovy-remote-plugin

      Jenkins is running on a Windows 2016 server and has both Ubuntu 20.0 and Windows Server 2019 nodes. All instances are using Java 11. Following the Jenkins upgrade to 2.361.2 from 2.346.2 the following Groovy script fails on the Ubuntu node but continues to run on the Windows node (the Windows version uses the backslash with the filename).

      import hudson.model.*
      import hudson.util.*
      
      def build = Thread.currentThread().executable
      def workspace = build.getWorkspace()
      println workspace
      
      def channel = null
      if (workspace.isRemote())
      {
          channel = workspace.channel
      }
      println channel
      
      fp = new hudson.FilePath(channel, build.workspace.toString() + "/Version.h")
      println fp
      
      contents = ""
      if (fp != null) {
          contents = fp.readToString()
      }
      

      The output is:

      /home/jenkins/workspace/Build
      hudson.remoting.Channel@5c9b8918:Dizzy-Linux
      
      /home/jenkins/workspace/Version.h
      FATAL: Input length = 1
      Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to Dizzy-Linux
      at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1784)
      at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      at hudson.remoting.Channel.call(Channel.java:1000)
      at hudson.FilePath.act(FilePath.java:1186)
      at hudson.FilePath.act(FilePath.java:1175)
      at hudson.FilePath.readToString(FilePath.java:2369)
      at hudson.FilePath$readToString$1.call(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) 

      The file /home/jenkins/workspace/Version.h does exist. 

       

            Unassigned Unassigned
            atweir Alan Weir
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: