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

Messages failing #108

Open
royceking opened this issue May 5, 2017 · 10 comments
Open

Messages failing #108

royceking opened this issue May 5, 2017 · 10 comments
Assignees

Comments

@royceking
Copy link

I occasionally have messages that don't get sent with a job is successful. I can't find why the message get sent most the time, but randomly won't get sent. All I can attribute it to is this stack trace. But this just looks like a warning and not something that would make the message not send.

May 05, 2017 4:21:45 PM jenkins.plugins.hipchat.impl.DefaultCardProvider getCard WARNING: Failed to resolve token macros org.jenkinsci.plugins.tokenmacro.MacroEvaluationException: Unrecognized macro 'TEST_COUNTS' in '${TEST_COUNTS,var="pass"}' at org.jenkinsci.plugins.tokenmacro.Parser.processToken(Parser.java:317) at org.jenkinsci.plugins.tokenmacro.Action$KiHW1UeqOdqAwZul.run(Unknown Source) at org.parboiled.matchers.ActionMatcher.match(ActionMatcher.java:96) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.FirstOfMatcher.match(FirstOfMatcher.java:41) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.ZeroOrMoreMatcher.match(ZeroOrMoreMatcher.java:39) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.matchers.SequenceMatcher.match(SequenceMatcher.java:46) at org.parboiled.parserunners.BasicParseRunner.match(BasicParseRunner.java:77) at org.parboiled.MatcherContext.runMatcher(MatcherContext.java:351) at org.parboiled.parserunners.BasicParseRunner.run(BasicParseRunner.java:72) at org.parboiled.parserunners.ReportingParseRunner.runBasicMatch(ReportingParseRunner.java:86) at org.parboiled.parserunners.ReportingParseRunner.run(ReportingParseRunner.java:66) at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:81) at org.parboiled.parserunners.AbstractParseRunner.run(AbstractParseRunner.java:76) at org.jenkinsci.plugins.tokenmacro.Parser.process(Parser.java:68) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:204) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:200) at jenkins.plugins.hipchat.impl.DefaultCardProvider.getAttributes(DefaultCardProvider.java:60) at jenkins.plugins.hipchat.impl.DefaultCardProvider.getCard(DefaultCardProvider.java:37) at jenkins.plugins.hipchat.model.NotificationType.getNotification(NotificationType.java:111) at jenkins.plugins.hipchat.model.NotificationType.getNotification(NotificationType.java:96) at jenkins.plugins.hipchat.HipChatNotifier.publishNotificationIfEnabled(HipChatNotifier.java:328) at jenkins.plugins.hipchat.HipChatNotifier.notifyOnBuildComplete(HipChatNotifier.java:305) at jenkins.plugins.hipchat.HipChatNotifier.perform(HipChatNotifier.java:293) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) at hudson.model.Build$BuildExecution.cleanUp(Build.java:195) at hudson.model.Run.execute(Run.java:1775) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:404)

Anyone else see the occasional message not send? I don't see anything else in the logs.

@fkawa-play
Copy link

Hi, I reproduced same situation that notification message didn't send to HipChat sometimes. Maybe you didn't see following INFO message in console output, right?

[INFO] HipChat notification sent to the following rooms: xxxxxx

jenkins.plugins.hipchat.HipChatNotifier.publishNotificationIfEnabled(HipChatNotifier.java:328, that is, following execution will fail. I'll dig more.

getHipChatService(build).publish(notificationType.getNotification(notificationConfig, build, listener));

@royceking
Copy link
Author

fkawa-play that is exactly what happens. It is like it just gets ignored. Thanks for the help.

@aldaris
Copy link

aldaris commented Jul 20, 2017

@royceking the stacktrace you provided suggests two things:

  • the notification should have been successfully sent
  • the card provider was unable to generate the card, because the plugin tried to expand tokens that it did not have access to. This should mean that the job sent a notification without a card.

To ensure that TEST_COUNTS tokens work correctly, install the email-ext Jenkins plugin. I will update the default card provider so that it does not fall over when populating the card attributes with unsupported token macros.

@aldaris
Copy link

aldaris commented Jul 20, 2017

@fkawa-play I'm not sure I understand what you are describing, but if the plugin reported that the notification was successfully sent, then by definition the messages should have arrived to the HipChat room.

@ikari7789
Copy link

@aldaris doesn't it make more sense to wrap anything that relies on another plugin being installed, such as TEST_COUNTS, in a try/catch clause? Seems silly to spit out stacktrace to the log when it's the expected behavior.

@monkpit
Copy link

monkpit commented Apr 16, 2018

I am seeing the behavior described (occasionally messages are not sent). I don't get any output in my build log at all when the messages fail, it just "doesn't work".

For example, I'll have a build start, and HipChat gets the message for build start event. I see the message is sent successfully in an [INFO] message in the logs. The build runs, and completes, and then sometimes (regardless of pass/fail of the build) I will not get the message that the build is completed. It seems like around 90% of the messages work as intended, and around 10% fail silently.

From the messages I have noticed failing, it seems to be only the result message that doesn't get sent. It looks like the "build started" message is always sent.

Where should I look to see more info/logs about what is happening during the failures? I am not seeing any stacktraces in the build log / console.

@royceking
Copy link
Author

royceking commented Apr 16, 2018 via email

@jmcshane
Copy link

I see this message as well and its really becoming a pain in the Jenkins logs when debugging other issues. Any ideas on what we could do to help with this issue?

@monkpit
Copy link

monkpit commented Apr 30, 2018

I think the source of this issue is when the status of a build is “returned to normal” it doesn’t count as “passed”. So if you don’t have “returned to normal” status set up to report, you will be missing a message in HipChat for the build result.

What I did was go into my Jenkins build and just enabled all messages to try and see what was going wrong. Since doing this I have not had any missed messages.

I guess this is working as designed, however I would expect the “passed” category to automatically include the “returned to normal” category of messages. It’s a bit strange that they are not included.

@royceking
Copy link
Author

I see the issue a lot when I have two of the same job running at the same time. The one that finishes first reports to Hipchat and then the one that finishes second does not.

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