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

Jenkin Slack Notification Plugin Null Pointer Exception #62

Closed
scthunderbolt opened this issue Mar 5, 2015 · 6 comments
Closed

Jenkin Slack Notification Plugin Null Pointer Exception #62

scthunderbolt opened this issue Mar 5, 2015 · 6 comments

Comments

@scthunderbolt
Copy link

Hi,
We are seeing the occaionaly Null Pointer Execption from the Jenkins Slack Notification plugin:
"
FATAL: null
java.lang.NullPointerException
at java.util.AbstractCollection.addAll(Unknown Source)
at jenkins.plugins.slack.ActiveNotifier.getChanges(ActiveNotifier.java:115)
at jenkins.plugins.slack.ActiveNotifier.started(ActiveNotifier.java:45)
at jenkins.plugins.slack.SlackNotifier$SlackJobProperty.prebuild(SlackNotifier.java:280)
at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:804)
at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:799)
at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:795)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
at hudson.model.Run.execute(Run.java:1745)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
"
Slack Notification Plugin 1.7

@samrocketman
Copy link
Member

Occasionally is pretty vague. Does it occur from a certain action? If you could determine the circumstances in which it occurs then I could try to reproduce it to verify the issue. Please let me know.

@scthunderbolt
Copy link
Author

Unfortuately it is quite rare, even though we run a lot of jobs everyday. No discernable pattern to reproduce it, and we have seen it occur in two different jobs.

We use the REPO plugin to checkout source code from multiple git repositories, and the NPE occurs right after checkout is completed, but only occasionally, not always.

So it is not readliy reproducable. Is there some logs / info I should look out for when it occur the next time?

Maybe some extra checks is needed around the offending line " jenkins.plugins.slack.ActiveNotifier.getChanges(ActiveNotifier.java:115)"?

Since the REPO plugin is used right before the NPE, the list of changes in this particular case has something a bit strange:

"
Revision:
Author: unknown <> on
Committer: <> on

This project was added to the manifest.
"

This might be causing the problem?

@peergum
Copy link
Contributor

peergum commented Mar 6, 2015

Since I wrote the code that caused the error, I'll check that asap. thanks for catching that.

@sklirg
Copy link

sklirg commented Mar 11, 2015

* DISREGARD THIS -- READ EDIT 2*

I'm also running into Slack plugin NPEs (Using v1.7). The Test Connection works just fine (I get the confirmation on Slack), but no messages regarding build is sent to Slack no matter what options I choose. (Notify failure, success, unstable, back to normal will build the maven project, but won't say anything to Slack)

This happens both using "Build now" and building from a github webhook.

If I select "Notify build start", I get this in my Console output:

Checking out Revision 90808f0fe08815471ac1ded11e8cc24526cd466f (refs/remotes/origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 90808f0fe08815471ac1ded11e8cc24526cd466f
 > git rev-list 90808f0fe08815471ac1ded11e8cc24526cd466f # timeout=10
FATAL: null
java.lang.NullPointerException
    at jenkins.plugins.slack.StandardSlackService.<init>(StandardSlackService.java:31)
    at jenkins.plugins.slack.SlackNotifier.newSlackService(SlackNotifier.java:90)
    at jenkins.plugins.slack.ActiveNotifier.getSlack(ActiveNotifier.java:38)
    at jenkins.plugins.slack.ActiveNotifier.notifyStart(ActiveNotifier.java:65)
    at jenkins.plugins.slack.ActiveNotifier.started(ActiveNotifier.java:53)
    at jenkins.plugins.slack.SlackNotifier$SlackJobProperty.prebuild(SlackNotifier.java:280)
    at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:816)
    at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:811)
    at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:807)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
    at hudson.model.Run.execute(Run.java:1750)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)
Finished: FAILURE

I set up Slack notifications on another Jenkins instance (on another server) without problems.

EDIT:
Not sure if it's related, but it possibly is: All the ? symbols regarding Slack options return ERROR: Failed to load help file: Not Found

EDIT2:
Apparently, the channel is not optional, and should not be hidden in Advanced options (?). I thought since you selected a channel to post to in the Slack Integration options, you didn't have to specify it again in Jenkins. Turns out you have to. My problem is therefore solved.

@samrocketman
Copy link
Member

@sklirg regarding your inquiry about the test connection button there's an open issue for it already. Please refer to #51.

alexey-pelykh pushed a commit to brainbeanapps/slack-plugin that referenced this issue Nov 3, 2016
…tarea

[FIXED JENKINS-30228] use textarea for Xcode Build Arguments.
samrocketman added a commit that referenced this issue Mar 2, 2017
samrocketman added a commit that referenced this issue Mar 2, 2017
Merge PR #197 Fix #62 by excluding empty affected
@samrocketman samrocketman added this to the slack-2.2 milestone Mar 6, 2017
@samrocketman
Copy link
Member

Feel free to subscribe to #296 for updates related to Slack Plugin 2.2 release.

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

No branches or pull requests

4 participants