LinkageError loader attempted duplicate class definition for name causes Jenkins to doesn't start

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Using load step to load two different groovy files without an explicit class but the same package declaration, causes Jenkins to fail during startup process if the build should be resumed.

      For example, create a dummy pipeline like

      def util
      def config
      def util2
      
      node('master') {
          sh 'cp -r /tmp/test/src .'
      
          config = load 'src/org/foo/devops/JenkinsEnvironment.groovy'
          util = load 'src/org/foo/devops/Utility.groovy'
      
          config.loadProdConfiguration()    
      }
      util.isValueExist("")
      
      echo "kill me while I'm sleeping"
      sleep 20
      
      node('master') {
          util2 = load 'src/org/foo/devops/Utility.groovy'
          util = load 'src/org/foo/devops/Utility.groovy'
      }
      

      And copy the two attached files at /tmp/test/src/org/foo/devops/
      (Files can be retrieved as you prefer)

      Build the job and restart jenkins while is building.

      Then you won't be able to access Jenkins.

        1. startup-error.log
          8 kB
        2. startup-page.log
          3 kB
        3. JenkinsEnvironment.groovy
          0.1 kB
        4. Utility.groovy
          0.2 kB

            Assignee:
            Andrew Bayer
            Reporter:
            Emilio Escobar
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: