Thanks
the problems could be present when graylog is empty (currently it is empty)?
this is the stack trace
2023-02-08 14:17:13,573 ERROR: org.graylog2.shared.rest.exceptionmappers.AnyExceptionClassMapper - Unhandled exception in REST resource
java.lang.IllegalStateException: Missing search type result!
at org.graylog2.rest.resources.search.SearchResource.lambda$extractSearchResponse$3(SearchResource.java:245) ~[graylog.jar:?]
at java.util.Optional.orElseThrow(Unknown Source) ~[?:?]
at org.graylog2.rest.resources.search.SearchResource.extractSearchResponse(SearchResource.java:245) ~[graylog.jar:?]
at org.graylog2.rest.resources.search.SearchResource.search(SearchResource.java:100) ~[graylog.jar:?]
at org.graylog2.rest.resources.search.RelativeSearchResource.searchRelative(RelativeSearchResource.java:106) ~[graylog.jar:?]
at jdk.internal.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391) ~[graylog.jar:?]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80) ~[graylog.jar:?]
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:255) [graylog.jar:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) [graylog.jar:?]
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) [graylog.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:292) [graylog.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:274) [graylog.jar:?]
at org.glassfish.jersey.internal.Errors.process(Errors.java:244) [graylog.jar:?]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) [graylog.jar:?]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:234) [graylog.jar:?]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) [graylog.jar:?]
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:356) [graylog.jar:?]
at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:200) [graylog.jar:?]
at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:180) [graylog.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Hi @gsmith
i’m using graylog console.
If I set the sort criteria I have that error.
Without it the response give me 200 and no error is present on the graylog log
Are you using the @ sign with timestamp?
I tried again , using the api-browser, Im unable to reproduce this error. This time im using @timestamp:desc from your post above.
Ok it seems to be related to an empty environment.
Using the same graylog installation version, with incoming logs, the API does not give me error.
So it seems to be related to a bug
Hi @patrickmann
in my comany we use Graylog as data collector and our application has an UX where we show some graylog metrix and messages using ReST API.
In order to show that information I have that error when Graylog is empty. I know that the sort operation is optional, but I need to show the messages ordered by timestamp (as graylog do).
Currently I don’t know how fix it and if there is a workaround.
So currently I can just remove the sort operation but I it cannot be the final solution.
I hope you can fix it soon
Thanks
Gianluca
I just filled in Query, Range and Sort during my testing. I see your using the Stream ID also.
So I tested this again in the lab. This is the results of that test, Unfortantly I can not reproduce issue. Am I missing something?
Ho @gsmith
I just use * as query but i don’t think that it can be a problem.
I see in you screenshot that there is a result, while in my case graylog elastic is empty.
I use timestamp field too.
If you try this same search in the UI what happens? If it works, inspect the page, turn on network logging, and then run it again and you will see the api call. Then compare that to the api call from the api browser and see if anything is different.
@Joel_Duffield sorry but I don’t understand what you suggest me.
I use the Graylog user interface to get the intormation with the ReST servicesearch/universal.
The service works if I don’t set the order criteria and it works fine without it.
In each situation I have an empty installation (so on index and no data into graylog and elasticsearch)