Hi
I am trying to send slack notifications from jenkins. I installed the most recent version of the slack
plugin. My (related) configuration as code is
credentials:
system:
domainCredentials:
- credentials:
- string:
description: "Adzuna Slack Token"
id: "slack-token"
scope: GLOBAL
secret: "{foo}"
jenkins:
crumbIssuer: "strict"
unclassified:
slackNotifier:
botUser: false
sendAsText: false
teamDomain: "team-foo"
tokenCredentialId: "slack-token"
I tested through “Dashboard → Manage Jenkins → System → Slack → Test connection”. It says “success” and it does send a message to slack
However, from my pipeline console output says
...
Slack Send Pipeline step running, values are - baseUrl: <empty>, teamDomain: team-foo, channel: null, color: danger, botUser: false, tokenCredentialId: slack-token, notifyCommitters: false, iconEmoji: <empty>, username: <empty>, timestamp: <empty>
ERROR: Slack notification failed. See Jenkins logs for details.
...
and jenkis logs say:
Jul 06 10:32:20 jenkins-controller jenkins[3259]: 2023-07-06 10:32:20.599+0000 [id=3008] WARNING j.p.slack.StandardSlackService#postToSlack: Slack post may have failed. Response: null
Jul 06 10:32:20 jenkins-controller jenkins[3259]: 2023-07-06 10:32:20.600+0000 [id=3008] WARNING j.p.slack.StandardSlackService#postToSlack: Response Code: 400
Any ideas would be helpful. Let me know if I can provide more info
PS without the Strict Crumb Issuer Plugin I was getting a warning and a 403. So I followed the instructions in the log file (Improved CSRF protection link), and installed it with the default configuration, Hope this wasn’t a red herring.
Jul 06 10:30:45 jenkins-controller jenkins[3259]: 2023-07-06 10:30:45.565+0000 [id=475] INFO o.j.p.s.StrictCrumbIssuer#validateCrumb: Invalid crumb found in the request
Jul 06 10:30:45 jenkins-controller jenkins[3259]: 2023-07-06 10:30:45.566+0000 [id=475] WARNING hudson.security.csrf.CrumbFilter#doFilter: Found invalid crumb 2c346e60bc7344ddbe137e316e3df8b8e7c0dadaf63dfe3aa6b769c330dcb067. If you are calling this URL with a script, please use the API Token instead. More information: https://www.jenkins.io/redirect/crumb-cannot-be-used-for-script
Jul 06 10:30:45 jenkins-controller jenkins[3259]: 2023-07-06 10:30:45.568+0000 [id=475] WARNING hudson.security.csrf.CrumbFilter#doFilter: No valid crumb was included in request for /ajaxExecutors by adzuna. Returning 403.