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

When Jenkins restarts, the groovy scripts are lost

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • active-choices-plugin
    • None
    • Jenkins 2.19.2 fresh install as a service on Windows 10

      Hello,

      Here are the steps that make the active parameters groovy script disappear :

      • Configure a new Jenkins 2 pipeline project
      • Declare active parameters with groovy scripts
      • Save
      • (build)
      • Restart Jenkins with the url : http://myjenkins:8080/restart
      • The active parameters are still here, but the textareas containing the groovy scripts are blank

      Thanks for your support
      If it can help, I have this in jenkins.err.log when I save the job configuration :

      nov. 06, 2016 9:19:34 AM org.biouno.unochoice.AbstractScriptableParameter getChoices
      AVERTISSEMENT: Script parameter with name 'Etape' is not an instance of java.util.Map. The parameter value is null
      nov. 06, 2016 9:19:34 AM org.biouno.unochoice.AbstractScriptableParameter getChoices
      AVERTISSEMENT: Script parameter with name 'SVN' is not an instance of java.util.Map. The parameter value is null
      nov. 06, 2016 9:19:43 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
      

      The active parameter declaration is the following :

      Simple select

      if (Type.equals("Build complet")) {
          return [];
      } else {
          return ["Etape 1", "Etape 2"]
      }
      

          [JENKINS-39534] When Jenkins restarts, the groovy scripts are lost

          Marking as duplicate of JENKINS-29407.

          We need to implement the workflow/pipeline compatibility layer.

          Bruno P. Kinoshita added a comment - Marking as duplicate of JENKINS-29407 . We need to implement the workflow/pipeline compatibility layer.

          Kiruahxh added a comment -

          Same problem with Jenkins 2.28 and a Freestyle job. Are you sure that the pipeline plugin caused the error ?

          Kiruahxh added a comment - Same problem with Jenkins 2.28 and a Freestyle job. Are you sure that the pipeline plugin caused the error ?

          Hi kiruahxh

          >Same problem with Jenkins 2.28 and a Freestyle job. Are you sure that the pipeline plugin caused the error ?

          Not really, was just triaging issues and noticed that you were using a pipeline project. I haven't seen this problem happening with Freestyle jobs in my local installation.

          Feel free to re-open the issue. I'll have another development cycle for Active Choices in the next days, and will try to reproduce the issue. If you could update the steps to reproduce the issue - preferably in a blank installation of Jenkins - that would be very helpful

          Bruno P. Kinoshita added a comment - Hi kiruahxh >Same problem with Jenkins 2.28 and a Freestyle job. Are you sure that the pipeline plugin caused the error ? Not really, was just triaging issues and noticed that you were using a pipeline project. I haven't seen this problem happening with Freestyle jobs in my local installation. Feel free to re-open the issue. I'll have another development cycle for Active Choices in the next days, and will try to reproduce the issue. If you could update the steps to reproduce the issue - preferably in a blank installation of Jenkins - that would be very helpful

          Kiruahxh added a comment -

          Ok, I reopen the issue.
          I reproduce the bug on Jenkisn at home.

          The steps to reproduce have not changed :

          Here are the steps that make the active parameters groovy script disappear :

          • Install a fresh jenkins 2 on windows with the .mis
          • Install active choices plugin without restart
          • Configure a new Jenkins 2 freestyle project with just a svn checkout
          • Declare a choice parameter
          • Declare an active choices reactive parameter that reacts to the first parameter
          • Fill its groovy scripts
          • Save
          • (build)
          • Restart Jenkins with the url : http://myjenkins:8080/restart
          • The active parameters are still here, but the textareas containing the groovy scripts are blank

          My active parameter declaration is the following :
          Simple select
          if (Type.equals("Build complet")) {
          return [];
          } else {
          return ["Etape 1", "Etape 2"]
          }

          Kiruahxh added a comment - Ok, I reopen the issue. I reproduce the bug on Jenkisn at home. The steps to reproduce have not changed : Here are the steps that make the active parameters groovy script disappear : Install a fresh jenkins 2 on windows with the .mis Install active choices plugin without restart Configure a new Jenkins 2 freestyle project with just a svn checkout Declare a choice parameter Declare an active choices reactive parameter that reacts to the first parameter Fill its groovy scripts Save (build) Restart Jenkins with the url : http://myjenkins:8080/restart The active parameters are still here, but the textareas containing the groovy scripts are blank My active parameter declaration is the following : Simple select if (Type.equals("Build complet")) { return []; } else { return ["Etape 1", "Etape 2"] }

          Excellent kiruahxh! That will definitely help me while trying to reproduce the issue in the next days. Just working on a couple of other OSS right now, but will start the new development cycle on the plug-in soon.

          Thank you heaps
          Bruno

          Bruno P. Kinoshita added a comment - Excellent kiruahxh ! That will definitely help me while trying to reproduce the issue in the next days. Just working on a couple of other OSS right now, but will start the new development cycle on the plug-in soon. Thank you heaps Bruno

          Code changed in jenkins
          User: Bruno P. Kinoshita
          Path:
          src/findbugs/excludesFilter.xml
          src/main/java/org/biouno/unochoice/model/GroovyScript.java
          http://jenkins-ci.org/commit/active-choices-plugin/cac73ce953ce6419e14ad2ad7a12b0982fb8652b
          Log:
          [FIXED JENKINS-39620] and JENKINS-39534 Revert change that marked fields as transient, and add FindBugs exclusion filters

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/findbugs/excludesFilter.xml src/main/java/org/biouno/unochoice/model/GroovyScript.java http://jenkins-ci.org/commit/active-choices-plugin/cac73ce953ce6419e14ad2ad7a12b0982fb8652b Log: [FIXED JENKINS-39620] and JENKINS-39534 Revert change that marked fields as transient, and add FindBugs exclusion filters

          Code changed in jenkins
          User: Bruno P. Kinoshita
          Path:
          src/findbugs/excludesFilter.xml
          src/main/java/org/biouno/unochoice/model/GroovyScript.java
          http://jenkins-ci.org/commit/active-choices-plugin/44c21fc6bab67a538d785712d2a3aa302d20ea1a
          Log:
          [FIXED JENKINS-39620] and JENKINS-39534 Revert change that marked fields as transient, and add FindBugs exclusion filters

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Bruno P. Kinoshita Path: src/findbugs/excludesFilter.xml src/main/java/org/biouno/unochoice/model/GroovyScript.java http://jenkins-ci.org/commit/active-choices-plugin/44c21fc6bab67a538d785712d2a3aa302d20ea1a Log: [FIXED JENKINS-39620] and JENKINS-39534 Revert change that marked fields as transient, and add FindBugs exclusion filters

          Hi kiruahxh, could you take a look at the jar attached to JENKINS-39620, if you have the time, please?

          It contains the fix that should be release in the next days after Ioannis and I finish testing it.

          Cheers, Bruno

          Bruno P. Kinoshita added a comment - Hi kiruahxh , could you take a look at the jar attached to JENKINS-39620 , if you have the time, please? It contains the fix that should be release in the next days after Ioannis and I finish testing it. Cheers, Bruno

          Hopefully fixed in 1.5.1. Version 1.5.0 was removed from the update center.

          You can read more about the issue in this blog post.

          Bruno P. Kinoshita added a comment - Hopefully fixed in 1.5.1. Version 1.5.0 was removed from the update center. You can read more about the issue in this blog post .

          Kiruahxh added a comment -

          It seems to work well now. Thank you !

          Kiruahxh added a comment - It seems to work well now. Thank you !

            kinow Bruno P. Kinoshita
            kiruahxh Kiruahxh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: