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

unable to send alert email #1086

Closed
ovadm opened this Issue Mar 31, 2015 · 6 comments

Comments

Projects
None yet
3 participants
@ovadm

ovadm commented Mar 31, 2015

hi,
emails are not being sent, it was working fine with the VM appliance but when I moved to production server - installed everything using apt-get with same config file it stopped working
Graylog Version 1.0.1/ Debian 7

ERROR [AnyExceptionClassMapper] Unhandled exception in REST resource
java.lang.NullPointerException
        at org.graylog2.alarmcallbacks.EmailAlarmCallback.call(EmailAlarmCallback.java:92)
        at org.graylog2.rest.resources.streams.alerts.StreamAlertReceiverResource.sendDummyAlert(StreamAlertReceiverResource.java:171)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:151)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:172)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:104)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:384)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:342)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1030)
        at org.graylog2.jersey.container.netty.NettyContainer.messageReceived(NettyContainer.java:356)
        at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
        at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
        at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
        at org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor$MemoryAwareRunnable.run(MemoryAwareThreadPoolExecutor.java:622)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
@joschi

This comment has been minimized.

Contributor

joschi commented Mar 31, 2015

The exception looks like one of the variables in https://github.com/Graylog2/graylog2-server/blob/1.0.1/graylog2-server/src/main/java/org/graylog2/alarmcallbacks/EmailAlarmCallback.java#L92-92 was null at the time of execution. Unfortunately it's hard to tell now.

Is there any error message before the one you've posted in your Graylog server logs?

@ovadm ovadm closed this Mar 31, 2015

@ovadm

This comment has been minimized.

ovadm commented Mar 31, 2015

Also found this, however mail server hostname is being resolved correctly

2015-04-01T00:26:30.044+03:00 ERROR [EmailAlarmCallback] Stream [55191b2fe4b04b732ba92bf8: "BigIP service Down"] has alert receivers and is triggered, but sending emails failed
org.apache.commons.mail.EmailException: Cannot find valid hostname for mail session
        at org.apache.commons.mail.Email.getMailSession(Email.java:639)
        at org.apache.commons.mail.Email.buildMimeMessage(Email.java:1268)
        at org.apache.commons.mail.Email.send(Email.java:1436)
        at org.graylog2.alerts.StaticEmailAlertSender.sendEmail(StaticEmailAlertSender.java:94)
        at org.graylog2.alerts.StaticEmailAlertSender.sendEmails(StaticEmailAlertSender.java:211)
        at org.graylog2.alerts.StaticEmailAlertSender.sendEmails(StaticEmailAlertSender.java:64)
        at org.graylog2.alarmcallbacks.EmailAlarmCallback.call(EmailAlarmCallback.java:79)
        at org.graylog2.alarmcallbacks.EmailAlarmCallback.call(EmailAlarmCallback.java:92)
@ovadm

This comment has been minimized.

ovadm commented Mar 31, 2015

solved, fortunately the t letter in transport was missing probably removed when line unremarked

thank you

joschi added a commit that referenced this issue Apr 1, 2015

@joschi joschi added this to the 1.0.2 milestone Apr 1, 2015

joschi added a commit that referenced this issue Apr 1, 2015

Fix potential NPE in EmailAlarmCallback#call
Refs #1086

(cherry picked from commit 35ce3ad)

@joschi joschi added the bug label Apr 1, 2015

@gbaltrons

This comment has been minimized.

gbaltrons commented Nov 17, 2015

if someone could look a this gbaltrons/graylog#1 i would appreciate a lot, thank you. I know it doesn't fit with this issue but i though no one would answer me if i won't link it here.

@joschi

This comment has been minimized.

Contributor

joschi commented Nov 17, 2015

@gbaltrons Please open an issue in this project or better write a mail to our mailing list.

@gbaltrons

This comment has been minimized.

gbaltrons commented Nov 17, 2015

@joschi #1567 thank you! I've just created my user, i'm novice here.

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