jenkinsci / stapler

Stapler web framework
BSD 2-Clause "Simplified" License
161 stars 103 forks source link

Stapler failing on constructor of class java.util.concurrent.CopyOnWriteArrayList #461

Closed harveycggit closed 1 year ago

harveycggit commented 1 year ago

Jenkins and plugins versions report

Environment ``` Jenkins: 2.361.4.1 OS: Linux - 4.14.313-235.533.amzn2.x86_64 Java: 11.0.19 - Amazon.com Inc. (OpenJDK 64-Bit Server VM) --- Parameterized-Remote-Trigger:3.1.6.3 ace-editor:1.1 ant:481.v7b_09e538fcca antisamy-markup-formatter:2.7 any-buildstep:0.1 apache-httpcomponents-client-4-api:4.5.13-138.v4e7d9a_7b_a_e61 artifactory:3.17.3 async-http-client:1.7.24.3 authentication-tokens:1.4 aws-credentials:191.vcb_f183ce58b_9 aws-java-sdk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-cloudformation:1.12.287-357.vf82d85a_6eefd aws-java-sdk-codebuild:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ec2:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecr:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ecs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-efs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-elasticbeanstalk:1.12.287-357.vf82d85a_6eefd aws-java-sdk-iam:1.12.287-357.vf82d85a_6eefd aws-java-sdk-logs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-minimal:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sns:1.12.287-357.vf82d85a_6eefd aws-java-sdk-sqs:1.12.287-357.vf82d85a_6eefd aws-java-sdk-ssm:1.12.287-357.vf82d85a_6eefd azure-commons:1.1.3 blueocean-commons:1.25.8 blueocean-rest:1.25.8 bootstrap4-api:4.6.0-5 bootstrap5-api:5.2.1-3 bouncycastle-api:2.26 branch-api:2.1046.v0ca_37783ecc5 build-name-setter:2.2.0 caffeine-api:2.9.3-65.v6a_47d0f4d1fe checks-api:1.7.5 cloudbees-administrative-monitors:1.0.6 cloudbees-analytics:1.43 cloudbees-assurance:2.276.0.23 cloudbees-aws-cli:1.5.20 cloudbees-blueocean-default-theme:0.8 cloudbees-disk-usage-simple:178.v1a_4d2f6359a_8 cloudbees-folder:6.758.vfd75d09eea_a_1 cloudbees-folders-plus:3.29 cloudbees-license:9.69 cloudbees-platform-common:1.19 cloudbees-platform-data:1.30 cloudbees-plugin-usage:2.17 cloudbees-support:3.31 cloudbees-template:4.58 cloudbees-uc-data-api:4.50 cloudbees-unified-ui:1.23 cloudbees-workflow-template:3.19 command-launcher:90.v669d7ccb_7c31 commons-httpclient3-api:3.1-3 commons-lang3-api:3.12.0-36.vd97de6465d5b_ commons-text-api:1.10.0-27.vb_fa_3896786a_7 conditional-buildstep:1.4.2 config-file-provider:3.11.1 copyartifact:1.47 credentials:1189.vf61b_a_5e2f62e credentials-binding:523.vd859a_4b_122e6 display-url-api:2.3.6 docker-commons:1.21 docker-workflow:521.v1a_a_dd2073b_2e durable-task:501.ve5d4fc08b0be echarts-api:5.4.0-1 envinject:2.881.v37c62073ff97 envinject-api:1.199.v3ce31253ed13 extended-choice-parameter:346.vd87693c5a_86c extended-read-permission:3.2 external-monitor-job:203.v683c09d993b_9 flexible-publish:0.16.1 font-awesome-api:6.2.0-3 git:4.13.0 git-client:3.13.0 git-server:99.va_0826a_b_cdfa_d github:1.35.0 github-api:1.303-400.v35c2d8258028 github-branch-source:1695.v88de84e9f6b_9 github-checks:1.0.19 gitlab-plugin:1.6.0 global-pre-script:20.02 gradle:1.40 groovy:453.vcdb_a_c5c99890 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 hidden-parameter:0.0.5 htmlpublisher:1.31 http_request:1.16 infradna-backup:3.38.56 inline-pipeline:1.0.2 instance-identity:116.vf8f487400980 ionicons-api:31.v4757b_6987003 ivy:2.4 jackson2-api:2.13.4.20221013-295.v8e29ea_354141 jakarta-activation-api:2.0.1-2 jakarta-mail-api:2.0.1-2 javadoc:226.v71211feb_e7e9 javax-activation-api:1.2.0-5 javax-mail-api:1.6.2-7 jaxb:2.3.6-2 jdk-tool:55.v1b_32b_6ca_f9ca jersey2-api:2.37-1 jira:3.8 jjwt-api:0.11.5-77.v646c772fddb_0 job-dsl:1.81 jobConfigHistory:1176.v1b_4290db_41a_5 jquery:1.12.4-1 jquery-detached:1.2.1 jquery3-api:3.6.1-2 jsch:0.1.55.61.va_e9ee26616e7 junit:1143.1145.v81b_b_9579a_019 junit-attachments:101.v82f494a_00e9e kube-agent-management:1.1.56 kubernetes:3697.v771155683e38 kubernetes-cd:2.3.1 kubernetes-cli:1.10.3 kubernetes-client-api:5.12.2-193.v26a_6078f65a_9 kubernetes-credentials:0.9.0 kubernetes-pipeline-devops-steps:1.6 ldap:2.12 list-git-branches-parameter:0.0.11 lockable-resources:2.18 logging:1.0.0 mailer:438.v02c7f0a_12fa_4 mapdb-api:1.0.9-28.vf251ce40855d mask-passwords:3.3 matrix-auth:3.1.5 matrix-project:785.v06b_7f47b_c631 maven-plugin:3.19 mercurial:1260.vdfb_723cdcc81 metrics:4.2.10-389.v93143621b_050 mina-sshd-api-common:2.9.1-44.v476733c11f82 mina-sshd-api-core:2.9.1-44.v476733c11f82 momentjs:1.1.1 multibranch-build-strategy-extension:1.0.10 nectar-license:8.41 nectar-rbac:5.77 nexus-artifact-uploader:2.14 nodejs:1.5.1 okhttp-api:4.9.3-108.v0feda04578cf openJDK-native-plugin:1.5 openshift-client:1.0.38 openshift-pipeline:1.0.57 openshift-sync:1.0.55 operations-center-agent:2.361.0.1 operations-center-client:2.361.0.1 operations-center-context:2.361.0.3 pam-auth:1.10 parameterized-trigger:2.45 pipeline-build-step:2.18 pipeline-cps-http:0.3.1 pipeline-graph-analysis:195.v5812d95a_a_2f9 pipeline-groovy-lib:613.v9c41a_160233f pipeline-input-step:456.vd8a_957db_5b_e9 pipeline-maven:1235.v2db_ddd9f797b pipeline-milestone-step:101.vd572fef9d926 pipeline-model-api:2.2118.v31fd5b_9944b_5 pipeline-model-definition:2.2118.v31fd5b_9944b_5 pipeline-model-extensions:2.2118.v31fd5b_9944b_5 pipeline-multibranch-defaults:2.1 pipeline-rest-api:2.24.2 pipeline-stage-step:296.v5f6908f017a_5 pipeline-stage-tags-metadata:2.2118.v31fd5b_9944b_5 pipeline-stage-view:2.24.2 pipeline-utility-steps:2.14.0 plain-credentials:139.ved2b_9cf7587b plugin-util-api:2.17.0 popper-api:1.16.1-3 popper2-api:2.11.6-2 powershell:1.7 prometheus:2.0.11 rest-list-parameter:1.6.3 run-condition:1.5 saml:4.372.v89f13e4c9e97 scm-api:621.vda_a_b_055e58f7 script-security:1190.v65867a_a_47126 select2-api:4.0.13-8 slack:631.v40deea_40323b snakeyaml-api:1.32-86.ve3f030a_75631 sonar:2.14 ssh-agent:295.v9ca_a_1c7cc3a_a_ ssh-credentials:305.v8f4381501156 sshd:3.249.v2dc2ea_416e33 structs:324.va_f5d6774f3a_d subversion:2.16.0 support-core:1206.1208.v9b_7a_1d48db_0f template-project:1.5.2 template-workflows:41.v32d86a_313b_4a templating-engine:2.5.2 timestamper:1.20 token-macro:308.v4f2b_ed62b_b_16 trilead-api:2.72.v2a_3236754f73 uno-choice:2.6.4 user-activity-monitoring:1.9 variant:59.vf075fe829ccb windows-slaves:1.8.1 workflow-api:1198.v4596ea_5329b_6 workflow-basic-steps:994.vd57e3ca_46d24 workflow-cps:2803.v1a_f77ffcc773 workflow-cps-global-lib:588.v576c103a_ff86 workflow-durable-task-step:1199.v02b_9244f8064 workflow-job:1239.v71b_b_a_124a_725 workflow-multibranch:716.vc692a_e52371b_ workflow-scm-step:400.v6b_89a_1317c9a_ workflow-step-api:639.v6eca_cd8c04a_a_ workflow-support:839.v35e2736cfd5c ```

What Operating System are you using (both controller, and any agents involved in the problem)?

Linux

Reproduction steps

Include the following yaml in a scripted template pipeline:

[$class: 'hudson.plugins.throttleconcurrents.ThrottleJobProperty',
  categories: [$class: 'java.util.concurrent.CopyOnWriteArrayList'], 
  throttleEnabled: true, 
  throttleOption: 'project',
  limitOneJobWithMatchingParams: true,
  paramsToUseForLimit: 'TargetEnvironment' ,
  plugin: 'throttle-concurrents@2.10',
  maxConcurrentPerNode: 0,
  maxConcurrentTotal: 0
],

Import the template

Get the following error message:

categories: [$class: 'java.util.concurrent.CopyOnWriteArrayList'], org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class java.util.concurrent.CopyOnWriteArrayList

Expected Results

Not get an error, be able to use the pipeline from template

Actual Results

Get the following error message:

categories: [$class: 'java.util.concurrent.CopyOnWriteArrayList'], org.kohsuke.stapler.NoStaplerConstructorException: There's no @DataBoundConstructor on any constructor of class java.util.concurrent.CopyOnWriteArrayList

Anything else?

No response

MarkEWaite commented 1 year ago

The throttle concurrent builds plugin does not appear to be installed on your controller, at least according to the list of plugins that you've provided. You'll need to install the plugin in order to use it in Pipelines.

That plugin provides Pipeline examples in its documentation. None of those examples require the CopyOnWriteArrayList.