jenkinsci / discord-notifier-plugin

A post-build plugin that sends the build status to a Discord channel.
https://plugins.jenkins.io/discord-notifier/
MIT License
50 stars 25 forks source link

Only the first message is send when used behind proxy #62

Closed Andy2003 closed 2 years ago

Andy2003 commented 2 years ago

Jenkins and plugins versions report

Environment ```text Jenkins: 2.335 OS: Linux - 4.15.0-161-generic --- ace-editor:1.1 ant:1.13 antisamy-markup-formatter:2.7 apache-httpcomponents-client-4-api:4.5.13-1.0 authentication-tokens:1.4 basic-branch-build-strategies:1.3.2 bootstrap4-api:4.6.0-3 bootstrap5-api:5.1.3-6 bouncycastle-api:2.25 branch-api:2.7.0 build-timeout:1.20 caffeine-api:2.9.2-29.v717aac953ff3 checks-api:1.7.2 cloudbees-bitbucket-branch-source:757.vddedc5f2589a_ cloudbees-folder:6.708.ve61636eb_65a_5 command-launcher:1.6 config-file-provider:3.9.0 credentials:1074.v60e6c29b_b_44b_ credentials-binding:1.27.1 discord-notifier:206.vee9f4569ee63 display-url-api:2.3.5 durable-task:493.v195aefbb0ff2 echarts-api:5.3.0-2 email-ext:2.87 font-awesome-api:6.0.0-1 git:4.10.3 git-client:3.11.0 git-server:1.10 github:1.34.3 github-api:1.301-378.v9807bd746da5 github-branch-source:1583.v18d333ef7379 gradle:1.38 h2-api:1.4.199 handlebars:3.0.8 handy-uri-templates-2-api:2.1.8-1.0 jackson2-api:2.13.2-260.v43d711474c77 javax-activation-api:1.2.0-2 javax-mail-api:1.6.2-5 jaxb:2.3.0.1 jdk-tool:1.5 jjwt-api:0.11.2-9.c8b45b8bb173 jnr-posix-api:3.1.7-3 jquery3-api:3.6.0-2 jsch:0.1.55.2 junit:1.56 ldap:2.8 lockable-resources:2.14 mailer:408.vd726a_1130320 matrix-auth:3.1 matrix-project:758.v7a_ea_491852f3 momentjs:1.1.1 next-build-number:1.8 nodejs:1.5.1 oic-auth:1.8 okhttp-api:4.9.3-105.vb96869f8ac3a pam-auth:1.7 pipeline-build-step:2.16 pipeline-github-lib:36.v4c01db_ca_ed16 pipeline-graph-analysis:188.v3a01e7973f2c pipeline-input-step:446.vf27b_0b_83500e pipeline-maven:3.10.0 pipeline-milestone-step:100.v60a_03cd446e1 pipeline-model-api:2.2064.v5eef7d0982b_e pipeline-model-definition:2.2064.v5eef7d0982b_e pipeline-model-extensions:2.2064.v5eef7d0982b_e pipeline-npm:0.9.2 pipeline-rest-api:2.23 pipeline-stage-step:291.vf0a8a7aeeb50 pipeline-stage-tags-metadata:2.2064.v5eef7d0982b_e pipeline-stage-view:2.23 pipeline-utility-steps:2.12.0 plain-credentials:1.8 plugin-util-api:2.14.0 popper-api:1.16.1-2 popper2-api:2.11.2-1 resource-disposer:0.17 scm-api:595.vd5a_df5eb_0e39 script-security:1140.vf967fb_efa_55a_ snakeyaml-api:1.29.1 ssh-credentials:1.19 ssh-slaves:1.806.v2253cedd3295 sshd:3.1.0 structs:308.v852b473a2b8c timestamper:1.17 token-macro:280.v97a_82642793c trilead-api:1.0.13 workflow-aggregator:2.7 workflow-api:1143.v2d42f1e9dea_5 workflow-basic-steps:941.vdfe1b_a_132c64 workflow-cps:2660.vb_c0412dc4e6d workflow-cps-global-lib:564.ve62a_4eb_b_e039 workflow-durable-task-step:1121.va_65b_d2701486 workflow-job:1174.vdcb_d054cf74a_ workflow-multibranch:711.vdfef37cda_816 workflow-scm-step:2.13 workflow-step-api:622.vb_8e7c15b_c95a_ workflow-support:815.vd60466279fc8 ws-cleanup:0.40 ```

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

host: ubuntu 18.04, docker: 20.10.12, image: jenkins-slim:latest

Reproduction steps

  1. Use Jenkins behind a Proxy
  2. Run Pipeline:
node {
    discordSend description: '1232', footer: '222', title: "foo bar1", webhookURL: '....'
}

Expected Results

Each time the pipeline is triggered a new notification is sent to the discord channel

Actual Results

Only the 1st time the pipeline is triggered a new notification is sent to the discord channel. Each succeeding invocation of the pipeline results in the following error being logged on the console:

This should be done rarely.
        at kong.unirest.Config.validateClientsNotRunning(Config.java:902)
        at kong.unirest.Config.proxy(Config.java:205)
        at nz.co.jammehcow.jenkinsdiscord.DiscordWebhook.send(DiscordWebhook.java:208)
        at nz.co.jammehcow.jenkinsdiscord.DiscordPipelineStep$DiscordPipelineStepExecution.run(DiscordPipelineStep.java:240)
        at nz.co.jammehcow.jenkinsdiscord.DiscordPipelineStep$DiscordPipelineStepExecution.run(DiscordPipelineStep.java:185)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
        at hudson.security.ACL.impersonate2(ACL.java:451)
        at hudson.security.ACL.impersonate(ACL.java:463)
        at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)

Anything else?

No response