slack-plugin: Upgrading to Slack 2.0 outbound webhooks breaks Jenkins [replicated]
This issue is going to be the center point for tracking the patching progress. This issue supersedes the following issues:
This issue was caused by the following merged change: #160
Workaround (for Jenkins admins)
There’s two options for a workaround.
Option 1
See https://github.com/jenkinsci/slack-plugin/issues/191#issuecomment-232307353 which will remove all slack configurations and give an opportunity to reconfigure your Jenkins with the latest update of the Slack plugin.
Option 2
This will entirely disable outbound webhooks in the Slack plugin 2.0.
- Go to your
$JENKINS_HOMEand create ainit.groovy.d/directory. - Download this script to disable Slack outbound webhooks and copy it into
$JENKINS_HOME/init.groovy.d. - Restart your Jenkins instance.
It should be back to normal and you’ll be able to configure things again. Slack outbound webhooks will always be disabled for the duration you have this script installed in init.groovy.d/.
Problematic conditions
I was able to successfully reproduce the issue under the following conditions.
- Another plugin with webhooks configured (the bootstrap includes ghprb plugin i.e. github pull request builder plugin)
- Authentication enabled (recommend using the pre-installed github oauth plugin from the bootstrap).
- Only authenticated users get access (i.e. not anonymous). I simply set the
authenticatedgroup to be administrators with theAdministerpermission. - Upgrading from Slack 1.8.1 to 2.0.0.
How to reproduce (for developers to patch)
- Bootstrap Jenkins with slack configured. Simply clone the repository and execute
./slack_bootstrap.shon a Unix-like machine. This will:- Pre-install an older version of Jenkins.
- Pre-install and configure the slack plugin 1.8.1.
- Configure some test jobs with slack configured.
- Pre-install github-oauth and ghprb plugin.
- Configure global security:
- Enable global security.
- Generate a new GitHub OAuth Application. With the following settings:
- Application name:
Jenkins - Homepage URL:
http://localhost:8080/ - Application description:
Jenkins testing. - Authorization callback URL:
http://localhost:8080/securityRealm/finishLogin
- Application name:
- Security Realm should be set to Github Authentication Plugin and configure it with the Client ID and Client Secret settings from your GitHub OAuth application.
- Under access control in the global security page configure Authorization and choose
Matrix-based security. Set the following settings:authenticatedgroup must have administer permissions.anonymousgroup must not have any permissions.
- Visit http://localhost:8080/manage and update Jenkins to latest edition.
- Restart Jenkins after upgrade.
- Visit http://localhost:8080/pluginManager/ and update all plugins (including Slack plugin 2.0) to latest editions.
- Restart Jenkins after upgrade.
From this point, you should get a stack trace like in JENKINS-33556. Following the above steps reproduces the issue every time.
Additional bootstrap commands:
- Restart the Jenkins instance with
./scripts/provision_jenkins.sh restart - Delete and clean up everying.
./gradlew clean - Bootstrap everything again.
./slack_bootstrap.sh
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Reactions: 14
- Comments: 23 (11 by maintainers)
to workaround the issue, run the script on Jenkins script console
It will output something like jenkins.plugins.slack.webhook.GlobalConfig@526ba2e2 jenkins.plugins.slack.webhook.WebhookEndpoint@15ab7a57 null Result: jenkins.plugins.slack.webhook.GlobalConfig@526ba2e2
I had Jenkins failing during startup with the same issues as above. My solution was the following:
CAUTION: This will wipe your old Slack configurations, but I prioritized having the Slack integration up and running and took the time to redo the integrations.
This is still happening on Jenkins ver. 2.114 + Slack Notification Plugin ver. 2.3 The fix from @fengxx worked for these versions.
This is still happening. Is this plugin abandoned? Is there another plugin I should use instead?
I have installed lastest slack notification plugins (version 2.2) also encountered this error. Apply Option 2 Workaround (see above) and save my time, thanks.