-
Notifications
You must be signed in to change notification settings - Fork 411
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
Slack-API Notifications no longer working #545
Comments
Are you using freestyle jobs or pipeline? What scope is the credential set at? |
We're using pipeline, and the credential is set globally. |
Scope is System (Jenkins and nodes only). |
Needs to be updated to global, System means it's not available to jobs We're now Job context aware to allow supporting folder credentials, it has an impact that any previously working System credentials won't work. |
Ok, that's good to know. I'll try that |
I just updated from 2.18 to 2.20 and I am still seeing the error that the OP reported. I double-checked that my existing credential is global-scope and is called "Migrated slack token". When I test connection from the global Jenkins configuration, it works, but from a job (even one which contains no overrides of the global settings), it fails with the illegal argument exception. I note that the menu for "Integration Token Credential ID" has no options other than "none". I believe I should be able to select my existing credential there, but I'm not sure if that's just for overriding too. |
@timja I'm confused; I saw that comment, and I already checked that my credential is set to global scope, not system. Did I miss something? |
can you post a screenshot please of your credential config |
Click the "migrated slack token" credential and then click update |
I will soon; I had to downgrade the plugin to get notifications working again, and as soon as there is a lull I will upgrade the plugin again and try the update on the credential. Thanks for the help! |
you can update the credential separately, Global will work on both versions of the plugin |
Oh, hah. In the Update screen for the token, "Scope" was set to System there. I missed that before, thinking the "global" that I saw on the main Credentials screen meant the token was global. I've set it to Global now so it will probably work when I re-upgrade the plugin. Thanks again. |
@timja Confirmed, after change to token scope, 2.20 works as expected. Sorry for the noise, but I appreciate you clearing up my confusion. |
@timja : this isn't cool. If you make a breaking change like this, you must mark it as breaking so that when people upgrade they will get a nice red warning about incompatible settings. For example:
Warning: the new version of this plugin claims to use a different settings format than the installed version. Jobs using this plugin may need to be reconfigured, and/or you may not be able to cleanly revert to the prior version without manually restoring old settings. Consult the plugin release notes for details. |
@jsoref there was a bug in the migration, it should have been compatible. believe me there's a number of methods and code I want to remove in this plugin but I'm keeping them for backwards compatibly. 90% of the review I do on changes is for backwards compatibility fixes |
What is the actual fix for this? I just tried integrating with this plugin, and am still getting the same error. I'm injecting the token as a global secret using the Configuration As Code plugin (into my docker image for jenkins), and the end result is ERROR: Slack notification failed with exception: java.lang.IllegalArgumentException: the token with the provided ID could not be found and no token was specified Even though the specified token id is correct in the debug output above: And a global credential exists with the correct value. |
It turns out, I still had a bug in my docker build, that was causing the token "secret" portion to be an empty string, instead of the correct value. But the error message provided when this happened was still wrong - it shouldn't say that the provided ID could not be found, because it could be found - it is just that the provided ID had the incorrect (empty) value in my case. |
Feel free to send a PR for this edge case @darmbrust |
To all reading this thread ... upgrading to version 2.30 of the plugin completely broke Slack notifications (w/Jenkins ver. 2.189). No amount changing credential scopes worked. In fact, I wasn't able to use any existing credentials, and when I tried to create new ones I wasn't able to select the new one that I created. Solution that worked for me: Revert to Slack plugin version 2.28 and re-select credentials, and then things worked fine again. |
File a new issue please |
Done: #609 |
Hello All, I'm still facing this issue at Jenkins 2.204.1 and plugin 2.36, does anyone know how to solve this? |
@evertonevaristo: Please file a new issue. (This stuff is apparently moderately fragile as it has since been broken and fixed again at least once before, c.f. #545 (comment).) |
@jsoref thank you! |
We've upgraded our slack-plugin from 2.18 to 2.19, and can no longer publish notifications to our slack channels. We receive the following error:
We are configuring and using the token by using the following XML configuration:
We've also tried setting the teamDomain, with no success. Since this worked prior to upgrading to 2.19, I'm guessing this is related to the folder credential support added in PR-541(#541)
The text was updated successfully, but these errors were encountered: