Emailing getting a class cast exception

34 views
Skip to first unread message

Peter Neubauer

unread,
Jan 14, 2015, 9:17:56 AM1/14/15
to rieman...@googlegroups.com
Hi there,
as I'm trying to send mail, with

; vim: filetype=clojure

(logging/init :file "/var/log/riemann/riemann.log")
(tcp-server :host "0.0.0.0" :port 5555)
(udp-server :host "0.0.0.0" :port 5555)
(ws-server :host "0.0.0.0" :port 5556)

(info "new start")

(let [
ops_mail "pe...@mapillary.com"
email (mailer {:host "smtp.sendgrid.net"
:port 465
:ssl true
:user "x...@heroku.com"
:pass "xxx"
:from "rie...@mapillary.com"
:body (fn [events] (apply prn-str events))})
my-index (index)
index (update-index my-index)]
(streams
(with :ttl 300
index))
(streams
(changed-state {:init "ok"}
#(info (str "changed state" (pr-str %)))
(email "pe...@mapillary.com"))))
I'm getting exceptions when sending like below. There seems to be something about the message.add_extra! in postal, but I have no idea where that Long coudl come from and how to avoid it?

Thanks for your help!

/peter

WARN [2015-01-14 09:09:47,247] pool-18-thread-1 - riemann.streams - riemann.email$mailer$fn__7292$fn__7293@3242e74f threw

java.lang.ClassCastException: Cannot cast java.lang.Long to java.lang.String

        at java.lang.Class.cast(Class.java:3176)

        at clojure.lang.Reflector.boxArg(Reflector.java:411)

        at clojure.lang.Reflector.boxArgs(Reflector.java:444)

        at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:58)

        at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)

        at postal.message$add_extra_BANG_.invoke(message.clj:99)

        at postal.message$make_jmessage.invoke(message.clj:139)

        at postal.message$make_jmessage.invoke(message.clj:124)

        at postal.message$message__GT_str.invoke(message.clj:35)

        at postal.sendmail$sendmail_send.invoke(sendmail.clj:42)

        at postal.core$send_message.invoke(core.clj:13)

        at postal.core$send_message.invoke(core.clj:15)

        at riemann.email$email_event.invoke(email.clj:56)

        at riemann.email$mailer$fn__7292$fn__7293.invoke(email.clj:86)

        at riemann.streams$changed$fn__4991$fn__5001.invoke(streams.clj:893)

        at riemann.streams$changed$fn__4991.invoke(streams.clj:893)

        at riemann.streams$by_fn$fn__4971$fn__4979.invoke(streams.clj:860)

        at riemann.streams$by_fn$fn__4971.invoke(streams.clj:860)

        at riemann.server$handle.invoke(server.clj:59)

        at riemann.server$tcp_handler$fn__6840.invoke(server.clj:104)

        at riemann.server.proxy$org.jboss.netty.channel.SimpleChannelHandler$0.messageReceived(Unknown Source)

        at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:95)

        at riemann.server.proxy$org.jboss.netty.channel.SimpleChannelHandler$0.handleUpstream(Unknown Source)

        at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:558)

        at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:777)

        at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)

        at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)

        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)


Aphyr

unread,
Jan 14, 2015, 12:31:23 PM1/14/15
to rieman...@googlegroups.com
On 01/14/2015 06:17 AM, Peter Neubauer wrote:
> Hi there,
> as I'm trying to send mail, with

> at postal.message$add_extra_BANG_.invoke(message.clj:99)

Strangely enough, line 99 of message.clj in postal 1.11.1 (the version Riemann
ships) isn't even in the add-part! function. I have:

97 (defn eval-bodypart [part]
98 (condp (fn [test type] (some #(= % type) test)) (:type part)
99 [:inline :attachment]

Are you mucking around with the classpath at all? Different postal dep?

--Kyle

Peter Neubauer

unread,
Jan 14, 2015, 2:35:22 PM1/14/15
to rieman...@googlegroups.com
Well,
turns out I had a really old version, came with https://github.com/SimpleFinance/chef-riemann. Installing 0.2.8 worked like a charm.

Sorry for bothering you with such n00b questions Kyle!

/peter


G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Open Data    - @mapillary
Open Source - @neo4j
Open Future  - @coderdojo



--
You received this message because you are subscribed to a topic in the Google Groups "Riemann Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/riemann-users/jaJ4Ul8d0Eo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to riemann-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages