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

ERROR: Slack notification failed. See Jenkins logs for details. After Recent Update #525

Closed
DarthOpto opened this issue Feb 22, 2019 · 20 comments

Comments

@DarthOpto
Copy link

DarthOpto commented Feb 22, 2019

I updated to latest version of the plugin last week, and ever since then, no notifications are going through to our slack channel.

Anyone else having this issue?

Here is the error I am seeing in my job log.

Slack Send Pipeline step running, values are - baseUrl: <empty>, teamDomain: ourdomain, channel: #product_engineering, color: #00FF00, botUser: false, tokenCredentialId: token
ERROR: Slack notification failed. See Jenkins logs for details.
@timja
Copy link
Member

timja commented Feb 22, 2019

could you check the jenkins logs please

@DarthOpto
Copy link
Author

Here is what the jenkins logs are returning:

Feb 22, 2019 12:28:24 AM WARNING jenkins.plugins.slack.StandardSlackService publish
Slack post may have failed. Response: null
Feb 22, 2019 12:28:24 AM WARNING jenkins.plugins.slack.StandardSlackService publish
Response Code: 404

@timja
Copy link
Member

timja commented Feb 22, 2019

is your jenkins credential saved at the GLOBAL level? there's an option issue where it only looks at that level

@DarthOpto
Copy link
Author

yes it is.

@DarthOpto
Copy link
Author

I think it may have something to do with a firewall we just implemented. I am working with our IT guy to see if that is the problem. Will let you know.

@CodeMonk
Copy link

This is how we send -- this was working until Tuesday.

slackSend ( channel: "#eng_builds", attachments: """[{"fallback": "*django*: <${env.JOB_URL}/${env.BUILD_NUMBER}|${branch}> has a new build available.", "author_link": "${env.JOB_URL}/${env.BUILD_NUMBER}", "author_name": "django: ${branch} has a new build available.", "author_icon": "${notificationThumb}", "color": "good"}]""" )

Now we get the exact failures above, and no notifications to the channel.

@DarthOpto
Copy link
Author

That is when it started happening to us as well.

@CodeMonk
Copy link

CodeMonk commented Feb 22, 2019

Actually -- we have NOT updated the plugin. This behavior exists in 2.15

I will try upgrading to 2.18, but, given that it seems to be version agnostic, this could be a slack thing.

I'm asking the dev4slack teams if there was an API change Tuesday evening, and holding off on updating.

@Roach
Copy link

Roach commented Feb 22, 2019

Does it log the response from the Slack API call?

@CodeMonk
Copy link

404 with no body -- trying to figure out the url -- upping logging

@CodeMonk
Copy link

URL is sending ?token=null -- you can see it under FINE logging.

@timja
Copy link
Member

timja commented Feb 22, 2019

What probably happened is there was a bug in 2.15 that meant if you were previously using the 'integration token text' in your global config, it didn't save the credential when it was migrated, it was only there in memory and lost on a restart,
if you check your global config your credential is probably empty / check your credentials to see if its actually saved

its easy to fix by creating a new credential and updating your config.

the migration issue was fixed in 2.17

@CodeMonk
Copy link

But, I had the behavior in 2.15 first.

I upgraded to 2.18 to try to mitigate the failure.

The slack creds DID disappear from my configuration, so I know how to fix my install now, but, I'm still concerned that I was seeing identical behavior in 2.15. And that behavior started Tuesday evening.

Did anything else happen to things Tuesday evening?

@timja
Copy link
Member

timja commented Feb 22, 2019

2.15 is where the problem is. Upgrading doesn't fix it, its too late the token is gone

You need to re setup the credential

Anyone new who upgrades from 2.14 to >2.16 is fine

@CodeMonk
Copy link

Confirmed. Re-adding the token fixes the integration.

@navinkbe7
Copy link

@CodeMonk Sorry, I am not following, Is it just re-adding the token in jenkins or recreate the token and then re-adding in jenkins ?
I had to re-create a token(new) and the re-adding the token in jenkins fixed the issue.
Plugin Version: 2.17

@CodeMonk
Copy link

I re-copied the token from the slack integration, and then added it as a Secret Text, per the instructions.

@DarthOpto
Copy link
Author

After re-setup of the credential, the slack notifications are working again for me.

@timja
Copy link
Member

timja commented Feb 25, 2019

Thanks, closing, the issue is fixed with 2.17, but if you migrated to 2.15 or 16 there's no fix other than recreating the credential

@mike-maliska
Copy link

Has anyone seem this where it works sometimes? For example, we notify slack at the start and end of the job.
It will fail on one of them but not both, and not always one or the other. It was right after a Jenkins upgrade.

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

No branches or pull requests

6 participants