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

Invalid statistical functions can be selected in "add to dashboard" for non-numeric fields #1376

Closed
bernd opened this Issue Aug 27, 2015 · 2 comments

Comments

Projects
None yet
3 participants
@bernd
Member

bernd commented Aug 27, 2015

2015-08-27T16:21:06.774Z ERROR [AnyExceptionClassMapper] Unhandled exception in REST resource
java.lang.RuntimeException: Invalid field provided.
        at org.graylog2.dashboards.widgets.StatisticalCountWidget.compute(StatisticalCountWidget.java:142)
        at org.graylog2.dashboards.widgets.DashboardWidget$ComputationResultSupplier.get(DashboardWidget.java:144)
        at org.graylog2.dashboards.widgets.DashboardWidget$ComputationResultSupplier.get(DashboardWidget.java:140)
        at com.google.common.base.Suppliers$ExpiringMemoizingSupplier.get(Suppliers.java:192)
        at org.graylog2.dashboards.widgets.DashboardWidget.getComputationResult(DashboardWidget.java:114)
        at org.graylog2.rest.resources.dashboards.DashboardsResource.widgetValue(DashboardsResource.java:355)
        at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source)
        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:144)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:
205)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
        at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:308)
        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:317)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)
        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:606)
        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)
Caused by: org.graylog2.indexer.searches.Searches$FieldTypeException: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [q
uery], all shards failed; shardFailures {[fo0k_dRkQEKIH3DIhxAd0A][graylog2_26][0]: RemoteTransportException[[elastic-04.xxx.xx][inet[/172.30.0.93:9300]][indi
ces:data/read/search[phase/query]]]; nested: ClassCastException; }{[W7pOumJBSA6Anosq12rXfg][graylog2_26][1]: RemoteTransportException[[elastic-02.xxx.xx][ine
t[/172.30.0.163:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException; }{[W7pOumJBSA6Anosq12rXfg][graylog2_26][2]: RemoteTransportExceptio
n[[elastic-02.xxx.xx][inet[/172.30.0.163:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException; }{[fo0k_dRkQEKIH3DIhxAd0A][graylog2_26][
3]: RemoteTransportException[[elastic-04.xxx.xx][inet[/172.30.0.93:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException; }
        at org.graylog2.indexer.searches.Searches.fieldStats(Searches.java:418)
        at org.graylog2.dashboards.widgets.StatisticalCountWidget.compute(StatisticalCountWidget.java:113)
        ... 36 more
Caused by: org.elasticsearch.action.search.SearchPhaseExecutionException: Failed to execute phase [query], all shards failed; shardFailures {[fo0k_dRkQEKIH3DIh
xAd0A][graylog2_26][0]: RemoteTransportException[[elastic-04.xxx.xx][inet[/172.30.0.93:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastExcep
tion; }{[W7pOumJBSA6Anosq12rXfg][graylog2_26][1]: RemoteTransportException[[elastic-02.xxx.xx][inet[/172.30.0.163:9300]][indices:data/read/search[phase/query
]]]; nested: ClassCastException; }{[W7pOumJBSA6Anosq12rXfg][graylog2_26][2]: RemoteTransportException[[elastic-02.xxx.xx][inet[/172.30.0.163:9300]][indices:d
ata/read/search[phase/query]]]; nested: ClassCastException; }{[fo0k_dRkQEKIH3DIhxAd0A][graylog2_26][3]: RemoteTransportException[[elastic-04.xxx.xx][inet[/17
2.30.0.93:9300]][indices:data/read/search[phase/query]]]; nested: ClassCastException; }
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:237)
        at org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.onFailure(TransportSearchTypeAction.java:183)
        at org.elasticsearch.search.action.SearchServiceTransportAction$6.handleException(SearchServiceTransportAction.java:249)
        at org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:190)
        at org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:180)
        at org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:130)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:296)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:443)
        at org.elasticsearch.common.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:303)
        at org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org.elasticsearch.common.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
        at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
        at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        ... 3 more

@bernd bernd added the bug label Aug 27, 2015

@bernd bernd added this to the 1.2.0 milestone Aug 27, 2015

@kroepke

This comment has been minimized.

Member

kroepke commented Aug 27, 2015

This happens because we now allow to view the statistics of non-numeric fields, but only the cardinality is useful.
When adding to a dashboard the user can select any of the other, but invalid, functions, causing the widget calculation to fail.
We should signal this by using NaN for the stats fields and then hide the functions that make no sense.

@lennartkoopmann

This comment has been minimized.

Member

lennartkoopmann commented Aug 27, 2015

Can you make the NaN use a more gray color then the other values? This way it is much easier to distinguish no-values from values. :) (Saw the screenshot in Slack and really liked it besides that)

@kroepke kroepke changed the title from Error when accessing dashboard to Invalid statistical functions can be selected in "add to dashboard" for non-numeric fields Aug 28, 2015

edmundoa added a commit to graylog-labs/graylog2-web-interface that referenced this issue Sep 1, 2015

Display N/A when can't get count or cardinality
When the count or cardinality could not be calculated, the server will
return a negative value. As that doesn't make sense, we display "N/A" to
the user instead.

Refs Graylog2/graylog2-server#1376

@kroepke kroepke closed this in ccb0159 Sep 2, 2015

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