pyr / cyanite

cyanite stores your metrics
http://cyanite.io
Other
446 stars 79 forks source link

NullPointer Exception in metrics API #282

Open urtokk opened 6 years ago

urtokk commented 6 years ago

Hello, we are currently trying to evaluate cyanite as a substitute for carbon, but met an exception which is a blocker.

We get following stacktrace by querying with curl 'http://127.0.0.1:8080/metrics?path=collectd.myhost.memory.memory.used&from=1509950181&to=1509971781' :

DEBUG [2017-11-07 11:58:55,642] nioEventLoopGroup-3-1 - io.cyanite.api metric fetch request for: "collectd.myhost.memory.memory.used"
ERROR [2017-11-07 11:58:55,669] nioEventLoopGroup-3-1 - io.cyanite.api could not process request
java.lang.NullPointerException: null
    at clojure.lang.RT.intCast(RT.java:1192)
    at io.cyanite.store.cassandra$get_types$fn__12798.invoke(cassandra.clj:90)
    at clojure.core$mapv$fn__9368.invoke(core.clj:6788)
    at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49)
    at clojure.core.protocols$fn__9132.invokeStatic(protocols.clj:75)
    at clojure.core.protocols$fn__9132.invoke(protocols.clj:75)
    at clojure.core.protocols$fn__9072$G__9067__9085.invoke(protocols.clj:13)
    at clojure.core$reduce.invokeStatic(core.clj:6704)
    at clojure.core$mapv.invokeStatic(core.clj:6779)
    at io.cyanite.store.CassandraV2Store$fn__12911.invoke(store.clj:64)
    at io.cyanite.store$common_fetch_BANG_.invokeStatic(store.clj:27)
    at io.cyanite.store.CassandraV2Store.fetch_BANG_(store.clj:39)
    at io.cyanite.api$fn__16638.invokeStatic(api.clj:152)
    at io.cyanite.api$fn__16638.invoke(api.clj:136)
    at clojure.lang.MultiFn.invoke(MultiFn.java:229)
    at io.cyanite.api$process.invokeStatic(api.clj:89)
    at io.cyanite.api$make_handler$fn__16666.invoke(api.clj:165)
    at net.http.server$get_response.invokeStatic(server.clj:240)
    at net.http.server$netty_handler$fn__16325.invoke(server.clj:321)
    at net.http.server.proxy$io.netty.channel.ChannelInboundHandlerAdapter$ff19274a.channelRead(Unknown Source)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at net.http.server.proxy$io.netty.handler.codec.MessageToMessageDecoder$ff19274a.channelRead(Unknown Source)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
    at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    at java.lang.Thread.run(Thread.java:748)

It seems to be similair to Issue #211, but at a different place.

I would be grateful, if there's a solution for it. or a patch.