slack-plugin: Slack publish failed, response code 404

I’m trying to setup slack integration on a docker running in localhost. When trying to publish or test connection in the settings, I’m getting this in the logs:

Jan 17, 2019 9:37:55 AM jenkins.plugins.slack.StandardSlackService publish WARNING: Slack post may have failed. Response: null Jan 17, 2019 9:37:55 AM jenkins.plugins.slack.StandardSlackService publish WARNING: Response Code: 404

The same configurations are working in a non-docker configurations


    slackNotifier:
      tokenCredentialId: slack-token
      teamDomain: <workspace>
      baseUrl: https://<workspace>.slack.com/services/hooks/jenkins-ci/  
 credentials:
    system:
      domainCredentials:
            - string:
                scope: GLOBAL
                id: slack-token
                secret: ${SLACK_TOKEN}

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 43 (15 by maintainers)

Most upvoted comments

For me, with the version 2.15 I if I use the tokenCredentialId I have the 404 reported before. The work around for me was to use the withCredentials.

Non working version:

slackSend teamDomain: 'domain', channel: 'pipeline-cicd', tokenCredentialId: 'slackCredentials',  color: 'danger', message: 'Not so good message from Jenkins Pipeline'

Working version:

withCredentials([string(credentialsId: 'slack-credentials', variable: 'slackCredentials')]) {
    slackSend teamDomain: 'domain',
        channel: 'pipeline-cicd', 
        token: slackCredentials, 
        color: 'danger',
        message: 'Not so good message from Jenkins Pipeline'
}

I had the same problem and managed to get it working. You need to set the integration token as a jenkins credential ID. The integration token input field is there, but seems to be ignored by the plugin.