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

Xvfb does not work when wrap([$class: 'Xvfb']) is defined inside timestamps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins: 2.150.1
      Xvfb: 1.1.3
      timestamper: 1.8.10

      See more in Jenkins Master.html and Jenkins Slave.html files

      Xvfb cannot connect to a machine when it is enclosed inside timestamps step or option. The pipeline throws an exception:

      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from XX.YY.ZZ.WW/XX.YY.ZZ.WW:47130
      [...]
      java.lang.IllegalAccessError: tried to access field hudson.remoting.Channel.executor from class org.jenkinsci.remoting.util.AnonymousClassWarnings
      [...]
      Caused: java.io.IOException: Remote call on JNLP4-connect connection from XX.YY.ZZ.WW/XX.YY.ZZ.WW:47130 failed
      

      I checked and the following pipelines throw exceptions:

      pipeline {
          agent {
              label 'swarm'
          }
          options {
              timestamps()
          }
          stages {
              stage('Main') {
                  steps {
                      wrap([$class: 'Xvfb']) {
                          echo 'never reached'
                      }
                  }
              }
          }
      }
      
      pipeline {
          agent {
              label 'swarm'
          }
          stages {
              stage('Main') {
                  steps {
                      timestamps {
                          wrap([$class: 'Xvfb']) {
                              echo 'never reached'
                          }
                      }
                  }
              }
          }
      }
      

      and this works correctly:

      pipeline {
          agent {
              label 'swarm'
          }
          stages {
              stage('Main') {
                  steps {
                      wrap([$class: 'Xvfb']) {
                          timestamps {
                              echo 'reached'
                          }
                      }
                  }
              }
          }
      }
      

        1. stacktrace.txt
          12 kB
        2. Jenkins Slave.html
          9 kB
        3. Jenkins Master.html
          20 kB

            Unassigned Unassigned
            agabrys Adam Gabryś
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: