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

Reload Configuration from Disk wipes out system Groovy build steps

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • groovy-plugin
    • None

      I ran into issues with missing build steps when trying to migrate jobs from one server to another when those jobs contained "Execute system Groovy Script" build steps.

      After copying the job directory from the old server into the %JENKINS_HOME%/jobs directory on the new server and running "Reload Configuration from Disk", the job gets created but when reviewing it, the build step is missing.

      Also, a message is displayed under "Manage Jenkins" that says:

      You have data stored in an older format and/or unreadable data.

       

      Clicking Manage next to that message shows an error message related to the new job. That error is

      CannotResolveClassException: hudson.plugins.groovy.SystemGroovy

       

      The target server is a docker instance using the jenkins/jenkins:2.302-alpine image and, other than installing some extensions (such as the Groovy plugin), nothing else has been done to the instance. 

      Recreation Steps

      I took the old server out of the mix and can recreate this problem with the following steps.

      1. Make sure the Groovy plugin is installed so you have the "Execute Groovy Script" and "Execute system Groovy script" build step options.
      2. Create a new Freestyle project
      3. Add a "Execute system Groovy script" build step with any simple Groovy script. such as

        println "test"

      4. Save the job and execute it
      5. Everything will work fine and the console output will show the word "test" printed
      6. Navigate to Manage Jenkins and click (and confirm) the "Reload Configuration from Disk" option.
      7. Navigate back to the job configuration and notice the build step is now gone
      8. Navigate back to Manage Jenkins and note the message at the top of the screen: "You have data stored in an older format and/or unreadable data."
      9. Click Manage next to that message to see the "CannotResolveClassException: hudson.plugins.groovy.SystemGroovy" error message and a complaint about "Old unreadable data"

      I've marked the ticket as Critical since using the "Reload Configuration from Disk" option can wipe out build steps and makes migrating some jobs impossible.

            vjuranek vjuranek
            bhartsfield bhartsfield
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: