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

Plugin no longer posts notifications #18

Open
marth8880 opened this issue May 3, 2020 · 5 comments
Open

Plugin no longer posts notifications #18

marth8880 opened this issue May 3, 2020 · 5 comments

Comments

@marth8880
Copy link

This used to work great for me. Now it doesn't work at all.

I recently tried building a project that had this set up working fine last year and now it no longer posts to the Discord channel. The webhook URL hasn't changed nor has anything to do with the build. The plugin is up-to-date.

Jenkins is pretty up-to-date as well. The project is a typical freestyle project using SVN as its SCM. (I'm also not able to get the plugin working with a Bitbucket Server project.)

Maybe I'm missing something?

@marth8880 marth8880 changed the title Plugin no longer works Plugin no longer posts notifications May 3, 2020
@melt7777
Copy link

melt7777 commented May 3, 2020

Working fine here as part of Jenkinsfile pipeline:
image

Can you provide some more details and example of how you are using it ? Make sure bot has permissions in that Discord channel.

Troubleshooting steps: You could try different job, channel, webhook, etc.

Hope this is helpful!

~ melt
miner.farm
DevOps Infrastructure Engineer

@marth8880
Copy link
Author

marth8880 commented May 6, 2020

After investigating, notifications are successfully posted with "Enable URL linking" unticked. This is my configuration for the plugin (the only post-build action):

image

And then the rest of the project:

image

image

image

image

"Build" configuration is a series of Windows batch and shell command execution blocks.

It's worth noting I get this message in my build output log when the option is ticked:

Your Jenkins URL is not set (or is set to localhost)!

Which setting is this referring to? Because "Jenkins URL" in the "Configure System" page is definitely set, and not to localhost. Is this the right setting for this?

@melt7777
Copy link

melt7777 commented May 6, 2020

I am using Discord Notifier Plugin 1.4.12 over Jenkins 2.222.3 (Both are the current latest available in repos)

I successfully tested both my Jenkinsfile Pipeline via SCM discord notifications, and my freestyle projects discord notifications, with both URL linking ON and OFF, and all 4 variations are working properly for me.

For localhost error, have a quick peek at this page: https://www.tutorialspoint.com/jenkins/jenkins_configuration.htm

Triage tip: Perhaps add debug lines prior to discord notification step, Execute shell echo ${JENKINS_URL} and such, to see what's going on.

Hope this is helpful!

~ melt
miner.farm
DevOps Infrastructure Engineer

@marth8880
Copy link
Author

Jenkins URL is echoing the correct value:

image

Our Jenkins instance is set up for URL redirection with nginx, could that be related?

@melt7777
Copy link

melt7777 commented May 7, 2020

So, I found where that error comes from. When URL Linking is turned on, then it will check for the global url, i'm guessing this is the value of "Jenkins Location -> Jenkins URL" on /configure. Should not matter if it's proxied.

Here's the code:

if (this.enableUrlLinking && (globalConfig.getUrl() == null || globalConfig.getUrl().isEmpty())) {

Hope this helps, all!

~ melt
miner.farm
DevOps

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

2 participants