Closed garethgreenaway closed 8 years ago
I'm running Jenkins 1.655 and Mattermost 2.1. Are you running version 1.5.0 of this plugin?
Can you see what's in jenkins.log? For each post, I have lines like these:
INFO: Posting: to #$room icon: $url, on $hook: $message
INFO: Posting succeeded
Do you see any lines for other than the build start?
(or 1.5.1)
I ended up building it manually so the version is 1.5.2-SNAPSHOT (private-108f394f-gareth), I'll try installing 1.5.1 and see if that works.
OK please keep me posted here!
An update. I had to upgrade the problematic version of Jenkins to the latest version, then I was able to install the Mattermost plugin (1.5.1). Unfortunately seeing the same results as before. However, I spun up a fresh install of Jenkins with the plugin and I do see the correct output when running a build job. So something is wonky on this other setup, unrelated to the plugin.
Another update Tried a different job and I saw everything. So something wonky in this particular job.
Perhaps a combination with another plugin? Is it possible for you to verify this? Could you test your job (or a copy of it) in the "broken" set-up with steps other than mattermost publisher removed? If this should work, try out combinations of steps until it stops working, etc.
The only other plugin that is being used by this particular build job is the Virtualenv plugin. For the status of the job, how does the Mattermost plugin determine which status to send? Maybe the status this particular job is invalid and so it doesn't know which one to send?
I think these are the most relevant lines:
Also but less relevant:
Cleared all the build steps out to try and get some notifications working via Mattermost, when I took a look at the logs I see this error:
WARNING: RunListener failed java.lang.NoClassDefFoundError: hudson/tasks/test/AbstractTestResultAction at jenkins.plugins.mattermost.ActiveNotifier$MessageBuilder.appendTestSummary(ActiveNotifier.java:286) at jenkins.plugins.mattermost.ActiveNotifier.getBuildStatusMessage(ActiveNotifier.java:198) at jenkins.plugins.mattermost.ActiveNotifier.completed(ActiveNotifier.java:105) at jenkins.plugins.mattermost.MattermostListener.onCompleted(MattermostListener.java:27) at jenkins.plugins.mattermost.MattermostListener.onCompleted(MattermostListener.java:15) at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:202) at hudson.model.Run.execute(Run.java:1783) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)
Did you install any plugins in your fresh install? Can you replicate the broken job in your wonky setup? I'm by no means an expert...
I installed a lot of plugins in the new install where it's working there are also a number of them installed in the older setup where it's not working. I created a new job, copying the old job and it has the same results. I'm wondering if there is something outdated being referenced in the old jobs that is causing the issue. Need to investigate more.
Found the cause! Someone at some point at disabled the JUnit plugin on the older jenkins setup. For whatever reason, someone about this particular job needed that to send the results along. Once I re-enabled it and restarted Jenkins everything started working again. Closing this out. Thanks!
Great you found this! I'm not sure why junit should be necessary, maybe I can add a test for it in the code...
Looking at what options I had enabled it looks like this one was selected in the job that was having issues: "Include Test Summary" but not in the one that was working. Could be the cause.
It was checked in the mattermost settings?
The Mattermost Jenkins settings, in Advanced. I hadn't noticed that I was checked it until just now.
Ok still something to test for then! Can't have stack traces now, can we ;-)
:+1:
Using 1.638 and Mattermost 2.1, I'm only seeing notifications for when builds start. No other notifications appear to be sent.