jenkinsci / dashboard-view-plugin

Jenkins dashboard-view plugin
https://plugins.jenkins.io/dashboard-view/
MIT License
45 stars 105 forks source link

java.lang.ClassCastException: class hudson.model.FreeStyleBuild cannot be cast to class org.jenkinsci.plugins.workflow.job.WorkflowRun #332

Closed andreygaizler closed 1 month ago

andreygaizler commented 6 months ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.441 OS: Linux - 5.4.0-166-generic Java: 17.0.9 - Private Build (OpenJDK 64-Bit Server VM) --- Office-365-Connector:4.20.2 Parameterized-Remote-Trigger:3.2.0 active-directory:2.34 analysis-model-api:11.15.0 ansicolor:1.0.4 ant:497.v94e7d9fffa_b_9 antisamy-markup-formatter:162.v0e6ec0fcfcf6 apache-httpcomponents-client-4-api:4.5.14-208.v438351942757 artifactory:4.0.3 authentication-tokens:1.53.v1c90fd9191a_b_ authorize-project:1.7.1 badge:1.9.1 basic-branch-build-strategies:81.v05e333931c7d bitbucket:241.v6d24a_57f9359 bitbucket-pullrequest-builder:1.5.0 bitbucket-scm-filter-aged-refs:31.ve3b_ca_fc71d5b_ bitbucket-scm-filter-jira-validator:0.1.0 blackduck-detect:9.0.0 blueocean:1.27.9 blueocean-autofavorite:1.2.5 blueocean-bitbucket-pipeline:1.27.9 blueocean-commons:1.27.9 blueocean-config:1.27.9 blueocean-core-js:1.27.9 blueocean-dashboard:1.27.9 blueocean-display-url:2.4.2 blueocean-events:1.27.9 blueocean-git-pipeline:1.27.9 blueocean-github-pipeline:1.27.9 blueocean-i18n:1.27.9 blueocean-jira:1.27.9 blueocean-jwt:1.27.9 blueocean-personalization:1.27.9 blueocean-pipeline-api-impl:1.27.9 blueocean-pipeline-editor:1.27.9 blueocean-pipeline-scm-api:1.27.9 blueocean-rest:1.27.9 blueocean-rest-impl:1.27.9 blueocean-web:1.27.9 bootstrap5-api:5.3.2-3 bouncycastle-api:2.30.1.77-225.v26ea_c9455fd9 branch-api:2.1144.v1425d1c3d5a_7 build-monitor-plugin:1.14-826.vb_a_c11536174d build-name-setter:2.4.0 build-timeout:1.32 buildtriggerbadge:251.vdf6ef853f3f5 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:2.0.2 cloudbees-bitbucket-branch-source:866.vdea_7dcd3008e cloudbees-disk-usage-simple:203.v3f46a_7462b_1a_ cloudbees-folder:6.858.v898218f3609d cmakebuilder:4.1.1 cobertura:1.17 code-coverage-api:4.99.0 command-launcher:107.v773860566e2e commons-httpclient3-api:3.1-3 commons-lang3-api:3.13.0-62.v7d18e55f51e2 commons-text-api:1.11.0-95.v22a_d30ee5d36 conditional-buildstep:1.4.3 config-file-provider:959.vcff671a_4518b_ configuration-as-code:1775.v810dc950b_514 copyartifact:722.v0662a_9b_e22a_c coverage:1.8.0 credentials:1311.vcf0a_900b_37c2 credentials-binding:642.v737c34dea_6c2 custom-tools-plugin:0.8 dashboard-view:2.495.v07e81500c3f2 data-tables-api:1.13.8-2 display-url-api:2.200.vb_9327d658781 docker-commons:439.va_3cb_0a_6a_fb_29 docker-workflow:572.v950f58993843 doxygen:178.v6ea_ef5f7dfdb dtkit-api:3.0.2 durable-task:543.v262f6a_803410 echarts-api:5.4.3-2 email-ext:2.104 emailext-template:1.5 embeddable-build-status:467.v4a_954796e45d envinject:2.908.v66a_774b_31d93 envinject-api:1.199.v3ce31253ed13 extended-choice-parameter:376.v2e02857547b_a_ extended-read-permission:53.v6499940139e5 extensible-choice-parameter:1.8.1 external-monitor-job:215.v2e88e894db_f8 favorite:2.208.v91d65b_7792a_c file-operations:177.vd1773063d935 font-awesome-api:6.5.1-1 forensics-api:2.3.0 generic-webhook-trigger:1.88.2 git:5.2.1 git-changelog:3.36 git-client:4.6.0 git-forensics:2.0.0 git-parameter:0.9.19 git-server:99.va_0826a_b_cdfa_d github:1.37.3.1 github-api:1.318-461.v7a_c09c9fa_d63 github-branch-source:1772.va_69eda_d018d4 global-build-stats:288.vb_2c4a_0f138b_b_ gradle:2.9 gson-api:2.10.1-15.v0d99f670e0a_7 handy-uri-templates-2-api:2.1.8-30.v7e777411b_148 hidden-parameter:237.v4b_df26c7a_f0e htmlpublisher:1.32 http_request:1.18 instance-identity:185.v303dc7c645f9 ionicons-api:56.v1b_1c8c49374e jackson2-api:2.16.1-373.ve709c6871598 jakarta-activation-api:2.0.1-3 jakarta-mail-api:2.0.1-3 javadoc:243.vb_b_503b_b_45537 javax-activation-api:1.2.0-6 javax-mail-api:1.6.2-9 jaxb:2.3.9-1 jdk-tool:73.vddf737284550 jenkins-design-language:1.27.9 jenkins-jira-issue-updater:1.18 jersey2-api:2.41-133.va_03323b_a_1396 jira:3.12 jira-steps:2.0.165.v8846cf59f3db jjwt-api:0.11.5-77.v646c772fddb_0 jnr-posix-api:3.1.18-1 job-dsl:1.87 jobConfigHistory:1229.v3039470161a_d joda-time-api:2.12.6-21.vca_fd74418fb_7 jqs-monitoring:37.vf50a_82a_0b_f32 jquery:1.12.4-1 jquery3-api:3.7.1-1 jsch:0.2.16-86.v42e010d9484b_ json-api:20231013-17.v1c97069404b_e json-path-api:2.8.0-21.v8b_7dc8b_1037b_ junit:1256.v002534a_5f33e ldap:711.vb_d1a_491714dc lockable-resources:1232.v512d6c434eb_d logging:1.0.0 mailer:463.vedf8358e006b_ mapdb-api:1.0.9-28.vf251ce40855d mask-passwords:173.v6a_077a_291eb_5 matrix-auth:3.2.1 matrix-project:822.v01b_8c85d16d2 maven-plugin:3.23 mercurial:1260.vdfb_723cdcc81 metrics:4.2.18-442.v02e107157925 mina-sshd-api-common:2.11.0-86.v836f585d47fa_ mina-sshd-api-core:2.11.0-86.v836f585d47fa_ monitoring:1.95.0 multibranch-action-triggers:1.8.6 next-build-number:1.8 nodelabelparameter:1.12.0 okhttp-api:4.11.0-157.v6852a_a_fa_ec11 pam-auth:1.10 parameter-separator:129.v86b_98b_cb_5274 parameterized-scheduler:255.v73827fcdf618 parameterized-trigger:787.v665fcf2a_830b_ parasoft-findings:10.7.1 pipeline-build-step:540.vb_e8849e1a_b_d8 pipeline-graph-analysis:202.va_d268e64deb_3 pipeline-groovy-lib:700.v0e341fa_57d53 pipeline-input-step:477.v339683a_8d55e pipeline-milestone-step:111.v449306f708b_7 pipeline-model-api:2.2168.vf921b_4e72c73 pipeline-model-definition:2.2168.vf921b_4e72c73 pipeline-model-extensions:2.2168.vf921b_4e72c73 pipeline-rest-api:2.34 pipeline-stage-step:305.ve96d0205c1c6 pipeline-stage-tags-metadata:2.2168.vf921b_4e72c73 pipeline-stage-view:2.34 pipeline-utility-steps:2.16.0 plain-credentials:143.v1b_df8b_d3b_e48 plugin-usage-plugin:4.2 plugin-util-api:3.8.0 prism-api:1.29.0-10 prometheus:2.5.1 promoted-builds:945.v597f5c6a_d3fd publish-over:0.22 pubsub-light:1.18 rebuild:330.v645b_7df10e2a_ repo:1.16.0 resource-disposer:0.23 role-strategy:689.v731678c3e0eb_ run-condition:1.7 saferestart:0.7 scm-api:683.vb_16722fb_b_80b_ script-security:1313.v7a_6067dc7087 sidebar-link:2.4.1 simple-theme-plugin:176.v39740c03a_a_f5 snakeyaml-api:2.2-111.vc6598e30cc65 sonar:2.17.1 sse-gateway:1.26 ssh-agent:346.vda_a_c4f2c8e50 ssh-credentials:308.ve4497b_ccd8f4 ssh-slaves:2.948.vb_8050d697fec ssh-steps:2.0.68.va_d21a_12a_6476 sshd:3.322.v159e91f6a_550 structs:337.v1b_04ea_4df7c8 subversion:2.17.3 text-file-operations:1.3.2 thinBackup:1.18 throttle-concurrents:2.14 timestamper:1.26 token-macro:400.v35420b_922dcb_ trilead-api:2.133.vfb_8a_7b_9c5dd1 uno-choice:2.8.1 variant:60.v7290fc0eb_b_cd versioncolumn:233.v2d198f8212a_2 warnings-ng:10.7.0 workflow-aggregator:596.v8c21c963d92d workflow-api:1283.v99c10937efcb_ workflow-basic-steps:1042.ve7b_140c4a_e0c workflow-cps:3837.v305192405b_c0 workflow-durable-task-step:1313.vcb_970b_d2a_fb_3 workflow-job:1385.vb_58b_86ea_fff1 workflow-multibranch:773.vc4fe1378f1d5 workflow-scm-step:415.v434365564324 workflow-step-api:657.v03b_e8115821b_ workflow-support:865.v43e78cc44e0d ws-cleanup:0.45 xunit:3.1.3 ```

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

Ubuntu 18.04

Reproduction steps

Step 1: Add to the list of the dashboard jobs that were triggered by upstream project.

Expected Results

Shows jobs status on dashboard

Actual Results

Getting exception: Sorry to bother you, but Jenkins is having a problem :-( "\n \n <!DOCTYPE html><html><head resURL=\"/static/7f8491f1\" data-rooturl=\"\" data-resurl=\"/static/7f8491f1\" data-extensions-available=\"true\" data-unit-test=\"false\" data-imagesurl=\"/static/7f8491f1/images\" data-crumb-header=\"Jenkins-Crumb\" data-crumb-value=\"d77dcfe563356f1e35c2d280e72ce93069faeefa06462014fbb3aa04466e2aa7\">\n \n \n\n <title>Jenkins [Jenkins]</title><link rel=\"stylesheet\" href=\"/static/7f8491f1/jsbundles/styles.css\" type=\"text/css\"></link><link rel=\"stylesheet\" href=\"/static/7f8491f1/css/responsive-grid.css\" type=\"text/css\"></link><link rel=\"icon\" href=\"/static/7f8491f1/favicon.svg\" type=\"image/svg+xml\"></link><link sizes=\"any\" rel=\"alternate icon\" href=\"/static/7f8491f1/favicon.ico\"></link><link sizes=\"180x180\" rel=\"apple-touch-icon\" href=\"/static/7f8491f1/apple-touch-icon.png\"></link><link color=\"#191717\" rel=\"mask-icon\" href=\"/static/7f8491f1/mask-icon.svg\"></link><meta name=\"theme-color\" content=\"#ffffff\"></meta><script src=\"/static/7f8491f1/scripts/behavior.js\" type=\"text/javascript\"></script><script src='/adjuncts/7f8491f1/org/kohsuke/stapler/bind.js' type='text/javascript'></script><script src=\"/static/7f8491f1/scripts/yui/yahoo/yahoo-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/dom/dom-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/event/event-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/animation/animation-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/dragdrop/dragdrop-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/container/container-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/connection/connection-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/datasource/datasource-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/autocomplete/autocomplete-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/menu/menu-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/element/element-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/button/button-min.js\"></script><script src=\"/static/7f8491f1/scripts/yui/storage/storage-min.js\"></script><script src=\"/static/7f8491f1/scripts/hudson-behavior.js\" type=\"text/javascript\"></script><script src=\"/static/7f8491f1/scripts/sortable.js\" type=\"text/javascript\"></script><link rel=\"stylesheet\" href=\"/static/7f8491f1/scripts/yui/container/assets/container.css\" type=\"text/css\"></link><link rel=\"stylesheet\" href=\"/static/7f8491f1/scripts/yui/container/assets/skins/sam/container.css\" type=\"text/css\"></link><link rel=\"stylesheet\" href=\"/static/7f8491f1/scripts/yui/menu/assets/skins/sam/menu.css\" type=\"text/css\"></link><link rel=\"search\" href=\"/opensearch.xml\" type=\"application/opensearchdescription+xml\" title=\"Jenkins\"></link><meta name=\"ROBOTS\" content=\"INDEX,NOFOLLOW\"></meta><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"></meta><script src=\"/adjuncts/7f8491f1/org/kohsuke/stapler/jquery/jquery.full.js\" type=\"text/javascript\"></script><script>var Q=jQuery.noConflict()</script><script src='/adjuncts/7f8491f1/org/jenkinsci/plugins/scriptsecurity/scripts/ScriptApproval/FormValidationPageDecorator/validate.js' type='text/javascript'></script><script>\n if(window.Prototype && JSON) {\n var _json_stringify = JSON.stringify;\n JSON.stringify = function(value) {\n var _array_tojson = Array.prototype.toJSON;\n delete Array.prototype.toJSON;\n var r=_json_stringify(value);\n Array.prototype.toJSON = _array_tojson;\n return r;\n };\n }\n </script><script src=\"/static/7f8491f1/plugin/extended-choice-parameter/js/selectize.min.js\" type=\"text/javascript\"></script><script src=\"/static/7f8491f1/plugin/extended-choice-parameter/js/jsoneditor.min.js\" type=\"text/javascript\"></script><script src=\"/static/7f8491f1/plugin/extended-choice-parameter/js/jquery.jsonview.min.js\" type=\"text/javascript\"></script><link rel=\"stylesheet\" href=\"/static/7f8491f1/plugin/extended-choice-parameter/css/jquery.jsonview.css\"></link><link rel=\"stylesheet\" id=\"icon_stylesheet\" href=\"/static/7f8491f1/plugin/extended-choice-parameter/css/selectize.css\"></link><link rel=\"stylesheet\" id=\"icon_stylesheet\" href=\"/static/7f8491f1/plugin/extended-choice-parameter/css/selectize.bootstrap2.css\"></link><link rel=\"stylesheet\" id=\"theme_stylesheet\"></link><link rel=\"stylesheet\" id=\"icon_stylesheet\"></link><script src=\"https://vpm-build.iha.eup.gm.com//plugin/simple-theme-plugin/simple-theme.js\"></script>\n<script>\nwindow['org.jenkinsci.plugins.simpletheme'].replaceFavicon(\"/userContent/headshotGM1.png\");\n</script>\n<style type=\"text/css\">\n#jenkins-head-icon {\ncontent: url(\"/userContent/headshotGM1.png\");\n}\n.logo:after {\ncontent: \"IPCG\";\nfont-weight: bold;\nfont-size: 36px;\nfont-family: \"Roboto,sans-serif\", important;\nmargin-left: 180px;\nmargin-right: 12px;\ncolor: White;\nline-height: 40px;\n}\n</style><script src=\"/static/7f8491f1/jsbundles/vendors.js\" type=\"text/javascript\"></script><script src=\"/static/7f8491f1/jsbundles/sortable-drag-drop.js\" type=\"text/javascript\"></script><script defer=\"true\" src=\"/static/7f8491f1/jsbundles/app.js\" type=\"text/javascript\"></script></head><body data-model-type=\"hudson.model.Hudson\" id=\"jenkins\" class=\"yui-skin-sam one-column jenkins-2.441\" data-version=\"2.441\"><a href=\"#skip2content\" class=\"jenkins-skip-link\">Skip to content</a><header id=\"page-header\" class=\"page-header\"><div class=\"page-header__brand\"><div class=\"logo\"><a id=\"jenkins-home-link\" href=\"/\"><img src=\"/static/7f8491f1/images/svgs/logo.svg\" alt=\"[Jenkins]\" id=\"jenkins-head-icon\"></img><img src=\"/static/7f8491f1/images/title.svg\" alt=\"Jenkins\" width=\"139\" id=\"jenkins-name-icon\" height=\"34\"></img></a></div><a href=\"/\" class=\"page-header__brand-link\"><img src=\"/static/7f8491f1/images/svgs/logo.svg\" alt=\"[Jenkins]\" class=\"page-header__brand-image\"></img><span class=\"page-header__brand-name\">Jenkins</span></a></div><div class=\"searchbox hidden-xs\"><form role=\"search\" method=\"get\" name=\"search\" action=\"/search/\" style=\"position:relative;\" class=\"no-json\"><div id=\"search-box-sizer\"></div><div id=\"searchform\"><input role=\"searchbox\" name=\"q\" placeholder=\"Search\" id=\"search-box\" class=\"main-search__input\"></input><span class=\"main-search__icon-leading\"><svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><title></title><path d=\"M221.09 64a157.09 157.09 0 10157.09 157.09A157.1 157.1 0 00221.09 64z\" fill=\"none\" stroke=\"currentColor\" stroke-miterlimit=\"10\" stroke-width=\"32\"/><path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"32\" d=\"M338.29 338.29L448 448\"/></svg></span><a href=\"https://www.jenkins.io/redirect/search-box\" class=\"main-search__icon-trailing\"><svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M256 40a216 216 0 10216 216A216 216 0 00256 40z\" fill=\"none\" stroke=\"currentColor\" stroke-miterlimit=\"10\" stroke-width=\"38\"/><path d=\"M200 202.29s.84-17.5 19.57-32.57C230.68 160.77 244 158.18 256 158c10.93-.14 20.69 1.67 26.53 4.45 10 4.76 29.47 16.38 29.47 41.09 0 26-17 37.81-36.37 50.8S251 281.43 251 296\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-miterlimit=\"10\" stroke-width=\"38\"/><circle cx=\"250\" cy=\"360\" r=\"25\" fill=\"currentColor\"/></svg></a><div id=\"search-box-completion\" data-search-url=\"/search/\"></div><script src='/adjuncts/7f8491f1/jenkins/views/JenkinsHeader/search-box.js' type='text/javascript'></script></div></form></div><div class=\"login page-header__hyperlinks\"><div id=\"visible-am-insertion\" class=\"page-header__am-wrapper\"></div><div id=\"visible-sec-am-insertion\" class=\"page-header__am-wrapper\"></div><a href=\"/login?from=%2F%24stapler%2Fbound%2F4f20fae7-84d6-4792-8982-128521d9db75%2FfetchJobViews\">log in</a></div></header><script src=\"/static/7f8491f1/jsbundles/keyboard-shortcuts.js\" type=\"text/javascript\"></script><div id=\"breadcrumbBar\" class=\"jenkins-breadcrumbs\" aria-label=\"breadcrumb\"><ol class=\"jenkins-breadcrumbs__list\" id=\"breadcrumbs\"><li class=\"jenkins-breadcrumbs__list-item\"><a href=\"/\" class=\"model-link\">Dashboard</a></li><li class=\"children\" data-href=\"/\"></li></ol></div><div id=\"page-body\" class=\"app-page-body app-page-body--one-column clear\"><div id=\"main-panel\"><a id=\"skip2content\"></a><h1 style=\"text-align: center\"><img src=\"/static/7f8491f1/images/rage.svg\" width=\"154\" height=\"179\"></img><span style=\"font-size:50px\"> Oops!</span></h1><div id=\"error-description\"><h2 style=\"text-align: center\">A problem occurred while processing the request</h2><p style=\"text-align: center\">Logging ID=9ff7d86a-e5a6-4cc9-abde-e89e13d09614</p></div></div></div><footer class=\"page-footer jenkins-mobile-hide\"><div class=\"page-footer__flex-row\"><div class=\"page-footer__footer-id-placeholder\" id=\"footer\"></div><div class=\"page-footer__links\"><a class=\"jenkins-button jenkins-button--tertiary rest-api\" href=\"api/\">REST API</a><button type=\"button\" class=\"jenkins-button jenkins-button--tertiary jenkins_ver\" data-dropdown=\"true\">\n\n Jenkins 2.441\n </button><template><div class=\"jenkins-dropdown\"><a class=\"jenkins-dropdown__item\" href=\"https://www.jenkins.io/participate/\" rel=\"noopener noreferrer\" target=\"_blank\"><div class=\"jenkins-dropdown__item__icon\"><svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M352.92 80C288 80 256 144 256 144s-32-64-96.92-64c-52.76 0-94.54 44.14-95.08 96.81-1.1 109.33 86.73 187.08 183 252.42a16 16 0 0018 0c96.26-65.34 184.09-143.09 183-252.42-.54-52.67-42.32-96.81-95.08-96.81z\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"32\"/></svg>\n</div>\n Get involved\n </a><a rel=\"noopener noreferrer\" href=\"https://www.jenkins.io/\" class=\"jenkins-dropdown__item\" target=\"_blank\"><div class=\"jenkins-dropdown__item__icon\"><svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48M336 64h112v112M224 288L440 72\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"32\"/></svg>\n</div>\n Website\n </a></div></template></div></div></footer></body></html>"

Anything else?

Getting such error as well when using plugin Dashboard View. From my observations, plugin fails with this error when any of the jobs from the list was triggered by upstream project. I have nightly triggers for different jobs, and in the morning I get error from the dashboard.

Errors from Jenkins logs:

No valid crumb was included in request for /view/Dashboard%20View/job/my-job/widget/ExecutorsWidget/ajax by user. Returning 403.

java.lang.ClassCastException: class hudson.model.FreeStyleBuild cannot be cast to class org.jenkinsci.plugins.workflow.job.WorkflowRun (hudson.model.FreeStyleBuild is in unnamed module of loader org.eclipse.jetty.webapp.WebAppClassLoader @7b420819; org.jenkinsci.plugins.workflow.job.WorkflowRun is in unnamed module of loader jenkins.util.URLClassLoader2 @4a638e9b)

Jenkins 2.441

Are you interested in contributing a fix?

no

mawinter69 commented 5 months ago

Looks more to be a problem in another plugin. Dashboard plugin itself is not making assumptions about job types. The full stack trace would be helpful

TobiX commented 1 month ago

Unclear how dashboard view plugin cotributes to this issue, not reproducible. Feel free to reopen when you can provide more information.