Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not sending two successive notifications in slack (peer not authenticated) #858

Open
vishal-elimu opened this issue Nov 18, 2022 · 8 comments
Labels

Comments

@vishal-elimu
Copy link

vishal-elimu commented Nov 18, 2022

Jenkins and plugins versions report

Environment
Paste the output here

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

OS : Ubuntu 18:04
Jenkins-agent : Same host (Ubuntu 18:04)
Jenkins version: Jenkins 2.346.2

Reproduction steps

  1. Enabled "Notify Success" in post build action in jenkins job. (Jenkins version 2.346.2, Slack Notification Plugin version
    Version631.v40deea_40323b)
  2. Ran the same jenkins job twice. I get notification only for one build of job
  3. Get notification on alternate build/run of job. Example: gets slack notification for job's build number 2, 4, 6, 8 so jenkins/slack notification plugin skips every alternate build notification.

image

Expected Results

  1. Upon every successfully build / run of job I should get notification
  2. When job fails I should get "Job Failed" notification/message
  3. When job fails but next build of job runs successfully then I should get notification with "back to normal" message

Actual Results

  1. If job fails (consider build no : 4) and then next build (build no: 5) runs successfully then I should get notified with "back to normal " notification but it does not. I get notification for "failed build" (build no : 4) but not for next build (build no : 5)
  2. Sometimes when job fails I don't get notification (consider build no: 6) but I get notification (back to normal) when next build of job runs successfully (build no: 7)
  3. When job runs successfully twice (consider build no 8 and 9) I only get notification for build no : 8
  4. My observation is that jenkins/plugin not sending two successive notifications in slack and it skips one notification
    image
    image

Jenkins logs

WARNING j.p.slack.StandardSlackService#postToSlack: Error posting to Slack javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at java.base/sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:526) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:504) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:437) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) at jenkins.plugins.slack.StandardSlackService.postToSlack(StandardSlackService.java:214) at jenkins.plugins.slack.StandardSlackService.publish(StandardSlackService.java:340) at jenkins.plugins.slack.StandardSlackService.publish(StandardSlackService.java:379) at jenkins.plugins.slack.StandardSlackService.publish(StandardSlackService.java:351) at jenkins.plugins.slack.workflow.SlackSendStep$SlackSendStepExecution.run(SlackSendStep.java:359) at jenkins.plugins.slack.workflow.SlackSendStep$SlackSendStepExecution.run(SlackSendStep.java:258) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)

Anything else?

No response

@thomasvincent
Copy link

I ran into the same thing, and I believe it was fixed in the latest version of the plugin. My work around the problem was by using the slackNotify step

pipeline {
  agent any

  stages {
    stage('Build') {
      steps {
        echo 'Building...'
      }
    }

    stage('Notify Slack') {
      steps {
        slackNotify channel: '#general', message: 'Build successful!'
      }
    }
  }
}

@vishal-elimu
Copy link
Author

@thomasvincent I tried it and ran the pipeline but it failed with below error message
java.lang.NoSuchMethodError: No such DSL method 'slackNotify' found among steps

@timja
Copy link
Member

timja commented Jun 13, 2023

you mustn't have the slack plugin installed then or it's failed to start

@vishal-elimu
Copy link
Author

vishal-elimu commented Jun 13, 2023

@timja slack plugin is installed and using version 631.v40deea_40323b
I am able to use slackSend commands in pipeline steps but issue still persist, not able to get 2 successive slack notifications (I do receive every alternate slack notification).

@timja
Copy link
Member

timja commented Jun 13, 2023

Ah right my mistake.

@vishal-elimu vishal-elimu changed the title not sending two successive notifications in slack not sending two successive notifications in slack (peer not authenticated) Jun 13, 2023
@vishal-elimu
Copy link
Author

vishal-elimu commented Jun 13, 2023

@timja , @thomasvincent I just updated jenkins logs above,

I am seeing a lot of WARNING j.p.slack.StandardSlackService#postToSlack: Error posting to Slack javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated at messages in jenkins container.

Do you guys have an idea about these warning messages ?

  • Thanks

@timja
Copy link
Member

timja commented Jun 13, 2023

possibly outdated system libraries or a MITM proxy on your side?

Basically a network issue specific to you.

see also #837 (comment)

@vishal-elimu
Copy link
Author

Thanks Tim, I will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants