jenkinsci / slack-plugin

A Jenkins plugin for posting notifications to a Slack channel
https://plugins.jenkins.io/slack/
MIT License
670 stars 413 forks source link

slackUploadFile fails from May 14th onwards #972

Closed gkarabotsos closed 5 months ago

gkarabotsos commented 6 months ago

Jenkins and plugins versions report

Environment ```text Paste the output here ```

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

Jenkins: 2.452.1 OS: Linux - 6.5.0-1020-aws Java: 17.0.10 - Private Build (OpenJDK 64-Bit Server VM)

ant:497.v94e7d9fffa_b_9 antisamy-markup-formatter:162.v0e6ec0fcfcf6 apache-httpcomponents-client-4-api:4.5.14-208.v438351942757 asm-api:9.7-33.v4d23ef79fcc8 bootstrap5-api:5.3.3-1 bouncycastle-api:2.30.1.77-225.v26ea_c9455fd9 branch-api:2.1169.va_f810c56e895 build-timeout:1.32 caffeine-api:3.1.8-133.v17b_1ff2e0599 checks-api:2.2.0 cloudbees-folder:6.901.vb_4c7a_da_75da3 commons-lang3-api:3.13.0-62.v7d18e55f51e2 commons-text-api:1.11.0-109.vfe16c66636eb config-file-provider:973.vb_a_80ecb_9a_4d0 configuration-as-code:1775.v810dc950b_514 credentials:1337.v60b_d7b_c7b_c9f credentials-binding:677.vdc9d38cb_254d dashboard-view:2.508.va_74654f026d1 display-url-api:2.204.vf6fddd8a_8b_e9 durable-task:555.v6802fe0f0b_82 echarts-api:5.5.0-1 email-ext:1806.v856a_01a_fa39a font-awesome-api:6.5.2-1 git:5.2.2 git-client:4.7.0 github:1.38.0 github-api:1.318-461.v7a_c09c9fa_d63 github-branch-source:1789.v5b_0c0cea_18c3 gradle:2.11 gson-api:2.10.1-15.v0d99f670e0a_7 instance-identity:185.v303dc7c645f9 ionicons-api:74.v93d5eb_813d5f jackson2-api:2.17.0-379.v02de8ec9f64c jakarta-activation-api:2.1.3-1 jakarta-mail-api:2.1.3-1 javax-activation-api:1.2.0-6 javax-mail-api:1.6.2-9 jaxb:2.3.9-1 jjwt-api:0.11.5-112.ve82dfb_224b_a_d joda-time-api:2.12.7-29.v5a_b_e3a82269a jquery3-api:3.7.1-2 json-api:20240303-41.v94e11e6de726 json-path-api:2.9.0-58.v62e3e85b_a_655 junit:1265.v65b_14fa_f12f0 ldap:725.v3cb_b_711b_1a_ef mailer:472.vf7c289a_4b_420 matrix-auth:3.2.2 matrix-project:822.824.v14451b_c0fd42 mina-sshd-api-common:2.12.1-101.v85b_e08b_780dd mina-sshd-api-core:2.12.1-101.v85b_e08b_780dd nodejs:1.6.1 okhttp-api:4.11.0-172.vda_da_1feeb_c6e pam-auth:1.10 pipeline-build-step:540.vb_e8849e1a_b_d8 pipeline-github-lib:42.v0739460cda_c4 pipeline-graph-analysis:216.vfd8bece330ca pipeline-groovy-lib:704.vc58b_8890a384 pipeline-input-step:495.ve9c153f6067b pipeline-milestone-step:119.vdfdc43fc3b9a pipeline-model-api:2.2198.v41dd8ef6dd56 pipeline-model-definition:2.2198.v41dd8ef6dd56 pipeline-model-extensions:2.2198.v41dd8ef6dd56 pipeline-rest-api:2.34 pipeline-stage-step:312.v8cd10304c27a_ pipeline-stage-tags-metadata:2.2198.v41dd8ef6dd56 pipeline-stage-view:2.34 plain-credentials:179.vc5cb_98f6db_38 plugin-util-api:4.1.0 prism-api:1.29.0-15 resource-disposer:0.23 scm-api:690.vfc8b_54395023 script-security:1336.vf33a_a_9863911 slack:715.v1cfed1b_9c63c snakeyaml-api:2.2-111.vc6598e30cc65 ssh-credentials:337.v395d2403ccd4 ssh-slaves:2.948.vb_8050d697fec sshd:3.322.v159e91f6a_550 structs:337.v1b_04ea_4df7c8 timestamper:1.26 token-macro:400.v35420b922dcb trilead-api:2.142.v748523a_76693 variant:60.v7290fc0eb_b_cd workflow-aggregator:596.v8c21c963d92d workflow-api:1291.v51fd2a_625da_7 workflow-basic-steps:1058.vcb_fc1e3a_21a_9 workflow-cps:3894.3896.vca_2c931e7935 workflow-durable-task-step:1336.v768003e07199 workflow-job:1400.v7fd111b_ec82f workflow-multibranch:773.vc4fe1378f1d5 workflow-scm-step:427.v4ca_6512e7df1 workflow-step-api:657.v03be8115821b workflow-support:907.v6713a_ed8a_573 ws-cleanup:0.45

Reproduction steps

  1. Run a pipeline with slackUploadFile.

Expected Results

[Pipeline] { (Declarative: Post Actions)
[Pipeline] slackUploadFile
Using dirname=/var/lib/jenkins/workspace/training/reset_expired_user and includeMask=reset_job189_*.log
Adding file /var/lib/jenkins/workspace/training/reset_expired_user/reset_job189_20240513.log

Actual Results

[Pipeline] { (Declarative: Post Actions)
[Pipeline] slackUploadFile
Using dirname=/var/lib/jenkins/workspace/training/reset_expired_user and includeMask=reset_job190_*.log
Adding file /var/lib/jenkins/workspace/training/reset_expired_user/reset_job190_20240514.log
Slack upload may have failed. Response: {"ok":false,"error":"channel_not_found"}
Failed to complete uploading file to Slack
ERROR: Failed uploading file to slack
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

Anything else?

Since May 14th, my pipeline jobs fail on the slackUploadFile step. I can still send slackSend messages successfully.

Are you interested in contributing a fix?

No response

timja commented 6 months ago

Check this: https://github.com/jenkinsci/slack-plugin/issues/970#issuecomment-2110216165

erwynesantos commented 5 months ago

I have been getting this as well after creating a new app. This is the error I got from the jenkins pipeline console Adding file /var/lib/jenkins/workspace/.../some-file.log Slack upload may have failed. Response: {"ok":false,"error":"method_deprecated"}

I also read https://api.slack.com/methods/files.upload documentation. On the page it states files.upload is deprecated and will stop functioning on March 11, 2025.

timja commented 5 months ago

You need to update your slack plugin version to avoid that.

erwynesantos commented 5 months ago

You need to update your slack plugin version to avoid that.

Thank you for this! It worked right away! Cheers!