Uploaded image for project: 'Hawkular Metrics'
  1. Hawkular Metrics
  2. HWKMETRICS-543

Internal server error on invalid query

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 0.22.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Hawkular-services 0.20

      Description

      {{$ curl -u jdoe:password "http://127.0.0.1:8080/hawkular/metrics/metrics?id=Heap" -HHawkular-Tenant:hawkular
      HTTP/1.1 500 Internal Server Error
      [..]
      Content-Type: application/json
      Content-Length: 103

      {"errorMsg":"Failed to perform operation due to an error: OnError while emitting onNext value: *Heap*"}

      }}

      This should return the real reason and not a 500 Internal error.

      Server log shows

      17:06:00,640 ERROR [org.hawkular.metrics.api.jaxrs.util.ApiUtils] (default task-6) HAWKMETRICS200010: Failed to process request: java.lang.IllegalArgumentException: type is null
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
      at org.hawkular.metrics.model.MetricId.<init>(MetricId.java:33)
      at org.hawkular.metrics.api.jaxrs.handler.MetricHandler.lambda$findMetrics$1(MetricHandler.java:192)
      at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:69)
      at rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer.request(ScalarSynchronousObservable.java:276)
      at rx.Subscriber.setProducer(Subscriber.java:211)
      at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
      at rx.internal.operators.OnSubscribeMap$MapSubscriber.setProducer(OnSubscribeMap.java:102)
      at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:138)
      at rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe.call(ScalarSynchronousObservable.java:129)
      at rx.Observable.unsafeSubscribe(Observable.java:9860)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      at rx.Observable.unsafeSubscribe(Observable.java:9860)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      at rx.Observable.unsafeSubscribe(Observable.java:9860)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)
      at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
      at rx.Observable.unsafeSubscribe(Observable.java:9860)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
      at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
      at rx.Observable.subscribe(Observable.java:9956)
      at rx.Observable.subscribe(Observable.java:9923)
      at rx.Observable.subscribe(Observable.java:9763)
      at org.hawkular.metrics.api.jaxrs.handler.MetricHandler.findMetrics(MetricHandler.java:208)
      at org.hawkular.metrics.api.jaxrs.handler.MetricHandler$Proxy$_$$_WeldClientProxy.findMetrics(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)
      at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
      at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)
      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
      at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)
      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
      at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
      at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)
      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)
      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: rx.exceptions.OnErrorThrowable$OnNextValue: OnError while emitting onNext value: Heap
      at rx.exceptions.OnErrorThrowable.addValueAsLastCause(OnErrorThrowable.java:109)
      at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:73)
      ... 72 more

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                burmanm Michael Burman
                Reporter:
                pilhuhn Heiko Rupp
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: