[JIRA] (JENKINS-54537) Scripted Pipeline does not work due to tags

13 views
Skip to first unread message

cedric.sarre@orange.com (JIRA)

unread,
Nov 8, 2018, 4:31:02 AM11/8/18
to jenkinsc...@googlegroups.com
Cédric SARRE created an issue
 
Jenkins / Bug JENKINS-54537
Scripted Pipeline does not work due to tags
Issue Type: Bug Bug
Assignee: Vincent Behar
Components: rundeck-plugin
Created: 2018-11-08 09:30
Environment: Jenkins V2.138
Rundeck V2.9.3-1
Rundeck-plugin V3.6.4
Labels: pipeline regression
Priority: Major Major
Reporter: Cédric SARRE

Hello,

There is bug in the constructor of RundeckNotifier. 

When we declare a scripted pipeline like below, we get this exception "Caused by: java.lang.ClassCastException: org.jenkinsci.plugins.rundeck.RundeckNotifier.tags expects class java.lang.String but received class java.util.ArrayList".

stage('Deploy Release') { 
  steps { 
    script { 
      step([$class: "RundeckNotifier", 
            includeRundeckLogs: true, 
            jobId: "1", 
            rundeckInstance: "rundeck", 
            shouldFailTheBuild: true, 
            shouldWaitForRundeckJob: true, 
            tailLog: true]) 
      } 
    } 
  }
}

 

In RundeckNotifier class, the constructor annotated by "@DataBoundConstructor" contains a parameter called "tags". Jenkins Structs plugin get the name of fields that can be declared in the pipeline thanks to this constructor and after the plugin get the type of fields declared as attribute of class.

Two attributes are declared in the RundeckNotifier class: String tag and String [] tags.

The plugin get "tags" as parameter of contructor (declare as String in constructor) and get the type "String[]" from class attribute. So the mapping is in failure because the field "tags" is declared as String[] in class but it's declared as String in the constructor.

On my own environment, I have fixed this issue by renaming the field from "tags" to "tag" in the annotated constructor and it works well.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

donald.leckie@tomtom.com (JIRA)

unread,
Jun 21, 2019, 6:09:02 AM6/21/19
to jenkinsc...@googlegroups.com
Donald Leckie updated an issue
Change By: Donald Leckie
Attachment: [JENKINS-54537]_Scripted_Pipeline_does_not_work_due_to_tags.patch

donald.leckie@tomtom.com (JIRA)

unread,
Jun 21, 2019, 6:12:02 AM6/21/19
to jenkinsc...@googlegroups.com

ronabop@gmail.com (JIRA)

unread,
Jul 31, 2019, 2:18:02 PM7/31/19
to jenkinsc...@googlegroups.com

ronabop@gmail.com (JIRA)

unread,
Jul 31, 2019, 2:23:02 PM7/31/19
to jenkinsc...@googlegroups.com

igranel@aragon.es (JIRA)

unread,
Apr 13, 2020, 12:49:03 PM4/13/20
to jenkinsc...@googlegroups.com
Isabel G. commented on Bug JENKINS-54537
 
Re: Scripted Pipeline does not work due to tags

Hello,

we have the same warnings. Do anyone know if will someone release a new plugin version soon?

Infra:

  • Jenkins 2.204.6
  • Rundeck plugin 3.6.7
  • Rundeck instance: 2.11.3-1
  • Type of Job: multibranch pipeline

We see a lot of warnings in the logs like: 

Apr 07, 2020 1:51:50 PM WARNING org.jenkinsci.plugins.structs.describable.DescribableModel uninstantiate2
Cannot create control version of class org.jenkinsci.plugins.rundeck.RundeckNotifier using

{includeRundeckLogs=true, jobId=xxx, options= pipelineURL=https://... idTicket=999 estadoDespliegue="" rundeckURL="" , rundeckInstance=XXX, shouldFailTheBuild=true, shouldWaitForRundeckJob=true, tags=[], tailLog=false}

java.lang.ClassCastException: org.jenkinsci.plugins.rundeck.RundeckNotifier.tags expects class java.lang.String but received class java.util.ArrayList

Apr 07, 2020 1:51:50 PM WARNING org.jenkinsci.plugins.structs.describable.DescribableModel uninstantiate2
Cannot create control version of class org.jenkinsci.plugins.workflow.steps.CoreStep using

{delegate=$RundeckNotifier(includeRundeckLogs=true,jobId=xxx, options= pipelineURL=https://... idTicketOTRS=999 estadoDespliegue="" rundeckURL="" ,rundeckInstance=XXX,shouldFailTheBuild=true,shouldWaitForRundeckJob=true,tags=[],tailLog=false)}

java.lang.ClassCastException: org.jenkinsci.plugins.rundeck.RundeckNotifier.tags expects class java.lang.String but received class java.util.ArrayList

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages